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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix incorrect message length check in cost calculator
lidongminge1f53fcc8096
diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.pyindex 5545b842809..cd8af19f46f 100644--- a/litellm/cost_calculator.py+++ b/litellm/cost_calculator.py@@ -624,7 +624,7 @@ def completion_cost(if custom_llm_provider is not None and custom_llm_provider == "vertex_ai":# Calculate the prompt characters + response characters- if len("messages") > 0:+ if len(messages) > 0:prompt_string = litellm.utils.get_formatted_prompt(data={"messages": messages}, call_type="completion")