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 sonnet 3.7 tests
Sameer Kankute4d6b7699cc6e
diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.pyindex e2404371782..8630ba65610 100644--- a/tests/llm_translation/test_anthropic_completion.py+++ b/tests/llm_translation/test_anthropic_completion.py@@ -489,7 +489,7 @@ class TestAnthropicCompletion(BaseLLMChatTest, BaseAnthropicChatTest):def get_base_completion_call_args_with_thinking(self) -> dict:return {- "model": "anthropic/claude-3-7-sonnet-latest",+ "model": "anthropic/claude-sonnet-4-5-20250929","thinking": {"type": "enabled", "budget_tokens": 16000},}@@ -701,7 +701,7 @@ def test_anthropic_tool_with_image():]result = prompt_factory(- model="claude-3-5-sonnet-20240620",+ model="claude-sonnet-4-5-20250929",messages=messages,custom_llm_provider="anthropic",)@@ -761,7 +761,7 @@ def test_anthropic_map_openai_params_tools_and_json_schema():mapped_params = litellm.AnthropicConfig().map_openai_params(non_default_params=args["non_default_params"],optional_params={},- model="claude-3-5-sonnet-20240620",+ model="claude-sonnet-4-5-20250929",drop_params=False,)@@ -803,7 +803,7 @@ def test_anthropic_map_openai_params_tools_with_defs():mapped_params = litellm.AnthropicConfig().map_openai_params(non_default_params=args["non_default_params"],optional_params={},- model="claude-3-5-sonnet-20240620",+ model="claude-sonnet-4-5-20250929",drop_params=False,)@@ -1133,7 +1133,7 @@ def test_anthropic_custom_headers():with patch.object(client, "post") as mock_post:try:resp = completion(- model="claude-3-5-sonnet-20240620",+ model="claude-sonnet-4-5-20250929",headers={"anthropic-beta": "computer-use-2025-01-24"},messages=[{"role": "user", "content": "What is the capital of France?"}diff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.pyindex 7fb57cef9ee..3c421e1509a 100644--- a/tests/local_testing/test_caching.py+++ b/tests/local_testing/test_caching.py@@ -2647,13 +2647,13 @@ def test_caching_with_reasoning_content():litellm.cache = Cache()response_1 = completion(- model="anthropic/claude-3-7-sonnet-latest",+ model="anthropic/claude-sonnet-4-5-20250929",messages=messages,thinking={"type": "enabled", "budget_tokens": 1024},)response_2 = completion(- model="anthropic/claude-3-7-sonnet-latest",+ model="anthropic/claude-sonnet-4-5-20250929",messages=messages,thinking={"type": "enabled", "budget_tokens": 1024},)@@ -2671,14 +2671,14 @@ def test_caching_reasoning_args_miss(): # test in memory cachelitellm.set_verbose = Truelitellm.cache = Cache()response1 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,reasoning_effort="low",mock_response="My response",)response2 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,mock_response="My response",@@ -2697,14 +2697,14 @@ def test_caching_reasoning_args_hit(): # test in memory cachelitellm.set_verbose = Truelitellm.cache = Cache()response1 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,reasoning_effort="low",mock_response="My response",)response2 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,reasoning_effort="low",@@ -2724,14 +2724,14 @@ def test_caching_thinking_args_miss(): # test in memory cachelitellm.set_verbose = Truelitellm.cache = Cache()response1 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,thinking={"type": "enabled", "budget_tokens": 1024},mock_response="My response",)response2 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,mock_response="My response",@@ -2750,14 +2750,14 @@ def test_caching_thinking_args_hit(): # test in memory cachelitellm.set_verbose = Truelitellm.cache = Cache()response1 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,thinking={"type": "enabled", "budget_tokens": 1024},mock_response="My response",)response2 = completion(- model="claude-3-7-sonnet-latest",+ model="claude-4-sonnet-20250514",messages=messages,caching=True,thinking={"type": "enabled", "budget_tokens": 1024},