From e3917c9d08bc40bf42d687078a54ab8d49981d84 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 1 May 2026 19:10:27 -0700 Subject: [PATCH 1/3] [Test] Anthropic: Replace Legacy Claude-4-Sonnet Alias With Haiku 4.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three live-API tests pinned to claude-4-sonnet-20250514, which is a non-canonical alias of claude-sonnet-4-20250514. Anthropic's main API no longer resolves the legacy form under freshly issued keys, so the tests fail with not_found_error. The token counter test pinned to claude-sonnet-4-20250514 itself (deprecation_date 2026-05-14, two weeks out) was on borrowed time too. Bump all four to claude-haiku-4-5-20251001 — capability superset for what these tests exercise (streaming, parallel tool calling, extended thinking, token counting), no upcoming deprecation, cheaper per-token. --- tests/litellm_utils_tests/test_anthropic_token_counter.py | 2 +- tests/local_testing/test_function_calling.py | 2 +- tests/local_testing/test_streaming.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/litellm_utils_tests/test_anthropic_token_counter.py b/tests/litellm_utils_tests/test_anthropic_token_counter.py index d099eb4f8e9..028586203a5 100644 --- a/tests/litellm_utils_tests/test_anthropic_token_counter.py +++ b/tests/litellm_utils_tests/test_anthropic_token_counter.py @@ -26,7 +26,7 @@ class TestAnthropicTokenCounter(BaseTokenCounterTest): return AnthropicTokenCounter() def get_test_model(self) -> str: - return "claude-sonnet-4-20250514" + return "claude-haiku-4-5-20251001" def get_test_messages(self) -> List[Dict[str, Any]]: return [{"role": "user", "content": "Hello, how are you today?"}] diff --git a/tests/local_testing/test_function_calling.py b/tests/local_testing/test_function_calling.py index 02affa1d57c..6fd253ee294 100644 --- a/tests/local_testing/test_function_calling.py +++ b/tests/local_testing/test_function_calling.py @@ -158,7 +158,7 @@ def test_aaparallel_function_call(model): @pytest.mark.parametrize( "model", [ - "anthropic/claude-4-sonnet-20250514", + "anthropic/claude-haiku-4-5-20251001", "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0", ], ) diff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.py index bc3c34b1a5d..7fe42ed5461 100644 --- a/tests/local_testing/test_streaming.py +++ b/tests/local_testing/test_streaming.py @@ -1270,7 +1270,7 @@ def test_bedrock_claude_3_streaming(): @pytest.mark.parametrize( "model", [ - "claude-4-sonnet-20250514", + "claude-haiku-4-5-20251001", "cohere.command-r-plus-v1:0", # bedrock "gpt-3.5-turbo", ], @@ -2696,7 +2696,7 @@ def test_completion_claude_3_function_call_with_streaming(): try: # test without max tokens response = completion( - model="claude-4-sonnet-20250514", + model="claude-haiku-4-5-20251001", messages=messages, tools=tools, tool_choice="required", From 1e63be7a72518a7a670ea5648b303da8b65d1106 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 1 May 2026 19:22:39 -0700 Subject: [PATCH 2/3] [Test] Anthropic Passthrough: Bump Streaming Cost-Injection Test To Haiku 4.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_anthropic_messages_streaming_cost_injection hits the proxy's /v1/messages route, which routes via the anthropic/* wildcard to api.anthropic.com. The 404 surfaced in the test was Anthropic's own not_found_error propagated back through the proxy (visible from the x-litellm-model-id hash on the response — the proxy did route). Same root cause as the prior commit: the legacy claude-4-sonnet-20250514 alias is no longer recognized by Anthropic's main API under the new key. Swap to claude-haiku-4-5-20251001 — same routing path, canonical model. --- tests/pass_through_tests/test_anthropic_passthrough.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pass_through_tests/test_anthropic_passthrough.py b/tests/pass_through_tests/test_anthropic_passthrough.py index c4ae00768c2..d42e06937dc 100644 --- a/tests/pass_through_tests/test_anthropic_passthrough.py +++ b/tests/pass_through_tests/test_anthropic_passthrough.py @@ -333,7 +333,7 @@ async def test_anthropic_messages_streaming_cost_injection(): } payload = { - "model": "claude-4-sonnet-20250514", + "model": "claude-haiku-4-5-20251001", "max_tokens": 10, "stream": True, "messages": [{"role": "user", "content": "Say 'Hi'"}], From abfaab5dc348b957c5ff0f5938e1effaf2abc8ca Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 1 May 2026 19:33:08 -0700 Subject: [PATCH 3/3] [Test] Anthropic Passthrough: Bump Thinking Tests Off Legacy Sonnet 4 Alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit base_anthropic_messages_test.test_anthropic_messages_with_thinking and test_anthropic_streaming_with_thinking still pinned to claude-4-sonnet-20250514 — the same legacy alias Anthropic no longer recognizes under freshly issued keys. The other four tests in this base class already use claude-sonnet-4-5-20250929; these two were missed. Bump to claude-haiku-4-5-20251001 (supports_reasoning=true, no upcoming deprecation). Subclasses including TestAnthropicPassthroughBasic inherit these methods. --- tests/pass_through_tests/base_anthropic_messages_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pass_through_tests/base_anthropic_messages_test.py b/tests/pass_through_tests/base_anthropic_messages_test.py index e86e58de33b..95f709e3880 100644 --- a/tests/pass_through_tests/base_anthropic_messages_test.py +++ b/tests/pass_through_tests/base_anthropic_messages_test.py @@ -54,7 +54,7 @@ class BaseAnthropicMessagesTest(ABC): print("making request to anthropic passthrough with thinking") client = self.get_client() response = client.messages.create( - model="claude-4-sonnet-20250514", + model="claude-haiku-4-5-20251001", max_tokens=20000, thinking={"type": "enabled", "budget_tokens": 16000}, messages=[ @@ -75,7 +75,7 @@ class BaseAnthropicMessagesTest(ABC): collected_response = [] client = self.get_client() with client.messages.stream( - model="claude-4-sonnet-20250514", + model="claude-haiku-4-5-20251001", max_tokens=20000, thinking={"type": "enabled", "budget_tokens": 16000}, messages=[