From d6d18367e38865af5bf517a66c69fb8877e63ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ignacio=20Rojas?= Date: Mon, 2 Nov 2026 13:42:07 +0000 Subject: [PATCH] fix(complexity_router): replace retired claude-sonnet-4-20250514 default with claude-sonnet-5-5 Anthropic retired claude-sonnet-4-20250514 and names claude-sonnet-5-5 as its replacement. A complexity router that relies on the default tiers sends COMPLEX and REASONING requests to the retired model. The new test checks that every default tier names a model in LiteLLM's model cost map --- litellm/router_strategy/complexity_router/config.py | 4 ++-- tests/unit/router_strategy/test_complexity_router.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/litellm/router_strategy/complexity_router/config.py b/litellm/router_strategy/complexity_router/config.py index d5870bb6510..c818ab85cb9 100644 --- a/litellm/router_strategy/complexity_router/config.py +++ b/litellm/router_strategy/complexity_router/config.py @@ -487,8 +487,8 @@ DEFAULT_TOKEN_THRESHOLDS: Final[dict[str, int]] = { DEFAULT_TIER_MODELS: Final[dict[str, str]] = { "SIMPLE": "gpt-4o-mini", "MEDIUM": "gpt-4o", - "COMPLEX": "claude-sonnet-4-20250514", - "REASONING": "claude-sonnet-4-20250514", + "COMPLEX": "claude-sonnet-5-5", + "REASONING": "claude-sonnet-5-5", } diff --git a/tests/unit/router_strategy/test_complexity_router.py b/tests/unit/router_strategy/test_complexity_router.py index ef7b9e485d4..65dbb81f0af 100644 --- a/tests/unit/router_strategy/test_complexity_router.py +++ b/tests/unit/router_strategy/test_complexity_router.py @@ -285,6 +285,13 @@ class TestComplexityRouterInit: assert router.config.tiers == DEFAULT_COMPLEXITY_CONFIG.tiers assert router.config is not DEFAULT_COMPLEXITY_CONFIG # Not a singleton + @pytest.mark.usefixtures("local_model_cost_map") + def test_default_tiers_route_to_models_litellm_knows(self): + unknown: Final = { + tier: model for tier, model in DEFAULT_COMPLEXITY_CONFIG.tiers.items() if model not in litellm.model_cost + } + assert unknown == {} + def test_init_with_default_model(self, mock_router_instance, basic_config): """Test initialization with default_model override.""" router = ComplexityRouter(