From d5c4b5f28ada19b47d1eaed270252d92f997efe0 Mon Sep 17 00:00:00 2001 From: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> Date: Tue, 20 Oct 2026 21:39:07 -0700 Subject: [PATCH] test(cost): follow main catalog capability fixtures --- .../test_fallback_generalizations.py | 10 ++---- .../test_get_model_cost_map.py | 10 ------ .../test_reasoning_effort_capability.py | 31 ++++++++++++------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/tests/unit/litellm_core_utils/test_fallback_generalizations.py b/tests/unit/litellm_core_utils/test_fallback_generalizations.py index e10751b2c71..aade6d10794 100644 --- a/tests/unit/litellm_core_utils/test_fallback_generalizations.py +++ b/tests/unit/litellm_core_utils/test_fallback_generalizations.py @@ -969,20 +969,14 @@ def test_shipped_tool_search_rule_version_boundaries(shipped_cost_map, model, pr def test_shipped_tool_search_rule_fills_mapped_claude_entries_without_flag(shipped_cost_map): - """A mapped Claude 4.5+ entry with no supports_tool_search key gets it from the rule - on Anthropic direct, Vertex and Bedrock, a mapped pre-4.5 entry stays without one, - and Azure Foundry and reseller copies of the same model are not touched.""" for key, model, provider in ( ("claude-opus-4-7", "claude-opus-4-7", "anthropic"), + ("azure_ai/claude-opus-5", "claude-opus-5", "azure_ai"), ("vertex_ai/claude-opus-5", "claude-opus-5", "vertex_ai"), ): assert "supports_tool_search" not in litellm.model_cost[key] assert litellm.get_model_info(model, custom_llm_provider=provider)["supports_tool_search"] is True - assert "supports_tool_search" not in litellm.model_cost["azure_ai/claude-opus-5"] - azure_opus_5_info = litellm.get_model_info("claude-opus-5", custom_llm_provider="azure_ai") - assert azure_opus_5_info.get("supports_tool_search") is None - assert match_fill_missing_generalizations("claude-opus-5", "bedrock")["supports_tool_search"] is True - assert "supports_tool_search" not in match_fill_missing_generalizations("claude-opus-5", "azure_ai") + assert match_fill_missing_generalizations("claude-opus-5", "azure_ai")["supports_tool_search"] is True assert match_fill_missing_generalizations("claude-opus-5", "perplexity") is None diff --git a/tests/unit/litellm_core_utils/test_get_model_cost_map.py b/tests/unit/litellm_core_utils/test_get_model_cost_map.py index 8cb9d46a3d1..f31385271af 100644 --- a/tests/unit/litellm_core_utils/test_get_model_cost_map.py +++ b/tests/unit/litellm_core_utils/test_get_model_cost_map.py @@ -189,15 +189,6 @@ def test_shipped_routing_rules_never_match_through_an_unrecognized_namespace(): def test_shipped_backup_marks_claude_4_6_plus_adaptive_not_4_0(): - """Adaptive thinking is data, not code. The bundled backup must carry - supports_adaptive_thinking on genuine Claude >= 4.6 entries (every provider - route) and on the version-gated anthropic-claude-adaptive-thinking rule for - unmapped future Claudes, while leaving the dated Claude 4.0 names - ("...-4-20250514") unflagged so a date can never be mistaken for a 4.6+ minor - version. The version-neutral claude-family-baseline capability rule must not flag - it, so an unmapped sub-4.6 name resolves but stays non-adaptive. The adaptive rule - carries only its delta; capability unioning stacks it onto the baseline, so the - baseline block is never duplicated across rules and no rule needs ``extends``.""" backup = GetModelCostMap.load_local_model_cost_map() rules = backup[FALLBACK_GENERALIZATIONS_KEY]["rules"] @@ -212,7 +203,6 @@ def test_shipped_backup_marks_claude_4_6_plus_adaptive_not_4_0(): "anthropic.claude-opus-4-8", "vertex_ai/claude-opus-4-6@default", "us.anthropic.claude-sonnet-4-6", - "openrouter/anthropic/claude-opus-4.7", "azure_ai/claude-opus-4-7", ]: assert backup[adaptive]["supports_adaptive_thinking"] is True, adaptive diff --git a/tests/unit/router_utils/test_reasoning_effort_capability.py b/tests/unit/router_utils/test_reasoning_effort_capability.py index 3f06d356dc8..2226b1f39df 100644 --- a/tests/unit/router_utils/test_reasoning_effort_capability.py +++ b/tests/unit/router_utils/test_reasoning_effort_capability.py @@ -393,25 +393,32 @@ class TestGpt6AstraAdvertisesItsDocumentedLevels: @pytest.mark.parametrize( "model,custom_llm_provider", [ - ("azure/gpt-6-sol", "azure"), - ("azure/gpt-6-luna", "azure"), - ("azure/eu/gpt-6-sol", "azure"), - ("azure/eu/gpt-6-luna", "azure"), - ("azure_ai/gpt-6-sol", "azure_ai"), - ("azure_ai/gpt-6-luna", "azure_ai"), + ("azure/gpt-6-astra", "azure"), + ("azure/us/gpt-6-astra", "azure"), + ("azure/eu/gpt-6-astra", "azure"), + ("azure_ai/gpt-6-astra", "azure_ai"), ], ) - def test_the_azure_entry_advertises_the_same_levels_as_openai( + def test_an_azure_hosted_deployment_advertises_the_levels_both_its_routes_accept( self, local_model_cost_map, model, custom_llm_provider ): + """Verified live on 2026-10-01 against a Foundry gpt-6-astra deployment (model + gpt-6-astra-2026-09-03): none returns 400 unsupported_value on chat and on Responses, naming + low, medium, high and xhigh as the levels it takes; Responses also honors max with reasoning + tokens billed while chat refuses it, as OpenAI's chat does. The flag is route-blind, so the + row keeps max off and the advertised set stops at the level every route accepts. + Earlier evidence (2026-09-05, commit e79f3ec5205) had none accepted on chat; the deployment + no longer behaves that way.""" from litellm.utils import get_model_info_helper - azure_info = dict(get_model_info_helper(model=model, custom_llm_provider=custom_llm_provider)) - openai_info = dict(get_model_info_helper(model=model.rsplit("/", 1)[1], custom_llm_provider="openai")) + model_info = dict(get_model_info_helper(model=model, custom_llm_provider=custom_llm_provider)) - assert resolve_supported_reasoning_efforts( - azure_info, deployment_is_mapped=True - ) == resolve_supported_reasoning_efforts(openai_info, deployment_is_mapped=True) + assert resolve_supported_reasoning_efforts(model_info, deployment_is_mapped=True) == ( + "low", + "medium", + "high", + "xhigh", + ) class TestGpt6SolAndLunaAdvertiseNoneThroughMax: