forked from phoenix/litellm-mirror
fix(vertex_ai_partner.py): add /chat/completion codestral support
Closes https://github.com/BerriAI/litellm/issues/4984
This commit is contained in:
parent
1ffd96b348
commit
246b3227a9
5 changed files with 30 additions and 5 deletions
|
@ -192,7 +192,7 @@ class VertexAIPartnerModels(BaseLLM):
|
|||
|
||||
if "llama" in model:
|
||||
partner = "llama"
|
||||
elif "mistral" in model:
|
||||
elif "mistral" in model or "codestral" in model:
|
||||
partner = "mistralai"
|
||||
optional_params["custom_endpoint"] = True
|
||||
|
||||
|
|
|
@ -2074,7 +2074,11 @@ def completion(
|
|||
timeout=timeout,
|
||||
client=client,
|
||||
)
|
||||
elif model.startswith("meta/") or model.startswith("mistral"):
|
||||
elif (
|
||||
model.startswith("meta/")
|
||||
or model.startswith("mistral")
|
||||
or model.startswith("codestral")
|
||||
):
|
||||
model_response = vertex_partner_models_chat_completion.completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
|
|
|
@ -2092,6 +2092,16 @@
|
|||
"mode": "chat",
|
||||
"supports_function_calling": true
|
||||
},
|
||||
"vertex_ai/codestral@latest": {
|
||||
"max_tokens": 128000,
|
||||
"max_input_tokens": 128000,
|
||||
"max_output_tokens": 128000,
|
||||
"input_cost_per_token": 0.000001,
|
||||
"output_cost_per_token": 0.000003,
|
||||
"litellm_provider": "vertex_ai-mistral_models",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true
|
||||
},
|
||||
"vertex_ai/codestral@2405": {
|
||||
"max_tokens": 128000,
|
||||
"max_input_tokens": 128000,
|
||||
|
|
|
@ -903,9 +903,10 @@ from litellm.tests.test_completion import response_format_tests
|
|||
@pytest.mark.parametrize(
|
||||
"model",
|
||||
[
|
||||
"vertex_ai/mistral-large@2407",
|
||||
"vertex_ai/mistral-nemo@2407",
|
||||
"vertex_ai/meta/llama3-405b-instruct-maas",
|
||||
# "vertex_ai/mistral-large@2407",
|
||||
# "vertex_ai/mistral-nemo@2407",
|
||||
"vertex_ai/codestral@2405",
|
||||
# "vertex_ai/meta/llama3-405b-instruct-maas",
|
||||
], #
|
||||
) # "vertex_ai",
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
@ -2092,6 +2092,16 @@
|
|||
"mode": "chat",
|
||||
"supports_function_calling": true
|
||||
},
|
||||
"vertex_ai/codestral@latest": {
|
||||
"max_tokens": 128000,
|
||||
"max_input_tokens": 128000,
|
||||
"max_output_tokens": 128000,
|
||||
"input_cost_per_token": 0.000001,
|
||||
"output_cost_per_token": 0.000003,
|
||||
"litellm_provider": "vertex_ai-mistral_models",
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true
|
||||
},
|
||||
"vertex_ai/codestral@2405": {
|
||||
"max_tokens": 128000,
|
||||
"max_input_tokens": 128000,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue