mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
refactor(register_model): copy base_model cost entry to match resolver contract
(cherry picked from commit 136a4b39fdb11fa93ad841765225d68e77ef1d56)
This commit is contained in:
parent
a3f5cd49cb
commit
199a0f82fe
1 changed files with 4 additions and 3 deletions
|
|
@ -2701,9 +2701,10 @@ def register_model(model_cost: Union[str, dict]):
|
|||
if builtin_entry is None:
|
||||
base_model = value.get("base_model")
|
||||
if isinstance(base_model, str) and base_model:
|
||||
builtin_entry = _resolve_builtin_model_cost_entry(
|
||||
key=base_model, provider=provider
|
||||
) or litellm.model_cost.get(base_model)
|
||||
builtin_entry = _resolve_builtin_model_cost_entry(key=base_model, provider=provider)
|
||||
if builtin_entry is None:
|
||||
base_model_cost = litellm.model_cost.get(base_model)
|
||||
builtin_entry = dict(base_model_cost) if base_model_cost is not None else None
|
||||
if builtin_entry is not None:
|
||||
for field in _CACHE_PRICING_FIELDS:
|
||||
if value.get(field) is None and builtin_entry.get(field) is not None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue