Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test fix

Ishaan Jafferb21484d22934
diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py
index 870b97530fa..f18e8d62aa9 100644
--- a/litellm/cost_calculator.py
+++ b/litellm/cost_calculator.py
@@ -952,7 +952,8 @@ def completion_cost( # noqa: PLR0915
)
potential_model_names = [selected_model, _get_response_model(completion_response)]
-
+ if model is not None:
+ potential_model_names.append(model)
for idx, model in enumerate(potential_model_names):
try: