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]

chore(lint): note why the streamed cost fallback swallows pricing errors

mateo-berri2471e85f544e
diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py
index d533df8616d..7975db5cb85 100644
--- a/litellm/proxy/common_request_processing.py
+++ b/litellm/proxy/common_request_processing.py
@@ -3562,7 +3562,7 @@ class ProxyBaseLLMRequestProcessing:
) -> float | None:
try:
cost: Final = litellm_logging_obj._response_cost_calculator(result=model_response) # pyright: ignore[reportPrivateUsage] # reuse the call's own cost calc for pricing parity with the logging callback
- except Exception:
+ except Exception: # noqa: BLE001 # a pricing failure falls back to model-name pricing instead of breaking the stream
return None
return float(cost) if isinstance(cost, (int, float)) and not isinstance(cost, bool) else None