diff --git a/litellm/llms/bedrock/common_utils.py b/litellm/llms/bedrock/common_utils.py index fff66f33610..a7eb15556cf 100644 --- a/litellm/llms/bedrock/common_utils.py +++ b/litellm/llms/bedrock/common_utils.py @@ -1334,14 +1334,16 @@ def bedrock_serves_service_tier(model: str, service_tier: str) -> bool: row for exactly the models that serve a tier, so a non-null price is the capability signal (the proxy normalizes every row to the full ModelInfo shape, so key presence alone means nothing). ``default`` and ``auto`` are always served, and a model absent from the price map has no signal and is - forwarded as before. + forwarded as before. Regional CRIS rows (``eu.``, ``apac.``, ``us-gov.``) often omit the tier + prices their base row carries, so the base row is consulted too. """ from litellm.litellm_core_utils.llm_cost_calc.utils import get_service_tier_cost_key cost_key: Final = get_service_tier_cost_key("input_cost_per_token", service_tier) if cost_key == "input_cost_per_token": return True - entries: Final = tuple(entry for entry in _bedrock_price_map_entries(model) if entry is not None) + candidates: Final = (*_bedrock_price_map_entries(model), _model_cost_entry(get_bedrock_base_model(model))) + entries: Final = tuple(entry for entry in candidates if entry is not None) if not entries: return True return any(entry.get(cost_key) is not None for entry in entries) diff --git a/tests/unit/llms/bedrock/test_bedrock_common_utils.py b/tests/unit/llms/bedrock/test_bedrock_common_utils.py index 496af9fb2d4..ae698923112 100644 --- a/tests/unit/llms/bedrock/test_bedrock_common_utils.py +++ b/tests/unit/llms/bedrock/test_bedrock_common_utils.py @@ -2286,6 +2286,7 @@ _STANDARD_ONLY_ROW: Final = { ("tiered.model-v1:0", "priority", True), ("tiered.model-v1:0", "flex", True), ("bedrock/us-west-2/tiered.model-v1:0", "flex", True), + ("eu.tiered.model-v1:0", "priority", True), ("standard.model-v1:0", "priority", False), ("standard.model-v1:0", "flex", False), ("standard.model-v1:0", "default", True), @@ -2298,8 +2299,10 @@ def test_bedrock_serves_service_tier_follows_price_map_tier_rows( ) -> None: """A Bedrock model serves a tier exactly when its price-map row carries a non-null price for that tier. The proxy expands every row to the full ModelInfo shape, so a null price (standard-only row) is no signal, - `default` and `auto` are always served, and an unknown model keeps being forwarded.""" + `default` and `auto` are always served, and an unknown model keeps being forwarded. A regional CRIS row + that omits the tier prices does not hide the base row that carries them.""" monkeypatch.setitem(litellm.model_cost, "tiered.model-v1:0", dict(_TIER_PRICED_ROW)) + monkeypatch.setitem(litellm.model_cost, "eu.tiered.model-v1:0", dict(_STANDARD_ONLY_ROW)) monkeypatch.setitem(litellm.model_cost, "standard.model-v1:0", dict(_STANDARD_ONLY_ROW)) assert bedrock_serves_service_tier(model, service_tier) is expected