The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(google.py): fix cost tracking for vertex ai mistral models
Krrish Dholakiaf04160df466b
diff --git a/litellm/litellm_core_utils/llm_cost_calc/google.py b/litellm/litellm_core_utils/llm_cost_calc/google.pyindex 26eeb7b7a74..0642f101e92 100644--- a/litellm/litellm_core_utils/llm_cost_calc/google.py+++ b/litellm/litellm_core_utils/llm_cost_calc/google.py@@ -44,7 +44,9 @@ def cost_router(Returns- str, the specific google cost calc function it should route to."""- if custom_llm_provider == "vertex_ai" and ("claude" in model or "llama" in model):+ if custom_llm_provider == "vertex_ai" and (+ "claude" in model or "llama" in model or "mistral" in model+ ):return "cost_per_token"elif custom_llm_provider == "gemini":return "cost_per_token"diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.pyindex 96ea3232829..438997b3833 100644--- a/litellm/tests/test_amazing_vertex_completion.py+++ b/litellm/tests/test_amazing_vertex_completion.py@@ -904,6 +904,7 @@ from litellm.tests.test_completion import response_format_tests"model",["vertex_ai/mistral-large@2407",+ "vertex_ai/mistral-nemo@2407","vertex_ai/meta/llama3-405b-instruct-maas",], #) # "vertex_ai",