{"record":{"id":"8b8b3c4929944fb7","repo":"sgl-project/sglang","slug":"failed-to-find-config-json-for-model-name-or-path","errorCode":null,"errorMessage":"Failed to find config.json for {model_name_or_path} after failing to find model_index.jsonYou might be looking for models ending with '-Diffusers'","messagePattern":"Failed to find config\\.json for (.+?) after failing to find model_index\\.jsonYou might be looking for models ending with '-Diffusers'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py","lineNumber":849,"sourceCode":"\n        # Add the pipeline name for downstream use\n        config[\"pipeline_name\"] = config[\"_class_name\"]\n\n        logger.debug(\n            \"Resolved model_index.json for %s, pipeline: %s\",\n            model_name_or_path,\n            config[\"_class_name\"],\n        )\n        return config\n    except EntryNotFoundError:\n        logger.debug(\n            \"model_index.json not found for %s. Assuming it is a single model and downloading it.\",\n            model_name_or_path,\n        )\n        local_path = maybe_download_model(model_name_or_path)\n        config_path = os.path.join(local_path, \"config.json\")\n        if not os.path.exists(config_path):\n            raise ValueError(\n                f\"Failed to find config.json for {model_name_or_path} after failing to find model_index.json\"\n                f\"You might be looking for models ending with '-Diffusers'\"\n            )\n        with open(config_path) as f:\n            config = json.load(f)\n        return config\n    except Exception as e:\n        raise ValueError(\n            f\"Failed to download or parse model_index.json for {model_name_or_path}: {e}\"\n        ) from e\n\n\ndef maybe_download_model(\n    model_name_or_path: str,\n    local_dir: str | None = None,\n    download: bool = True,\n    is_lora: bool = False,\n    allow_patterns: list[str] | None = None,","sourceCodeStart":831,"sourceCodeEnd":867,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py#L831-L867","documentation":"When a repo has no model_index.json, maybe_download_model_index falls back to treating it as a single model and looks for config.json in the downloaded snapshot. If that's also missing, it raises ValueError with a hint that the user may want the '-Diffusers' variant of the model.","triggerScenarios":"Calling get_model_info / _get_config_info on a repo that is neither a diffusers pipeline (no model_index.json) nor a single HF model (no config.json) — e.g. the original non-diffusers checkpoint repo.","commonSituations":"Passing the base checkpoint repo (e.g. 'black-forest-labs/FLUX.1-dev' vs '...-Diffusers'); empty or private-without-auth repos; typo'd repo IDs.","solutions":["Switch to the '-Diffusers' suffixed repo for that model","Verify the repo ID spelling and that the repo is public / you are authenticated (huggingface-cli login)","For private/gated models, set HF_TOKEN"],"exampleFix":"# before\n--model stabilityai/stable-diffusion-3.5-large\n# after\n--model stabilityai/stable-diffusion-3.5-large-diffusers","handlingStrategy":"fallback","validationCode":"import os\nassert os.path.exists(f'{p}/model_index.json') or os.path.exists(f'{p}/config.json'), 'neither pipeline nor single model'","typeGuard":null,"tryCatchPattern":"try:\n    info = get_model_info(name)\nexcept ValueError:\n    info = get_model_info(name + '-Diffusers')","preventionTips":["Maintain a mapping of base repos to their -Diffusers variants","Check repo layout on the HF web UI before configuring"],"tags":["model-repo","diffusers","config-not-found"],"backgroundTag":"model-config-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}