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(proxy): import the unknown-model error lazily so SDK-only installs keep working

mateo-berri561c0f7eb87e
diff --git a/litellm/proxy/openai_files_endpoints/common_utils.py b/litellm/proxy/openai_files_endpoints/common_utils.py
index 73d31745047..a8ab09b725a 100644
--- a/litellm/proxy/openai_files_endpoints/common_utils.py
+++ b/litellm/proxy/openai_files_endpoints/common_utils.py
@@ -18,7 +18,6 @@ from typing import (
from litellm.batches.batch_utils import batch_cost_is_final
from litellm.constants import MAX_FILE_LIST_LIMIT
from litellm.proxy._types import ProxyException
-from litellm.proxy.route_llm_request import ProxyModelNotFoundError
from litellm.repositories.table_repositories import (
ManagedFileRepository,
ManagedObjectRepository,
@@ -364,6 +363,8 @@ def get_credentials_for_model(
"""
from fastapi import HTTPException
+ from litellm.proxy.route_llm_request import ProxyModelNotFoundError
+
if llm_router is None:
raise HTTPException(
status_code=500,