sgl-project/sglang · error · ValueError
Failed to find config.json for {model_name_or_path} after fa
Error message
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' What it means
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.
Source
Thrown at python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py:849
# Add the pipeline name for downstream use
config["pipeline_name"] = config["_class_name"]
logger.debug(
"Resolved model_index.json for %s, pipeline: %s",
model_name_or_path,
config["_class_name"],
)
return config
except EntryNotFoundError:
logger.debug(
"model_index.json not found for %s. Assuming it is a single model and downloading it.",
model_name_or_path,
)
local_path = maybe_download_model(model_name_or_path)
config_path = os.path.join(local_path, "config.json")
if not os.path.exists(config_path):
raise ValueError(
f"Failed to find config.json for {model_name_or_path} after failing to find model_index.json"
f"You might be looking for models ending with '-Diffusers'"
)
with open(config_path) as f:
config = json.load(f)
return config
except Exception as e:
raise ValueError(
f"Failed to download or parse model_index.json for {model_name_or_path}: {e}"
) from e
def maybe_download_model(
model_name_or_path: str,
local_dir: str | None = None,
download: bool = True,
is_lora: bool = False,
allow_patterns: list[str] | None = None,View on GitHub (pinned to 0132848349)
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
Example fix
# before --model stabilityai/stable-diffusion-3.5-large # after --model stabilityai/stable-diffusion-3.5-large-diffusers
Defensive patterns
Strategy: fallback
Validate before calling
import os
assert os.path.exists(f'{p}/model_index.json') or os.path.exists(f'{p}/config.json'), 'neither pipeline nor single model' Try / catch
try:
info = get_model_info(name)
except ValueError:
info = get_model_info(name + '-Diffusers') Prevention
- Maintain a mapping of base repos to their -Diffusers variants
- Check repo layout on the HF web UI before configuring
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Z-Image transformer has no `rotary_emb`. It likely loaded vi
- Model path '{model_path}' is already registered for pipeline
- --diffusers-kwargs must be valid JSON. Got: {args.diffusers_
- Model config does not contain a _class_name attribute. Only
- Model config does not contain a _class_name attribute. Only
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/8b8b3c4929944fb7.
Report an issue: GitHub.