unslothai/unsloth · warning · HTTPException

dataset_streaming streams from the Hub and cannot use the lo

Error message

dataset_streaming streams from the Hub and cannot use the local dataset cache; disable streaming to train from the cached copy.

What it means

Raised (HTTP 422) by the training-start route when the request enables dataset_streaming while also signaling a local dataset source: dataset_known_cached=true or a dataset_local_path. Streaming in HF datasets pulls shards directly from the Hub, so a local cache/path source and streaming are mutually exclusive by design. The route rejects the combination before any training subprocess is spawned.

Source

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

            # 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 = (
                        "dataset_streaming streams from the Hub and cannot use the local "
                        "dataset cache; disable streaming to train from the cached copy."
                    ),
                )
        model_preflight = await asyncio.to_thread(
            _reject_untrainable_model_request,
            request,
            resume_actual_model_repo_id,
        )
        cached_model_pin = model_preflight.cached_model_pin
        training_actual_model_repo_id = resume_actual_model_repo_id
        training_model_snapshot_path = request.model_snapshot_path
        if cached_model_pin is not None:
            training_actual_model_repo_id, training_model_snapshot_path = cached_model_pin

        if request.hf_dataset:

View on GitHub (pinned to 203007d190)

Solutions

  1. Set dataset_streaming=false to train from the cached/local copy.
  2. Or clear dataset_known_cached and dataset_local_path (and local_datasets/s3_config) so the streaming run sources purely from the Hub.
  3. If you build request payloads programmatically, derive streaming from the source type instead of an independent toggle.

Example fix

// before
{
  "dataset_streaming": true,
  "dataset_known_cached": true,
  "dataset_local_path": "/data/cache/my-ds"
}
// after (train from the local copy)
{
  "dataset_streaming": false,
  "dataset_known_cached": true,
  "dataset_local_path": "/data/cache/my-ds"
}
// after (stream from the Hub)
{
  "dataset_streaming": true,
  "dataset_known_cached": false,
  "dataset_local_path": null
}
Defensive patterns

Strategy: validation

Validate before calling

function assertStreamingCompatible(req) {
  if (req.dataset_streaming) {
    const localSources = [
      req.dataset_known_cached,
      req.dataset_local_path,
      req.dataset_local_datasets,
      req.s3_config,
    ].some(Boolean);
    if (localSources) throw new Error(
      'dataset_streaming is Hub-only; clear local cache/path/S3 sources or disable streaming'
    );
  }
}

Try / catch

try { await post('/training/start', payload) } catch (e) { if (e.status === 422 && /dataset_streaming/.test(e.detail)) { payload.dataset_streaming = false; await post('/training/start', payload) } else throw e }

Prevention

When it happens

Trigger: POST to the training-start endpoint with dataset_streaming=true AND either dataset_known_cached=true or dataset_local_path set (and no local_datasets/S3 source, which would already fail the earlier 400 checks).

Common situations: A UI or client that remembers a previously cached dataset and then the user toggles 'stream from Hub'; scripts that set every field defensively; copying a request body from a cached-run template and only flipping the streaming flag.

Related errors


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