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]

lint(cost): justify blind except in _lookup_model_info_or_none

mubashir1osmani4e4008cea932
diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py
index 6cb1ef8228e..352d95a4fdf 100644
--- a/litellm/cost_calculator.py
+++ b/litellm/cost_calculator.py
@@ -2170,7 +2170,7 @@ def ocr_batch_cost(
def _lookup_model_info_or_none(model: str, custom_llm_provider: str | None) -> ModelInfo | None:
try:
return litellm.get_model_info(model=model, custom_llm_provider=custom_llm_provider)
- except Exception:
+ except Exception: # noqa: BLE001 # get_model_info raises bare Exception for unmapped models; caller logs and bills 0.0
return None