fix(utils.py): fix register model cost map

This commit is contained in:
Krrish Dholakia 2023-11-29 21:12:29 -08:00
parent 03fb143a87
commit e98fac66da

View file

@ -1793,7 +1793,10 @@ def register_model(model_cost: Union[str, dict]):
for key, value in loaded_model_cost.items():
## override / add new keys to the existing model cost dictionary
litellm.model_cost[key] = loaded_model_cost[key]
if key in litellm.model_cost:
for k,v in loaded_model_cost[key].items():
litellm.model_cost[key][k] = v
# litellm.model_cost[key] = loaded_model_cost[key]
# add new model names to provider lists
if value.get('litellm_provider') == 'openai':
if key not in litellm.open_ai_chat_completion_models: