diff --git a/litellm/llms/vertex_ai_partner.py b/litellm/llms/vertex_ai_partner.py index eb24c4d26..764202917 100644 --- a/litellm/llms/vertex_ai_partner.py +++ b/litellm/llms/vertex_ai_partner.py @@ -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 diff --git a/litellm/main.py b/litellm/main.py index 429efb6c0..b01fba5b2 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -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, diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 91fd044ce..380771c66 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -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, diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py index 438997b38..f0b243c36 100644 --- a/litellm/tests/test_amazing_vertex_completion.py +++ b/litellm/tests/test_amazing_vertex_completion.py @@ -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( diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 91fd044ce..380771c66 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -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,