{"record":{"id":"089afc02f188e30b","repo":"unslothai/unsloth","slug":"dataset-streaming-is-hf-only-remove-local-dataset","errorCode":null,"errorMessage":"dataset_streaming is HF-only; remove local_datasets / S3 source. Streaming is not supported with local file paths.","messagePattern":"dataset_streaming is HF-only; remove local_datasets / S3 source\\. Streaming is not supported with local file paths\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1366,"sourceCode":"                    status_code = 422,\n                    detail = \"dataset_streaming requires max_steps > 0 because streaming datasets have no known length.\",\n                )\n            if request.train_on_completions:\n                raise HTTPException(\n                    status_code = 422,\n                    detail = \"dataset_streaming is not supported with train_on_completions yet.\",\n                )\n            if request.eval_steps > 0:\n                train_split = request.train_split or \"train\"\n                if not request.eval_split or request.eval_split == train_split:\n                    raise HTTPException(\n                        status_code = 422,\n                        detail = \"dataset_streaming with evaluation requires a separate eval_split.\",\n                    )\n            # Streaming is HF-only: reject when the request also carries a local dataset path or an\n            # S3 config, since those sources cannot be streamed via HF's loader.\n            if request.local_datasets:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = (\n                        \"dataset_streaming is HF-only; remove local_datasets / S3 source. \"\n                        \"Streaming is not supported with local file paths.\"\n                    ),\n                )\n            if request.s3_config is not None:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = (\n                        \"dataset_streaming is HF-only; remove local_datasets / S3 source. \"\n                        \"Streaming is not supported with S3 datasets.\"\n                    ),\n                )\n            if request.dataset_known_cached or request.dataset_local_path:\n                raise HTTPException(\n                    status_code = 422,\n                    detail = (","sourceCodeStart":1348,"sourceCodeEnd":1384,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L1348-L1384","documentation":"HTTP 400 when dataset_streaming=true and local_datasets is non-empty: streaming goes through the Hugging Face Hub loader only, and local file paths cannot be streamed through it. The request must not mix a local dataset source with streaming.","triggerScenarios":"POST /training/start with dataset_streaming: true and a non-empty local_datasets list.","commonSituations":"Config preset that sets both fields; user adds a local eval file while streaming is on; migration from local to HF dataset that left the local path in place.","solutions":["Remove local_datasets from the request (and train from hf_dataset with streaming)","Or disable dataset_streaming to train from the local files","Also check for an s3_config - it is rejected for the same reason (see the S3 variant of this error)"],"exampleFix":"// before\n{\"dataset_streaming\": true, \"local_datasets\": [\"/data/train.jsonl\"], \"hf_dataset\": \"org/ds\"}  // 400\n\n// after\n{\"dataset_streaming\": true, \"hf_dataset\": \"org/ds\"}","handlingStrategy":"validation","validationCode":"def streaming_config_valid(p: dict) -> bool:\n    if not p.get(\"dataset_streaming\"):\n        return True\n    return not p.get(\"local_datasets\")","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/training/start\", payload)\nif resp.status_code == 400 and \"local_datasets\" in resp.text:\n    payload.pop(\"local_datasets\", None)\n    resp = client.post(\"/training/start\", payload)","preventionTips":["Streaming requests must carry hf_dataset only: no local_datasets, no s3_config","Clean payloads of leftover source fields when switching data sources","Validate mutually-exclusive fields client-side before posting"],"tags":["training","dataset-streaming","local-dataset","http-400","mutually-exclusive"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}