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: add None check for litellm_params (#16754)
Alexsander Hamir6b7035e32f32
diff --git a/litellm/router_strategy/lowest_tpm_rpm.py b/litellm/router_strategy/lowest_tpm_rpm.pyindex e2bb0d77c4b..1bd065a3e42 100644--- a/litellm/router_strategy/lowest_tpm_rpm.py+++ b/litellm/router_strategy/lowest_tpm_rpm.py@@ -33,6 +33,8 @@ class LowestTPMLoggingHandler(CustomLogger):"""Update TPM/RPM usage on success"""+ if "litellm_params" not in kwargs or kwargs["litellm_params"] is None:+ returnif kwargs["litellm_params"].get("metadata") is None:passelse:@@ -92,11 +94,11 @@ class LowestTPMLoggingHandler(CustomLogger):"""Update TPM/RPM usage on success"""+ if "litellm_params" not in kwargs or kwargs["litellm_params"] is None:+ returnif kwargs["litellm_params"].get("metadata") is None:passelse:- if "litellm_params" not in kwargs:- returnmodel_group = kwargs["litellm_params"]["metadata"].get("model_group", None)