mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-17 04:26:20 +00:00
fix(vertex_ai_partner.py): add /chat/completion codestral support
Closes https://github.com/BerriAI/litellm/issues/4984
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+5
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user