{"record":{"id":"2f177f8283f17721","repo":"BerriAI/litellm","slug":"invalid-request-no-litellm-managed-file-id-or-cus","errorCode":null,"errorMessage":"Invalid request, No litellm managed file id or custom_llm_provider provided.","messagePattern":"Invalid request, No litellm managed file id or custom_llm_provider provided\\.","errorType":"exception","errorClass":"ValueError","httpStatus":500,"severity":"error","filePath":"litellm/proxy/fine_tuning_endpoints/endpoints.py","lineNumber":178,"sourceCode":"                )\n\n            response = cast(LiteLLMFineTuningJob, await llm_router.acreate_fine_tuning_job(**data))\n            response.training_file = unified_file_id\n            response._hidden_params[\"unified_file_id\"] = unified_file_id\n        ## ELSE, Route based on custom_llm_provider\n        elif fine_tuning_request.custom_llm_provider:\n            # get configs for custom_llm_provider\n            llm_provider_config: Final = get_fine_tuning_provider_config(\n                custom_llm_provider=fine_tuning_request.custom_llm_provider,\n            )\n            # add llm_provider_config to data\n            if llm_provider_config is not None:\n                data.update(llm_provider_config)\n\n            response = await litellm.acreate_fine_tuning_job(**data)\n\n        if response is None:\n            raise ValueError(\"Invalid request, No litellm managed file id or custom_llm_provider provided.\")\n\n        ### CALL HOOKS ### - modify outgoing data\n        _response: Final = await proxy_logging_obj.post_call_success_hook(\n            data=data,\n            user_api_key_dict=user_api_key_dict,\n            response=response,\n        )\n        if _response is not None and isinstance(_response, LiteLLMFineTuningJob):\n            response = _response\n\n        ### ALERTING ###\n        asyncio.create_task(\n            proxy_logging_obj.update_request_status(litellm_call_id=data.get(\"litellm_call_id\", \"\"), status=\"success\")\n        )\n\n        ### RESPONSE HEADERS ###\n        hidden_params: Final = getattr(response, \"_hidden_params\", {}) or {}\n        model_id: Final = hidden_params.get(\"model_id\", None) or \"\"","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/fine_tuning_endpoints/endpoints.py#L160-L196","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/fine_tuning_endpoints/endpoints.py:178 when the library encounters an invalid state.","commonSituations":"The fine-tuning request omitted both the managed file id and the provider.","solutions":["Provide a litellm managed file id or a custom_llm_provider in the request."],"exampleFix":"Include custom_llm_provider=openai (or the managed file id prefix) in the fine-tuning request.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}