unslothai/unsloth · error · HTTPException

dataset_streaming is HF-only; remove local_datasets / S3 sou

Error message

dataset_streaming is HF-only; remove local_datasets / S3 source. Streaming is not supported with local file paths.

What it means

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.

Source

Thrown at studio/backend/routes/training.py:1366

                    status_code = 422,
                    detail = "dataset_streaming requires max_steps > 0 because streaming datasets have no known length.",
                )
            if request.train_on_completions:
                raise HTTPException(
                    status_code = 422,
                    detail = "dataset_streaming is not supported with train_on_completions yet.",
                )
            if request.eval_steps > 0:
                train_split = request.train_split or "train"
                if not request.eval_split or request.eval_split == train_split:
                    raise HTTPException(
                        status_code = 422,
                        detail = "dataset_streaming with evaluation requires a separate eval_split.",
                    )
            # Streaming is HF-only: reject when the request also carries a local dataset path or an
            # S3 config, since those sources cannot be streamed via HF's loader.
            if request.local_datasets:
                raise HTTPException(
                    status_code = 400,
                    detail = (
                        "dataset_streaming is HF-only; remove local_datasets / S3 source. "
                        "Streaming is not supported with local file paths."
                    ),
                )
            if request.s3_config is not None:
                raise HTTPException(
                    status_code = 400,
                    detail = (
                        "dataset_streaming is HF-only; remove local_datasets / S3 source. "
                        "Streaming is not supported with S3 datasets."
                    ),
                )
            if request.dataset_known_cached or request.dataset_local_path:
                raise HTTPException(
                    status_code = 422,
                    detail = (

View on GitHub (pinned to 203007d190)

Solutions

  1. Remove local_datasets from the request (and train from hf_dataset with streaming)
  2. Or disable dataset_streaming to train from the local files
  3. Also check for an s3_config - it is rejected for the same reason (see the S3 variant of this error)

Example fix

// before
{"dataset_streaming": true, "local_datasets": ["/data/train.jsonl"], "hf_dataset": "org/ds"}  // 400

// after
{"dataset_streaming": true, "hf_dataset": "org/ds"}
Defensive patterns

Strategy: validation

Validate before calling

def streaming_config_valid(p: dict) -> bool:
    if not p.get("dataset_streaming"):
        return True
    return not p.get("local_datasets")

Try / catch

resp = client.post("/training/start", payload)
if resp.status_code == 400 and "local_datasets" in resp.text:
    payload.pop("local_datasets", None)
    resp = client.post("/training/start", payload)

Prevention

When it happens

Trigger: POST /training/start with dataset_streaming: true and a non-empty local_datasets list.

Common situations: 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.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/089afc02f188e30b. Report an issue: GitHub.