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 greptile review

Sameer Kankute475220ecc652
diff --git a/litellm/proxy/container_endpoints/handler_factory.py b/litellm/proxy/container_endpoints/handler_factory.py
index 33df72ceaeb..794051e90f8 100644
--- a/litellm/proxy/container_endpoints/handler_factory.py
+++ b/litellm/proxy/container_endpoints/handler_factory.py
@@ -228,6 +228,12 @@ async def _process_binary_request(
elif ".pdf" in file_id_lower:
content_type = "application/pdf"
+ if not isinstance(content, bytes):
+ raise TypeError(
+ "aretrieve_container_file_content expected bytes, got "
+ f"{type(content).__name__}"
+ )
+
return Response(
content=content,
headers=dict(fastapi_response.headers),