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
Add support for sarvam models
Sameer Kankute46c0f903a3a4
diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.jsonindex bda3684a8a8..9104aef1a8c 100644--- a/litellm/llms/openai_like/providers.json+++ b/litellm/llms/openai_like/providers.json@@ -71,5 +71,16 @@"param_mappings": {"max_completion_tokens": "max_tokens"}+ },+ "sarvam": {+ "base_url": "https://api.sarvam.ai/v1",+ "api_key_env": "SARVAM_API_KEY",+ "base_class": "openai_gpt",+ "param_mappings": {+ "max_completion_tokens": "max_tokens"+ },+ "headers": {+ "api-subscription-key": "{api_key}"+ }}}diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 135b0d46ed0..f58426308de 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -34062,5 +34062,18 @@"output_cost_per_token": 0,"litellm_provider": "llamagate","mode": "embedding"+ },+ "sarvam/sarvam-m": {+ "cache_creation_input_token_cost": 0,+ "cache_creation_input_token_cost_above_1hr": 0,+ "cache_read_input_token_cost": 0,+ "input_cost_per_token": 0,+ "litellm_provider": "sarvam",+ "max_input_tokens": 8192,+ "max_output_tokens": 32000,+ "max_tokens": 32000,+ "mode": "chat",+ "output_cost_per_token": 0,+ "supports_reasoning": true}}diff --git a/litellm/router.py b/litellm/router.pyindex 3e312c154b4..62070d23755 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -63,6 +63,7 @@ from litellm.litellm_core_utils.credential_accessor import CredentialAccessorfrom litellm.litellm_core_utils.dd_tracing import tracerfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingfrom litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMasker+from litellm.llms.openai_like.json_loader import JSONProviderRegistryfrom litellm.router_strategy.budget_limiter import RouterBudgetLimitingfrom litellm.router_strategy.least_busy import LeastBusyLoggingHandlerfrom litellm.router_strategy.lowest_cost import LowestCostLoggingHandler@@ -5877,7 +5878,8 @@ class Router:),)# done reading model["litellm_params"]- if custom_llm_provider not in litellm.provider_list:+ # Check if provider is supported: either in enum or JSON-configured+ if custom_llm_provider not in litellm.provider_list and not JSONProviderRegistry.exists(custom_llm_provider):raise Exception(f"Unsupported provider - {custom_llm_provider}")#### DEPLOYMENT NAMES INIT ########diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 135b0d46ed0..f58426308de 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -34062,5 +34062,18 @@"output_cost_per_token": 0,"litellm_provider": "llamagate","mode": "embedding"+ },+ "sarvam/sarvam-m": {+ "cache_creation_input_token_cost": 0,+ "cache_creation_input_token_cost_above_1hr": 0,+ "cache_read_input_token_cost": 0,+ "input_cost_per_token": 0,+ "litellm_provider": "sarvam",+ "max_input_tokens": 8192,+ "max_output_tokens": 32000,+ "max_tokens": 32000,+ "mode": "chat",+ "output_cost_per_token": 0,+ "supports_reasoning": true}}