mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
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:
parent
60a4dccd85
commit
9dc23c7e3a
1 changed files with 2 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue