From 6bae534968eb8439ec8d2b9fc82b76fa15888103 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 13 Jan 2024 12:54:03 -0800 Subject: [PATCH] (fix) check if custom_llm_provider is not None --- litellm/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index ddfc39ff70..af5309523f 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2798,7 +2798,10 @@ def cost_per_token( prompt_tokens_cost_usd_dollar = 0 completion_tokens_cost_usd_dollar = 0 model_cost_ref = litellm.model_cost - model_with_provider = custom_llm_provider + "/" + model + if custom_llm_provider is not None: + model_with_provider = custom_llm_provider + "/" + model + else: + model_with_provider = model # see this https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models print_verbose(f"Looking up model={model} in model_cost_map")