{"record":{"id":"8c42a35205898211","repo":"unslothai/unsloth","slug":"local-pipeline-directory-has-no-model-index-json","errorCode":null,"errorMessage":"Local pipeline directory has no model_index.json: {repo_id}","messagePattern":"Local pipeline directory has no model_index\\.json: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/diffusion.py","lineNumber":1700,"sourceCode":"                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                )\n        return fam\n\n    def preflight_base_access(\n        self,\n        repo_id: str,\n        fam: Optional[DiffusionFamily],\n        *,\n        gguf_filename: Optional[str] = None,","sourceCodeStart":1682,"sourceCodeEnd":1718,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion.py#L1682-L1718","documentation":"FileNotFoundError from the pipeline branch: repo_id is an existing local directory, but it has no model_index.json - the file that makes a directory a loadable diffusers pipeline. Without it, from_pretrained would fail deep in the load after chat eviction, so it is caught in the network-free validation instead (modular_model_index.json is accepted only in the modular-allowing variant of the check, not here).","triggerScenarios":"Passing a local directory as a pipeline load when the directory is a GGUF folder, a raw weights folder, an incomplete download, or a single-file checkpoint directory - anything without model_index.json at its root.","commonSituations":"User points at the folder that contains their .gguf files assuming any model dir works; download interrupted before model_index.json was fetched; pointing at a single-file .safetensors download directory rather than a full pipeline snapshot.","solutions":["Point at a complete diffusers snapshot - re-download the pipeline repo fully so model_index.json lands at the root.","If the directory holds GGUF/single-file checkpoints, load with model_kind='gguf'/'single_file' and the file name instead.","Check for a nested layout: sometimes the real pipeline dir is one level down (e.g. <root>/flux-dev/), pass that inner directory."],"exampleFix":"# before\nmanager.validate_load_request(repo_id=\"/data/flux-download\")\n# FileNotFoundError: Local pipeline directory has no model_index.json: /data/flux-download\n\n# after: either the inner complete snapshot, or a single-file load\nmanager.validate_load_request(repo_id=\"/data/flux-download/snapshots/abc123\")\n# or: model_kind=\"single_file\", gguf_filename=\"flux-dev.safetensors\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef is_pipeline_dir(repo_id: str) -> bool:\n    root = Path(repo_id).expanduser()\n    return root.is_dir() and (root / \"model_index.json\").is_file()","typeGuard":null,"tryCatchPattern":"try:\n    fam = manager.validate_load_request(repo_id=r)\nexcept FileNotFoundError as e:\n    if \"no model_index.json\" in str(e):\n        suggest_single_file_load_or_redownload(r)\n    else:\n        raise","preventionTips":["Download pipeline repos as complete snapshots (hf download / snapshot_download), never file-by-file.","For local model scanners, treat only model_index.json-bearing directories as pipeline loads; route the rest to gguf/single-file kinds.","Check for nested snapshot directories and pass the innermost complete one."],"tags":["local-path","pipeline","model-index","validation","diffusion"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}