From 4d6b7699cc6e512ed2368eb7a04f66372a30c6f4 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Fri, 20 Feb 2026 09:16:24 +0530 Subject: [PATCH] Fix sonnet 3.7 tests --- .../test_anthropic_completion.py | 10 +++++----- tests/local_testing/test_caching.py | 20 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.py index e240437178..8630ba6561 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.py index 7fb57cef9e..3c421e1509 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 cache litellm.set_verbose = True litellm.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 cache litellm.set_verbose = True litellm.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 cache litellm.set_verbose = True litellm.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 cache litellm.set_verbose = True litellm.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},