unslothai/unsloth · error · ValueError

Local model path '{repo_id}' does not exist.

Error message

Local model path '{repo_id}' does not exist.

What it means

Raised when repo_id looks like a filesystem path — starts with '/', '\\', '~', or '.', contains a backslash, or resolves absolute — but nothing exists at that path. Path-shaped repo_ids are never treated as hub ids ('org/name' can never look like that), so this is an explicit 'your local model path is wrong' error raised before any model eviction or download.

Source

Thrown at studio/backend/core/inference/video.py:1244

                try:
                    resolve_local_gguf_child(root, gguf_filename or "")
                except Exception as exc:  # noqa: BLE001 -- surface as client input error
                    raise ValueError(str(exc)) from exc
            elif root.is_file():
                # The loader hands a local FILE straight through (ignoring gguf_filename), so the file's own suffix must match the kind.
                suffix = root.suffix.lower()
                if kind == "gguf" and suffix != ".gguf":
                    raise ValueError(
                        f"Local checkpoint '{repo_id}' is not a .gguf file; a 'gguf' load "
                        f"needs a .gguf checkpoint."
                    )
                if kind == "single_file" and suffix != ".safetensors":
                    raise ValueError(
                        f"Local checkpoint '{repo_id}' is not a .safetensors file; a "
                        f"'single_file' load needs a .safetensors checkpoint."
                    )
            elif path_shaped:
                raise ValueError(f"Local model path '{repo_id}' does not exist.")
        # A local pipeline pick must be a diffusers directory (model_index.json), else it would only fail after eviction.
        if kind == "pipeline":
            root = Path(repo_id).expanduser()
            # Gate on .exists() (not .is_dir()) so a local FILE picked as a pipeline is rejected too.
            indexes = (
                ("model_index.json", "modular_model_index.json")
                if fam.modular_workflow
                else ("model_index.json",)
            )
            if root.exists() and not (
                root.is_dir() and any((root / name).is_file() for name in indexes)
            ):
                raise ValueError(
                    f"Local pipeline path is not a diffusers directory "
                    f"(no {' or '.join(indexes)}): {repo_id}"
                )
        # Reject a malformed transformer_quant cheaply, before the handoff (pipeline-kind only, matching the image backend).
        normalize_transformer_quant(transformer_quant)

View on GitHub (pinned to 203007d190)

Solutions

  1. Check the path exists from the backend's perspective (it runs as the backend user, with its own cwd and mounts): ls the exact string you send.
  2. Use a fully expanded absolute path rather than '~' or relative segments.
  3. Mount/copy the model into place, or switch to a hub repo id ('org/name') instead of a local path.

Example fix

# before
load(repo_id='~/models/wan25', model_kind='gguf', gguf_filename='x-Q4.gguf')

# after
load(repo_id='/home/user/models/wan25', model_kind='gguf', gguf_filename='x-Q4.gguf')
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
p = Path(repo_id).expanduser()
path_shaped = repo_id.startswith(('/', '\\', '~', '.')) or '\\' in repo_id or p.is_absolute()
if path_shaped and not p.exists():
    raise FileNotFoundError(f'local model path missing: {repo_id}')  # before the API call

Type guard

def local_path_valid(repo_id: str) -> bool:
    p = Path(repo_id).expanduser()
    path_shaped = repo_id.startswith(('/', '\\', '~', '.')) or '\\' in repo_id or p.is_absolute()
    return not path_shaped or p.exists()

Prevention

When it happens

Trigger: load(repo_id='~/models/wan25') or '/data/missing-model' or './models/x' with model_kind 'gguf'/'single_file', where the path does not exist (typo, not yet downloaded, wrong machine).

Common situations: Absolute paths from another machine; paths under a mount not attached yet (network drive, encrypted volume); '~' not expanded by the shell when passed via API JSON; relative paths assuming a different cwd.

Related errors


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