From e98fac66da64ebcc71389b3086ae81fc840f7001 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 29 Nov 2023 21:12:29 -0800 Subject: [PATCH] fix(utils.py): fix register model cost map --- litellm/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 7947fbbe2..b87e399f1 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -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: