fix(router): use consistent positive checks in azure base_model fallback gate

Review follow-up: token-limit fields used 'is not None' while the cost
field used '> 0' — a cost-map entry explicitly storing 0 limits could
suppress the error log without carrying usable resolution data. All
three checks now require a positive value.
This commit is contained in:
Mihidum Hettiyahandi 2026-07-15 09:32:05 +10:00 • committed by Devin AI
parent 60a4dccd85
commit 9dc23c7e3a

View file

@ -8535,8 +8535,8 @@ class Router:
_azure_fallback_key = _model if _model.startswith("azure/") else "azure/{}".format(_model)
_fallback_entry = litellm.model_cost.get(_azure_fallback_key) or {}
_fallback_resolves = (
_fallback_entry.get("max_input_tokens") is not None
or _fallback_entry.get("max_tokens") is not None
(_fallback_entry.get("max_input_tokens") or 0) > 0
or (_fallback_entry.get("max_tokens") or 0) > 0
or (_fallback_entry.get("input_cost_per_token") or 0) > 0
)
if _fallback_resolves: