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(container): keep ownership-filter exceptions out of the LLM-error path

user4fa577810ba1
diff --git a/litellm/proxy/container_endpoints/endpoints.py b/litellm/proxy/container_endpoints/endpoints.py
index 7e097802632..9650604bf81 100644
--- a/litellm/proxy/container_endpoints/endpoints.py
+++ b/litellm/proxy/container_endpoints/endpoints.py
@@ -241,11 +241,6 @@ async def list_containers(
user_api_base=user_api_base,
version=version,
)
- return await filter_container_list_response(
- response=response,
- user_api_key_dict=user_api_key_dict,
- custom_llm_provider=custom_llm_provider,
- )
except Exception as e:
raise await processor._handle_llm_api_exception(
e=e,
@@ -254,6 +249,16 @@ async def list_containers(
version=version,
)
+ # Ownership filtering runs OUTSIDE the LLM-exception scope: a DB error
+ # in the ownership lookup is not an LLM-API error and shouldn't be
+ # translated to a provider-shaped failure (which would also fire the
+ # post_call_failure_hook for what is in fact a successful upstream call).
+ return await filter_container_list_response(
+ response=response,
+ user_api_key_dict=user_api_key_dict,
+ custom_llm_provider=custom_llm_provider,
+ )
+
@router.get(
"/v1/containers/{container_id}",