BerriAI/litellm · error · Exception
Filtering by 'provider' is not supported when using managed
Error message
Filtering by 'provider' is not supported when using managed batches.
What it means
Generic Exception from list_user_batches: passing a non-None provider filter is rejected because encoded object ids in the managed objects table do not encode provider information, so provider filtering cannot be implemented reliably for managed batches.
Source
Thrown at enterprise/litellm_enterprise/proxy/hooks/managed_files.py:423
raise HTTPException(
status_code=404,
detail=f"Object not found: {unified_object_id}",
)
async def list_user_batches(
self,
user_api_key_dict: UserAPIKeyAuth,
limit: Optional[int] = None,
after: Optional[str] = None,
provider: Optional[str] = None,
target_model_names: Optional[str] = None,
llm_router: Optional[Router] = None,
) -> Dict[str, object]:
# Provider filtering is not supported for managed batches
# This is because the encoded object ids stored in the managed objects table do not contain the provider information
# To support provider filtering, we would need to store the provider information in the encoded object ids
if provider:
raise Exception("Filtering by 'provider' is not supported when using managed batches.")
# Model name filtering is not supported for managed batches
# 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.")
owner_filter = build_owner_filter(user_api_key_dict)
if owner_filter is None:
return build_list_page([])
where_clause: Dict[str, object] = {"file_purpose": "batch", **owner_filter}
if after:
cursor_row = await _managed_object_table(self.prisma_client).find_first(
where={**where_clause, "unified_object_id": after}
)
if cursor_row is None:View on GitHub (pinned to 6c2dcb801b)
Solutions
- Remove the provider parameter from the list_user_batches call
- If provider separation is required, maintain separate proxies/deployments per provider, or track provider metadata in your own DB keyed by unified_object_id and filter client-side
- Watch for the sibling restriction: target_model_names is also unsupported (managed_files.py:429)
Example fix
# before
batches = await managed_files.list_user_batches(
user_api_key_dict, limit=20, provider='azure')
# after
batches = await managed_files.list_user_batches(user_api_key_dict, limit=20)
# filter provider client-side using your own metadata Defensive patterns
Strategy: validation
Validate before calling
def clean_batch_filters(provider=None, target_model_names=None, **kw):
if provider:
logger.warning('provider filter unsupported for managed batches; dropped')
kw.pop('provider', None)
return kw Type guard
def is_supported_batch_filter(provider: str | None) -> bool:
return provider is None Try / catch
try:
await managed_files.list_user_batches(uak, limit=20, provider=p)
except Exception as e:
if 'not supported when using managed batches' in str(e):
return await managed_files.list_user_batches(uak, limit=20)
raise Prevention
- Wrap batch listing in one helper that strips unsupported kwargs
- Keep a matrix of supported filters per managed vs unmanaged mode in your client SDK docs
When it happens
Trigger: Calling list_user_batches with provider='azure' (or any value) while managed batches/files are enabled. Any truthy provider triggers the raise before the query is built.
Common situations: Porting client code written for unmanaged (pass-through) batches, where provider filtering worked, to a managed-files deployment; UI filters carried over from a provider-aware file list to the batch list.
Related errors
- Filtering by 'target_model_names' is not supported when usin
- Invalid mode: {custom_auth_settings['mode']}
- Database not connected
- Setting tag based guardrail modes is only available in litel
- DB not connected. This endpoint needs a database; set DATABA
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/8f85c02f6fe6d83f.
Report an issue: GitHub.