BerriAI/litellm · error · ValueError
Invalid request, No litellm managed file id or custom_llm_pr
Error message
Invalid request, No litellm managed file id or custom_llm_provider provided.
What it means
Raised in the create-fine-tuning-job handler when the request carries neither a LiteLLM-managed file id (unified_file_id) nor a custom_llm_provider: there is no routing basis for the job. Managed ids route through the router's file pipeline; an explicit provider routes through its config — with neither, the handler cannot decide where to submit the job.
Source
Thrown at litellm/proxy/fine_tuning_endpoints/endpoints.py:178
)
response = cast(LiteLLMFineTuningJob, await llm_router.acreate_fine_tuning_job(**data))
response.training_file = unified_file_id
response._hidden_params["unified_file_id"] = unified_file_id
## ELSE, Route based on custom_llm_provider
elif fine_tuning_request.custom_llm_provider:
# get configs for custom_llm_provider
llm_provider_config: Final = get_fine_tuning_provider_config(
custom_llm_provider=fine_tuning_request.custom_llm_provider,
)
# add llm_provider_config to data
if llm_provider_config is not None:
data.update(llm_provider_config)
response = await litellm.acreate_fine_tuning_job(**data)
if response is None:
raise ValueError("Invalid request, No litellm managed file id or custom_llm_provider provided.")
### CALL HOOKS ### - modify outgoing data
_response: Final = await proxy_logging_obj.post_call_success_hook(
data=data,
user_api_key_dict=user_api_key_dict,
response=response,
)
if _response is not None and isinstance(_response, LiteLLMFineTuningJob):
response = _response
### ALERTING ###
asyncio.create_task(
proxy_logging_obj.update_request_status(litellm_call_id=data.get("litellm_call_id", ""), status="success")
)
### RESPONSE HEADERS ###
hidden_params: Final = getattr(response, "_hidden_params", {}) or {}
model_id: Final = hidden_params.get("model_id", None) or ""View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide a litellm managed file id or a custom_llm_provider in the request.
Example fix
Include custom_llm_provider=openai (or the managed file id prefix) in the fine-tuning request.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/fine_tuning_endpoints/endpoints.py:178 when the library encounters an invalid state.
Common situations: The fine-tuning request omitted both the managed file id and the provider.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/2f177f8283f17721.
Report an issue: GitHub.