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(model_prices): absorb Databricks/Z.AI and xAI registry PRs, add Together and Azure deprecation dates
Devin AI5d26ae0fcd77
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex cfa06ff5f81..0d867955544 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -15167,6 +15167,34 @@"output_dbu_cost_per_token": 7.143e-06,"source": "https://www.databricks.com/product/pricing/foundation-model-serving"},+ "databricks/databricks-glm-5-2": {+ "cache_creation_input_token_cost": 1.4e-06,+ "cache_read_input_token_cost": 2.5998e-07,+ "input_cost_per_token": 1.4e-06,+ "input_dbu_cost_per_token": 2e-05,+ "litellm_provider": "databricks",+ "max_input_tokens": 1000000,+ "max_output_tokens": 131072,+ "max_tokens": 131072,+ "metadata": {+ "notes": "Input/output cost per token is dbu cost * $0.070. Billing reads the per-token dollar fields; the '*_dbu_cost_per_token' fields are the published Databricks rates, kept for reference."+ },+ "mode": "chat",+ "output_cost_per_token": 4.39999e-06,+ "output_dbu_cost_per_token": 6.2857e-05,+ "source": "https://www.databricks.com/product/pricing/foundation-model-serving",+ "supported_modalities": [+ "text"+ ],+ "supported_output_modalities": [+ "text"+ ],+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true,+ "supports_vision": false+ },"databricks/databricks-gpt-5": {"cache_creation_input_token_cost": 1.24999e-06,"cache_read_input_token_cost": 1.2502e-07,@@ -15434,6 +15462,35 @@"output_vector_size": 1024,"source": "https://www.databricks.com/product/pricing/foundation-model-serving"},+ "databricks/databricks-kimi-k3": {+ "cache_creation_input_token_cost": 2.99999e-06,+ "cache_read_input_token_cost": 3.0002e-07,+ "input_cost_per_token": 2.99999e-06,+ "input_dbu_cost_per_token": 4.2857e-05,+ "litellm_provider": "databricks",+ "max_input_tokens": 1000000,+ "max_output_tokens": 1048576,+ "max_tokens": 1048576,+ "metadata": {+ "notes": "Input/output cost per token is dbu cost * $0.070. Billing reads the per-token dollar fields; the '*_dbu_cost_per_token' fields are the published Databricks rates, kept for reference."+ },+ "mode": "chat",+ "output_cost_per_token": 1.500002e-05,+ "output_dbu_cost_per_token": 0.000214286,+ "source": "https://www.databricks.com/product/pricing/foundation-model-serving",+ "supported_modalities": [+ "text",+ "image"+ ],+ "supported_output_modalities": [+ "text"+ ],+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true,+ "supports_vision": true+ },"databricks/databricks-llama-2-70b-chat": {"cache_creation_input_token_cost": 5.0001e-07,"cache_read_input_token_cost": 5.0001e-07,@@ -38329,7 +38386,7 @@"max_output_tokens": 20480,"max_tokens": 20480,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 7e-06,@@ -38358,7 +38415,7 @@"max_output_tokens": 8192,"max_tokens": 8192,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 1.25e-06,@@ -38373,7 +38430,7 @@"litellm_provider": "together_ai","max_tokens": 16384,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 1.7e-06,@@ -38794,6 +38851,7 @@"supports_tool_choice": true},"together_ai/deepseek-ai/DeepSeek-V4-Pro": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 2e-07,"input_cost_per_token": 1.74e-06,"litellm_provider": "together_ai",@@ -38886,6 +38944,7 @@"supports_prompt_caching": true},"together_ai/moonshotai/Kimi-K2.7-Code": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 1.9e-07,"input_cost_per_token": 9.5e-07,"litellm_provider": "together_ai",@@ -38921,6 +38980,7 @@"supports_vision": true},"together_ai/nvidia/nemotron-3-ultra-550b-a55b": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 2e-07,"input_cost_per_token": 6e-07,"litellm_provider": "together_ai",@@ -38938,6 +38998,7 @@"supports_tool_choice": true},"together_ai/pearl-ai/gemma-4-31b-it": {+ "deprecation_date": "2026-08-27","input_cost_per_token": 2.8e-07,"litellm_provider": "together_ai","max_input_tokens": 262144,@@ -43788,85 +43849,6 @@"/v1/audio/transcriptions"]},- "xai/grok-2": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-1212": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-latest": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-vision": {- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },- "xai/grok-2-vision-1212": {- "deprecation_date": "2026-02-28",- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },- "xai/grok-2-vision-latest": {- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"xai/grok-3": {"cache_read_input_token_cost": 7.5e-07,"input_cost_per_token": 3e-06,@@ -44252,7 +44234,7 @@"max_input_tokens": 1000000,"max_output_tokens": 1000000,"max_tokens": 1000000,- "mode": "chat",+ "mode": "responses","output_cost_per_token": 2.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,@@ -44264,7 +44246,10 @@"input_cost_per_token_above_200k_tokens": 2.5e-06,"output_cost_per_token_above_200k_tokens": 5e-06,"cache_read_input_token_cost_above_200k_tokens": 4e-07,- "supports_response_schema": true+ "supports_response_schema": true,+ "supported_endpoints": [+ "/v1/responses"+ ]},"xai/grok-4.20-beta-0309-reasoning": {"cache_read_input_token_cost": 2e-07,@@ -44433,19 +44418,6 @@"supports_vision": true,"supports_web_search": true},- "xai/grok-beta": {- "input_cost_per_token": 5e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1.5e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"xai/grok-code-fast": {"cache_read_input_token_cost": 2e-07,"input_cost_per_token": 1e-06,@@ -44509,20 +44481,6 @@"supports_vision": true,"deprecation_date": "2026-05-15"},- "xai/grok-vision-beta": {- "input_cost_per_image": 5e-06,- "input_cost_per_token": 5e-06,- "litellm_provider": "xai",- "max_input_tokens": 8192,- "max_output_tokens": 8192,- "max_tokens": 8192,- "mode": "chat",- "output_cost_per_token": 1.5e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"zai.glm-4.7": {"input_cost_per_token": 6e-07,"litellm_provider": "bedrock_converse",@@ -44581,6 +44539,21 @@"supports_tool_choice": true,"source": "https://docs.z.ai/guides/overview/pricing"},+ "zai/glm-5.3": {+ "cache_creation_input_token_cost": 0,+ "cache_read_input_token_cost": 2.6e-07,+ "input_cost_per_token": 1.4e-06,+ "litellm_provider": "zai",+ "max_input_tokens": 1000000,+ "max_output_tokens": 128000,+ "mode": "chat",+ "output_cost_per_token": 4.4e-06,+ "source": "https://docs.z.ai/guides/overview/pricing",+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true+ },"zai/glm-5.1": {"cache_creation_input_token_cost": 0,"cache_read_input_token_cost": 2.6e-07,@@ -44786,6 +44759,7 @@]},"azure/sora-2": {+ "deprecation_date": "2026-10-15","litellm_provider": "azure","mode": "video_generation","output_cost_per_video_per_second": 0.1,@@ -51240,7 +51214,7 @@"max_input_tokens": 1000000,"max_output_tokens": 1000000,"max_tokens": 1000000,- "mode": "chat",+ "mode": "responses","output_cost_per_token": 2.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,@@ -51252,7 +51226,10 @@"input_cost_per_token_above_200k_tokens": 2.5e-06,"output_cost_per_token_above_200k_tokens": 5e-06,"cache_read_input_token_cost_above_200k_tokens": 4e-07,- "supports_response_schema": true+ "supports_response_schema": true,+ "supported_endpoints": [+ "/v1/responses"+ ]},"xai/grok-build-0.1": {"cache_read_input_token_cost": 2e-07,diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex cfa06ff5f81..0d867955544 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -15167,6 +15167,34 @@"output_dbu_cost_per_token": 7.143e-06,"source": "https://www.databricks.com/product/pricing/foundation-model-serving"},+ "databricks/databricks-glm-5-2": {+ "cache_creation_input_token_cost": 1.4e-06,+ "cache_read_input_token_cost": 2.5998e-07,+ "input_cost_per_token": 1.4e-06,+ "input_dbu_cost_per_token": 2e-05,+ "litellm_provider": "databricks",+ "max_input_tokens": 1000000,+ "max_output_tokens": 131072,+ "max_tokens": 131072,+ "metadata": {+ "notes": "Input/output cost per token is dbu cost * $0.070. Billing reads the per-token dollar fields; the '*_dbu_cost_per_token' fields are the published Databricks rates, kept for reference."+ },+ "mode": "chat",+ "output_cost_per_token": 4.39999e-06,+ "output_dbu_cost_per_token": 6.2857e-05,+ "source": "https://www.databricks.com/product/pricing/foundation-model-serving",+ "supported_modalities": [+ "text"+ ],+ "supported_output_modalities": [+ "text"+ ],+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true,+ "supports_vision": false+ },"databricks/databricks-gpt-5": {"cache_creation_input_token_cost": 1.24999e-06,"cache_read_input_token_cost": 1.2502e-07,@@ -15434,6 +15462,35 @@"output_vector_size": 1024,"source": "https://www.databricks.com/product/pricing/foundation-model-serving"},+ "databricks/databricks-kimi-k3": {+ "cache_creation_input_token_cost": 2.99999e-06,+ "cache_read_input_token_cost": 3.0002e-07,+ "input_cost_per_token": 2.99999e-06,+ "input_dbu_cost_per_token": 4.2857e-05,+ "litellm_provider": "databricks",+ "max_input_tokens": 1000000,+ "max_output_tokens": 1048576,+ "max_tokens": 1048576,+ "metadata": {+ "notes": "Input/output cost per token is dbu cost * $0.070. Billing reads the per-token dollar fields; the '*_dbu_cost_per_token' fields are the published Databricks rates, kept for reference."+ },+ "mode": "chat",+ "output_cost_per_token": 1.500002e-05,+ "output_dbu_cost_per_token": 0.000214286,+ "source": "https://www.databricks.com/product/pricing/foundation-model-serving",+ "supported_modalities": [+ "text",+ "image"+ ],+ "supported_output_modalities": [+ "text"+ ],+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true,+ "supports_vision": true+ },"databricks/databricks-llama-2-70b-chat": {"cache_creation_input_token_cost": 5.0001e-07,"cache_read_input_token_cost": 5.0001e-07,@@ -38329,7 +38386,7 @@"max_output_tokens": 20480,"max_tokens": 20480,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 7e-06,@@ -38358,7 +38415,7 @@"max_output_tokens": 8192,"max_tokens": 8192,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 1.25e-06,@@ -38373,7 +38430,7 @@"litellm_provider": "together_ai","max_tokens": 16384,"metadata": {- "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro"+ "successor": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"},"mode": "chat","output_cost_per_token": 1.7e-06,@@ -38794,6 +38851,7 @@"supports_tool_choice": true},"together_ai/deepseek-ai/DeepSeek-V4-Pro": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 2e-07,"input_cost_per_token": 1.74e-06,"litellm_provider": "together_ai",@@ -38886,6 +38944,7 @@"supports_prompt_caching": true},"together_ai/moonshotai/Kimi-K2.7-Code": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 1.9e-07,"input_cost_per_token": 9.5e-07,"litellm_provider": "together_ai",@@ -38921,6 +38980,7 @@"supports_vision": true},"together_ai/nvidia/nemotron-3-ultra-550b-a55b": {+ "deprecation_date": "2026-08-27","cache_read_input_token_cost": 2e-07,"input_cost_per_token": 6e-07,"litellm_provider": "together_ai",@@ -38938,6 +38998,7 @@"supports_tool_choice": true},"together_ai/pearl-ai/gemma-4-31b-it": {+ "deprecation_date": "2026-08-27","input_cost_per_token": 2.8e-07,"litellm_provider": "together_ai","max_input_tokens": 262144,@@ -43788,85 +43849,6 @@"/v1/audio/transcriptions"]},- "xai/grok-2": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-1212": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-latest": {- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_web_search": true- },- "xai/grok-2-vision": {- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },- "xai/grok-2-vision-1212": {- "deprecation_date": "2026-02-28",- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },- "xai/grok-2-vision-latest": {- "input_cost_per_image": 2e-06,- "input_cost_per_token": 2e-06,- "litellm_provider": "xai",- "max_input_tokens": 32768,- "max_output_tokens": 32768,- "max_tokens": 32768,- "mode": "chat",- "output_cost_per_token": 1e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"xai/grok-3": {"cache_read_input_token_cost": 7.5e-07,"input_cost_per_token": 3e-06,@@ -44252,7 +44234,7 @@"max_input_tokens": 1000000,"max_output_tokens": 1000000,"max_tokens": 1000000,- "mode": "chat",+ "mode": "responses","output_cost_per_token": 2.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,@@ -44264,7 +44246,10 @@"input_cost_per_token_above_200k_tokens": 2.5e-06,"output_cost_per_token_above_200k_tokens": 5e-06,"cache_read_input_token_cost_above_200k_tokens": 4e-07,- "supports_response_schema": true+ "supports_response_schema": true,+ "supported_endpoints": [+ "/v1/responses"+ ]},"xai/grok-4.20-beta-0309-reasoning": {"cache_read_input_token_cost": 2e-07,@@ -44433,19 +44418,6 @@"supports_vision": true,"supports_web_search": true},- "xai/grok-beta": {- "input_cost_per_token": 5e-06,- "litellm_provider": "xai",- "max_input_tokens": 131072,- "max_output_tokens": 131072,- "max_tokens": 131072,- "mode": "chat",- "output_cost_per_token": 1.5e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"xai/grok-code-fast": {"cache_read_input_token_cost": 2e-07,"input_cost_per_token": 1e-06,@@ -44509,20 +44481,6 @@"supports_vision": true,"deprecation_date": "2026-05-15"},- "xai/grok-vision-beta": {- "input_cost_per_image": 5e-06,- "input_cost_per_token": 5e-06,- "litellm_provider": "xai",- "max_input_tokens": 8192,- "max_output_tokens": 8192,- "max_tokens": 8192,- "mode": "chat",- "output_cost_per_token": 1.5e-05,- "supports_function_calling": true,- "supports_tool_choice": true,- "supports_vision": true,- "supports_web_search": true- },"zai.glm-4.7": {"input_cost_per_token": 6e-07,"litellm_provider": "bedrock_converse",@@ -44581,6 +44539,21 @@"supports_tool_choice": true,"source": "https://docs.z.ai/guides/overview/pricing"},+ "zai/glm-5.3": {+ "cache_creation_input_token_cost": 0,+ "cache_read_input_token_cost": 2.6e-07,+ "input_cost_per_token": 1.4e-06,+ "litellm_provider": "zai",+ "max_input_tokens": 1000000,+ "max_output_tokens": 128000,+ "mode": "chat",+ "output_cost_per_token": 4.4e-06,+ "source": "https://docs.z.ai/guides/overview/pricing",+ "supports_function_calling": true,+ "supports_prompt_caching": true,+ "supports_reasoning": true,+ "supports_tool_choice": true+ },"zai/glm-5.1": {"cache_creation_input_token_cost": 0,"cache_read_input_token_cost": 2.6e-07,@@ -44786,6 +44759,7 @@]},"azure/sora-2": {+ "deprecation_date": "2026-10-15","litellm_provider": "azure","mode": "video_generation","output_cost_per_video_per_second": 0.1,@@ -51240,7 +51214,7 @@"max_input_tokens": 1000000,"max_output_tokens": 1000000,"max_tokens": 1000000,- "mode": "chat",+ "mode": "responses","output_cost_per_token": 2.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,@@ -51252,7 +51226,10 @@"input_cost_per_token_above_200k_tokens": 2.5e-06,"output_cost_per_token_above_200k_tokens": 5e-06,"cache_read_input_token_cost_above_200k_tokens": 4e-07,- "supports_response_schema": true+ "supports_response_schema": true,+ "supported_endpoints": [+ "/v1/responses"+ ]},"xai/grok-build-0.1": {"cache_read_input_token_cost": 2e-07,diff --git a/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py b/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.pyindex 21f047b753c..29ad8ee4b6e 100644--- a/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py+++ b/tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py@@ -61,6 +61,8 @@ PUBLISHED_DBU_PER_MILLION: Final = {"databricks/databricks-gemini-3-1-flash-lite": ("4.464", "26.786", "4.464", "0.446"),"databricks/databricks-gemini-2-5-pro": ("22.321", "178.571", "22.321", "2.232"),"databricks/databricks-gemini-2-5-flash": ("5.357", "44.643", "5.357", "0.536"),+ "databricks/databricks-kimi-k3": ("42.857", "214.286", "42.857", "4.286"),+ "databricks/databricks-glm-5-2": ("20.000", "62.857", "20.000", "3.714"),}PROMOTIONAL_DISCOUNT: Final = 0.80PROMOTION_EXPIRES: Final = "2027-01-31"diff --git a/tests/test_litellm/llms/xai/test_xai_model_registry.py b/tests/test_litellm/llms/xai/test_xai_model_registry.pynew file mode 100644index 00000000000..25b2002968d--- /dev/null+++ b/tests/test_litellm/llms/xai/test_xai_model_registry.py@@ -0,0 +1,75 @@+"""+Registry regression tests for xAI entries in the model cost map.+"""++from __future__ import annotations++import json+from pathlib import Path++import pytest++REPO_ROOT = Path(__file__).parents[4]+PRICES_PATH = REPO_ROOT / "model_prices_and_context_window.json"+BACKUP_PRICES_PATH = REPO_ROOT / "litellm" / "model_prices_and_context_window_backup.json"++# Retired by xAI and no longer served: requests to these slugs 404 rather than+# redirecting, and they are absent from https://docs.x.ai/docs/models+RETIRED_MODELS = (+ "xai/grok-2",+ "xai/grok-2-1212",+ "xai/grok-2-latest",+ "xai/grok-2-vision",+ "xai/grok-2-vision-1212",+ "xai/grok-2-vision-latest",+ "xai/grok-beta",+ "xai/grok-vision-beta",+)++# https://docs.x.ai/developers/model-capabilities/text/multi-agent+# "The multi-agent model does not work with the OpenAI Chat Completions API."+RESPONSES_ONLY_MODELS = (+ "xai/grok-4.20-multi-agent-0309",+ "xai/grok-4.20-multi-agent-beta-0309",+)++MAP_PATHS = (PRICES_PATH, BACKUP_PRICES_PATH)++[email protected](scope="module", params=[p.name for p in MAP_PATHS])+def cost_map(request: pytest.FixtureRequest) -> dict:+ path = next(p for p in MAP_PATHS if p.name == request.param)+ return json.loads(path.read_text(encoding="utf-8"))++[email protected]("model", RETIRED_MODELS)+def test_retired_xai_models_are_not_advertised(cost_map: dict, model: str):+ assert model not in cost_map++[email protected]("model", RESPONSES_ONLY_MODELS)+def test_multi_agent_models_are_responses_only(cost_map: dict, model: str):+ entry = cost_map[model]+ assert entry["supported_endpoints"] == ["/v1/responses"]+ assert entry["mode"] == "responses"+ assert "/v1/chat/completions" not in entry["supported_endpoints"]+++def test_surviving_xai_chat_models_still_serve_chat_completions(cost_map: dict):+ """Guard against the removal above over-reaching into live models."""+ chat_models = [+ key+ for key, value in cost_map.items()+ if isinstance(value, dict) and value.get("litellm_provider") == "xai" and value.get("mode") == "chat"+ ]+ assert "xai/grok-4.3" in chat_models+ assert "xai/grok-4.6" in chat_models+ assert not any(key.startswith("xai/grok-2") for key in chat_models)+++def test_both_cost_maps_agree_on_xai_entries():+ prices = json.loads(PRICES_PATH.read_text(encoding="utf-8"))+ backup = json.loads(BACKUP_PRICES_PATH.read_text(encoding="utf-8"))+ xai_keys = {k for k, v in prices.items() if isinstance(v, dict) and v.get("litellm_provider") == "xai"}+ assert xai_keys+ assert {k: prices[k] for k in xai_keys} == {k: backup[k] for k in xai_keys}diff --git a/tests/test_litellm/test_together_ai_model_metadata.py b/tests/test_litellm/test_together_ai_model_metadata.pyindex 60e4b8ddb4d..32d0769becc 100644--- a/tests/test_litellm/test_together_ai_model_metadata.py+++ b/tests/test_litellm/test_together_ai_model_metadata.py@@ -15,10 +15,8 @@ COST_MAP_ADAPTER: Final = TypeAdapter(CostMap)SERVERLESS_CHAT_MODELS: Final = ("together_ai/moonshotai/Kimi-K3","together_ai/zai-org/GLM-5.2",- "together_ai/deepseek-ai/DeepSeek-V4-Pro","together_ai/deepseek-ai/DeepSeek-V4-Pro-0813","together_ai/deepseek-ai/DeepSeek-V4-Flash-0731",- "together_ai/moonshotai/Kimi-K2.7-Code","together_ai/MiniMaxAI/MiniMax-M3","together_ai/thinkingmachines/Inkling","together_ai/thinkingmachines/Inkling-Small",@@ -27,10 +25,8 @@ SERVERLESS_CHAT_MODELS: Final = ("together_ai/Qwen/Qwen3.7-Plus","together_ai/Qwen/Qwen3.6-Plus","together_ai/Qwen/Qwen3.5-9B",- "together_ai/nvidia/nemotron-3-ultra-550b-a55b","together_ai/meta-models/Muse-Glimmer-30B","together_ai/google/gemma-4-31B-it",- "together_ai/pearl-ai/gemma-4-31b-it","together_ai/arize-ai/qwen-2-1.5b-instruct","together_ai/Prism-ML/Ternary-Bonsai-27B","together_ai/openai/gpt-oss-120b",@@ -39,6 +35,10 @@ SERVERLESS_CHAT_MODELS: Final = ()DEPRECATED_MODELS: Final = {+ "together_ai/nvidia/nemotron-3-ultra-550b-a55b": "2026-08-27",+ "together_ai/pearl-ai/gemma-4-31b-it": "2026-08-27",+ "together_ai/deepseek-ai/DeepSeek-V4-Pro": "2026-08-27",+ "together_ai/moonshotai/Kimi-K2.7-Code": "2026-08-27","together_ai/google/gemma-3n-E4B-it": "2026-08-25","together_ai/meta-llama/Llama-Guard-4-12B": "2026-08-25","together_ai/Qwen/Qwen3-235B-A22B-Instruct-2507-tput": "2026-07-10",