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]

Merge pull request #37198 from BerriAI/litellm_lit5660_batches_limit_400

Mateo Wang77b7c6c40c0c
diff --cc enterprise/litellm_enterprise/proxy/hooks/managed_files.py
index 7a132c01399,aebfa9723af..c986e835e4f
--- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py
+++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py
@@@ -435,13 -429,11 +435,16 @@@ class _PROXY_LiteLLMManagedFiles(Custom
# This is because the encoded object ids stored in the managed objects table do not contain the model name
# A hash of the model name + litellm_params for the model name is encoded as the model id. This is not sufficient to reliably map the target model names to the model ids.
if target_model_names:
- raise Exception("Filtering by 'target_model_names' is not supported when using managed batches.")
+ raise ProxyException(
+ message="Filtering by 'target_model_names' is not supported when using managed batches.",
+ type="invalid_request_error",
+ param="target_model_names",
+ code=400,
+ )
+ if limit == 0:
+ return build_list_page([])
+
owner_filter = build_owner_filter(user_api_key_dict)
if owner_filter is None:
return build_list_page([])