{"record":{"id":"ce13ea06591a9f4f","repo":"unslothai/unsloth","slug":"local-model-path-does-not-exist-repo-id","errorCode":null,"errorMessage":"Local model path does not exist: {repo_id}","messagePattern":"Local model path does not exist: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/diffusion.py","lineNumber":1692,"sourceCode":"        if kind in (\"gguf\", \"single_file\"):\n            if not gguf_filename:\n                raise ValueError(f\"a single-file checkpoint name is required for a '{kind}' load.\")\n            # Fail a kind/extension mismatch before the handoff: gguf needs .gguf, single_file must not.\n            is_gguf_name = gguf_filename.lower().endswith(\".gguf\")\n            if kind == \"gguf\" and not is_gguf_name:\n                raise ValueError(\"a 'gguf' load requires a .gguf checkpoint name.\")\n            if kind == \"single_file\" and is_gguf_name:\n                raise ValueError(\"a .gguf checkpoint needs model_kind 'gguf', not 'single_file'.\")\n            # A single-file load must name a real .safetensors, else it evicts chat then fails in background.\n            if kind == \"single_file\" and not gguf_filename.lower().endswith(\".safetensors\"):\n                raise ValueError(\n                    f\"'{gguf_filename}' is not a loadable single-file checkpoint \"\n                    f\"(expected a .safetensors name; use a .gguf name for a GGUF load).\"\n                )\n            if local_root.exists():\n                resolve_local_gguf_child(local_root, gguf_filename)\n            elif path_shaped:\n                raise FileNotFoundError(f\"Local model path does not exist: {repo_id}\")\n        else:  # pipeline\n            if gguf_filename:\n                raise ValueError(\n                    \"a 'pipeline' load takes a full diffusers repo, not a single-file name.\"\n                )\n            if local_root.exists():\n                if not (local_root / \"model_index.json\").exists():\n                    raise FileNotFoundError(\n                        f\"Local pipeline directory has no model_index.json: {repo_id}\"\n                    )\n            elif path_shaped:\n                raise FileNotFoundError(f\"Local model path does not exist: {repo_id}\")\n            elif repo_id.upper().endswith(\"-GGUF\"):\n                # A remote \"*-GGUF\" id is not a pipeline; reject here instead of evicting chat then failing.\n                raise ValueError(\n                    f\"'{repo_id}' is a single-file GGUF repo; load it with model_kind 'gguf' \"\n                    f\"and a .gguf filename, not as a full pipeline.\"\n                )","sourceCodeStart":1674,"sourceCodeEnd":1710,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion.py#L1674-L1710","documentation":"FileNotFoundError from the local-path branch of the gguf/single_file validation: the repo_id is path-shaped (starts with /, ~, ., contains a backslash, or is absolute), it does not exist on disk, and the kind is gguf or single_file. Failing here prevents the route from evicting the resident chat model for a load that cannot find its files.","triggerScenarios":"Passing a path-shaped repo_id like '~/models/flux-gguf', 'D:\\models\\flux', or './checkpoints/x' that does not exist, with model_kind gguf/single_file (with a valid checkpoint name).","commonSituations":"Model directory moved, renamed, or on an unmounted drive; tilde not expanded because the path came from a config file with a literal '~'; Windows path pasted on Linux or vice versa; typo in the directory name.","solutions":["Verify the path exists: run `ls <path>` (or dir) and fix typos, mount the drive, or update the location.","Use an absolute path or ensure the shell/launcher expands '~' before it reaches the API.","If the model is remote after all, use the 'org/name' HF id form instead of a path."],"exampleFix":"# before: directory renamed\nmanager.validate_load_request(repo_id=\"~/models/flux-gguf-old\",\n    model_kind=\"gguf\", gguf_filename=\"t-Q4.gguf\")\n# FileNotFoundError: Local model path does not exist: ~/models/flux-gguf-old\n\n# after\nmanager.validate_load_request(repo_id=str(Path.home() / \"models\" / \"flux-gguf\"),\n    model_kind=\"gguf\", gguf_filename=\"t-Q4.gguf\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef local_path_exists(repo_id: str) -> bool:\n    try:\n        return Path(repo_id).expanduser().exists()\n    except OSError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    fam = manager.validate_load_request(repo_id=r, model_kind=k, gguf_filename=f)\nexcept FileNotFoundError as e:\n    if \"Local model path does not exist\" in str(e):\n        prompt_to_reselect_local_directory(r)\n    else:\n        raise","preventionTips":["Expand '~' and make paths absolute in the client before sending them.","Verify external drives/mounts are present before offering previously-used local model paths.","Run validate_load_request on every local pick - it is the guard that fires before the chat model is evicted."],"tags":["local-path","file-not-found","validation","gguf","diffusion"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}