BerriAI/litellm · error · HTTPException
model is not allowed when require_managed_files is enabled i
Error message
model is not allowed when require_managed_files is enabled in litellm_settings. Uploads must go through managed files using target_model_names instead of the model parameter.
What it means
Error "model is not allowed when require_managed_files is enabled in litellm_settings. Uploads must go through managed files using target_model_names instead of the model parameter." thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/openai_files_endpoints/common_utils.py:914
from fastapi import HTTPException
import litellm
if litellm.require_managed_files is not True:
return
if not target_model_names:
raise HTTPException(
status_code=400,
detail=(
"target_model_names is required when require_managed_files is enabled "
"in litellm_settings. Provide one or more model aliases via the "
"target_model_names form field (e.g. target_model_names=my-model-alias)."
),
)
if model:
raise HTTPException(
status_code=400,
detail=(
"model is not allowed when require_managed_files is enabled in "
"litellm_settings. Uploads must go through managed files using "
"target_model_names instead of the model parameter."
),
)
async def validate_managed_id_requirement(
resource_id: str | None,
resource_kind: Literal["file", "batch", "fine-tuning job"],
user_api_key_dict: "UserAPIKeyAuth",
managed_files_obj: object | None,
) -> None:
"""
Enforce proxy-level managed resources on every route that accepts a provider-issued id
when ``litellm.require_managed_files`` is enabled, and authenticate managed ids againstView on GitHub (pinned to 77b7c6c40c)
Solutions
- Remove the model parameter and upload via managed files using target_model_names instead.
When it happens
Trigger: Thrown at litellm/proxy/openai_files_endpoints/common_utils.py:914 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/c431dc8e0c48cc92.
Report an issue: GitHub.