mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-29 23:04:16 +00:00
Merge branch 'main' into rag-metadata-support
This commit is contained in:
commit
b51427716d
10 changed files with 447 additions and 45 deletions
|
|
@ -62,6 +62,9 @@ class LiteLLMOpenAIMixin(
|
|||
Inference,
|
||||
NeedsRequestProviderData,
|
||||
):
|
||||
# TODO: avoid exposing the litellm specific model names to the user.
|
||||
# potential change: add a prefix param that gets added to the model name
|
||||
# when calling litellm.
|
||||
def __init__(
|
||||
self,
|
||||
model_entries,
|
||||
|
|
@ -92,7 +95,9 @@ class LiteLLMOpenAIMixin(
|
|||
return model
|
||||
|
||||
def get_litellm_model_name(self, model_id: str) -> str:
|
||||
return "openai/" + model_id if self.is_openai_compat else model_id
|
||||
# users may be using openai/ prefix in their model names. the openai/models.py did this by default.
|
||||
# model_id.startswith("openai/") is for backwards compatibility.
|
||||
return "openai/" + model_id if self.is_openai_compat and not model_id.startswith("openai/") else model_id
|
||||
|
||||
async def completion(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue