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): correct replicate model key typo (#34800)
Akash Naickare6e18d406a9a
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 02b3cde217a..1fb56a85923 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -33052,7 +33052,7 @@"supports_tool_choice": true,"supports_response_schema": true},- "replicateopenai/gpt-oss-20b": {+ "replicate/openai/gpt-oss-20b": {"input_cost_per_token": 9e-08,"output_cost_per_token": 3.6e-07,"litellm_provider": "replicate",diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex bc7330ec99c..8ef0116416d 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -33143,7 +33143,7 @@"supports_tool_choice": true,"supports_response_schema": true},- "replicateopenai/gpt-oss-20b": {+ "replicate/openai/gpt-oss-20b": {"input_cost_per_token": 9e-08,"output_cost_per_token": 3.6e-07,"litellm_provider": "replicate",diff --git a/tests/test_litellm/test_replicate_model_key_format.py b/tests/test_litellm/test_replicate_model_key_format.pynew file mode 100644index 00000000000..8c2b72f8ed2--- /dev/null+++ b/tests/test_litellm/test_replicate_model_key_format.py@@ -0,0 +1,43 @@+import json+from pathlib import Path+from typing import Any++import pytest+++def model_cost() -> dict[str, Any]:+ json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json"+ with open(json_path, encoding="utf-8") as f:+ return json.load(f)+++def test_replicate_models_have_valid_key_prefix(model_cost: dict[str, Any]) -> None:+ replicate_models = {k for k, v in model_cost.items() if v.get("litellm_provider") == "replicate"}+ malformed = [k for k in replicate_models if not k.startswith("replicate/")]+ assert not malformed, (+ f"Replicate models must use 'replicate/owner/model' key format, found malformed keys: {malformed}"+ )+++def test_replicate_openai_gpt_oss_20b_key_exists(model_cost: dict[str, Any]) -> None:+ assert "replicate/openai/gpt-oss-20b" in model_cost+ info = model_cost["replicate/openai/gpt-oss-20b"]+ assert info["litellm_provider"] == "replicate"+ assert info["mode"] == "chat"+ assert info["supports_function_calling"] is True+++def test_replicate_backup_matches_main() -> None:+ repo_root = Path(__file__).parents[2]+ main_path = repo_root / "model_prices_and_context_window.json"+ backup_path = repo_root / "litellm" / "model_prices_and_context_window_backup.json"++ with open(main_path, encoding="utf-8") as f:+ main_cost: dict[str, Any] = json.load(f)+ with open(backup_path, encoding="utf-8") as f:+ backup_cost: dict[str, Any] = json.load(f)++ for key in main_cost:+ if main_cost[key].get("litellm_provider") == "replicate":+ assert backup_cost.get(key) == main_cost.get(key), f"{key} differs between main and backup model cost maps"