mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-25 05:54:53 +00:00
fix: read adaptive_router cost from model_info when not in litellm_params
This commit is contained in:
parent
204bc6539b
commit
e0995bb61a
1 changed files with 5 additions and 1 deletions
|
|
@ -7685,8 +7685,12 @@ class Router:
|
|||
|
||||
# `input_cost_per_token` is a LiteLLM_Params field per types/router.py.
|
||||
lp = d.get("litellm_params") if isinstance(d, dict) else d.litellm_params
|
||||
lp_dict: Dict[str, Any] = lp if isinstance(lp, dict) else (lp.model_dump() if lp else {})
|
||||
lp_dict: Dict[str, Any] = (
|
||||
lp if isinstance(lp, dict) else (lp.model_dump() if lp else {})
|
||||
)
|
||||
cost = lp_dict.get("input_cost_per_token")
|
||||
if cost is None:
|
||||
cost = mi_dict.get("input_cost_per_token")
|
||||
if cost is not None:
|
||||
model_to_cost[name] = float(cost)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue