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
This commit is contained in:
José Ignacio Rojas 2026-11-02 13:42:07 +00:00
parent ff91b89b8d
commit d6d18367e3
2 changed files with 9 additions and 2 deletions

View file

@ -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",
}

View file

@ -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(