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]

fix exception_type

Ishaan Jaff1ee6b7852f87
diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py
index 7a0cffab7b8..1350df639c0 100644
--- a/litellm/litellm_core_utils/exception_mapping_utils.py
+++ b/litellm/litellm_core_utils/exception_mapping_utils.py
@@ -121,12 +121,13 @@ def extract_and_raise_litellm_exception(
def exception_type( # type: ignore # noqa: PLR0915
- model,
+ model: Optional[str],
original_exception,
- custom_llm_provider,
- completion_kwargs={},
- extra_kwargs={},
+ custom_llm_provider: Optional[str] = None,
+ completion_kwargs: Optional[dict] = {},
+ extra_kwargs: Optional[dict] = {},
):
+ """Maps an LLM Provider Exception to OpenAI Exception Format"""
if any(
isinstance(original_exception, exc_type)