From a5e886de79f366c3ec2664b22aa3c4a0941ddbd4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 21 Feb 2026 10:46:49 -0800 Subject: [PATCH] fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var instead of hardcoding model (#21781) * fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var in bedrock KB tests * fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router * fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router_retries * fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router_timeout --- tests/local_testing/test_router.py | 6 +++--- tests/local_testing/test_router_retries.py | 2 +- tests/local_testing/test_router_timeout.py | 2 +- .../test_bedrock_knowledgebase_hook.py | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/local_testing/test_router.py b/tests/local_testing/test_router.py index 3167ff5208..18d2d0c8b4 100644 --- a/tests/local_testing/test_router.py +++ b/tests/local_testing/test_router.py @@ -105,7 +105,7 @@ async def test_router_provider_wildcard_routing(): print("router model list = ", router.get_model_list()) response1 = await router.acompletion( - model="anthropic/claude-sonnet-4-5-20250929", + model=f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", messages=[{"role": "user", "content": "hello"}], ) @@ -126,7 +126,7 @@ async def test_router_provider_wildcard_routing(): print("response 3 = ", response3) response4 = await router.acompletion( - model="claude-sonnet-4-5-20250929", + model=os.environ.get("CI_CD_DEFAULT_ANTHROPIC_MODEL", "claude-haiku-4-5-20251001"), messages=[{"role": "user", "content": "hello"}], ) @@ -1650,7 +1650,7 @@ def test_router_anthropic_key_dynamic(): { "model_name": "anthropic-claude", "litellm_params": { - "model": "claude-3-5-haiku-20241022", + "model": os.environ.get("CI_CD_DEFAULT_ANTHROPIC_MODEL", "claude-haiku-4-5-20251001"), "api_key": anthropic_api_key, }, } diff --git a/tests/local_testing/test_router_retries.py b/tests/local_testing/test_router_retries.py index 1d72d5914c..cb9b26b0a4 100644 --- a/tests/local_testing/test_router_retries.py +++ b/tests/local_testing/test_router_retries.py @@ -859,7 +859,7 @@ async def test_router_timeout_model_specific_and_global(): { "model_name": "anthropic-claude", "litellm_params": { - "model": "anthropic/claude-sonnet-4-5-20250929", + "model": f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", "timeout": 1, }, } diff --git a/tests/local_testing/test_router_timeout.py b/tests/local_testing/test_router_timeout.py index 100c01fcdb..4f94dc813a 100644 --- a/tests/local_testing/test_router_timeout.py +++ b/tests/local_testing/test_router_timeout.py @@ -160,7 +160,7 @@ def test_router_timeout_with_retries_anthropic_model(num_retries, expected_call_ { "model_name": "claude-3-haiku", "litellm_params": { - "model": "anthropic/claude-3-haiku-20240307", + "model": f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", }, } ], diff --git a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py index f87351edb0..39b18577a2 100644 --- a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py +++ b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py @@ -181,7 +181,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_streaming(s # litellm._turn_on_debug() async_client = AsyncHTTPHandler() response = await litellm.acompletion( - model="anthropic/claude-3-5-haiku-latest", + model=f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", messages=[{"role": "user", "content": "what is litellm?"}], vector_store_ids = [ "T37J8R4WTM" @@ -232,7 +232,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_with_tools( # Init client litellm._turn_on_debug() response = await litellm.acompletion( - model="anthropic/claude-3-5-haiku-latest", + model=f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", messages=[{"role": "user", "content": "what is litellm?"}], max_tokens=10, tools=[ @@ -255,7 +255,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_with_tools_ litellm._turn_on_debug() response = await litellm.acompletion( - model="anthropic/claude-3-5-haiku-latest", + model=f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", messages=[{"role": "user", "content": "what is litellm?"}], max_tokens=10, tools=[ @@ -350,7 +350,7 @@ async def test_bedrock_kb_request_body_has_transformed_filters(setup_vector_stor new=AsyncMock(side_effect=fake_async_vector_store_search_handler), ): response = await litellm.acompletion( - model="anthropic/claude-3-5-haiku-latest", + model=f"anthropic/{os.environ.get('CI_CD_DEFAULT_ANTHROPIC_MODEL', 'claude-haiku-4-5-20251001')}", messages=[{"role": "user", "content": "what is litellm?"}], max_tokens=10, tools=[