sgl-project/sglang · error · IntegrityError
No model files found in {model_path}
Error message
No model files found in {model_path} What it means
generate_checksums walks the given local directory via _discover_files looking for model files (weights, configs, tokenizer files). If nothing matches, it raises IntegrityError — the directory exists but contains no recognizable model files.
Source
Thrown at python/sglang/srt/utils/model_file_verifier.py:111
errors.append(
f"{filename}: mismatch (expected={exp.sha256[:16]}... size={exp.size}, actual={act.sha256[:16]}... size={act.size})"
)
if errors:
raise IntegrityError("Integrity check failed: " + "; ".join(errors))
# ======== Generate ========
def generate_checksums(
*, source: str, output_path: str, max_workers: int = 4
) -> Manifest:
if Path(source).is_dir():
model_path = Path(source).resolve()
files = _discover_files(model_path)
if not files:
raise IntegrityError(f"No model files found in {model_path}")
manifest = _compute_manifest_from_folder(
model_path=model_path, filenames=files, max_workers=max_workers
)
else:
manifest = Manifest(files=_load_file_infos_from_hf(repo_id=source))
Path(output_path).write_text(
json.dumps(manifest.to_dict(), indent=2, sort_keys=True)
)
print(
f"[ModelFileVerifier] Generated checksums for {len(manifest.files)} files -> {output_path}"
)
return manifest
def _discover_files(model_path: Path) -> List[str]:
return sorted(View on GitHub (pinned to 0132848349)
Solutions
- Verify the path points at the actual model snapshot (e.g., ~/.cache/huggingface/hub/models--org--name/snapshots/<rev>) and contains *.safetensors/config.json.
- Check _discover_files' file patterns/depth to see which filenames qualify and rename/relocate files accordingly.
- If generating from an HF repo id instead of a local path, pass the repo id as source (non-directory branch).
Example fix
# before
generate_checksums(source="~/.cache/huggingface/hub/models--meta-llama--Llama-3-8B", output_path="m.json")
# after
import glob
generate_checksums(source=glob.glob("~/.cache/huggingface/hub/models--meta-llama--Llama-3-8B/snapshots/*")[0], output_path="m.json") Defensive patterns
Strategy: validation
Validate before calling
p = Path(source)
if not p.is_dir() or not any(p.rglob("*.safetensors")) and not (p / "config.json").exists():
raise SystemExit(f"{source} does not look like a model dir") Prevention
- Check for config.json/safetensors before calling generate_checksums.
- Prefer passing the resolved HF snapshot directory.
When it happens
Trigger: Calling generate_checksums(source=<dir>) where the directory is empty, contains only non-model files, or the files are nested deeper than the discovery depth / excluded by pattern.
Common situations: Pointing --source at a wrong or empty directory (e.g., the cache root instead of the snapshot dir), a still-ongoing download directory, or a directory whose files don't match the discovery allowlist.
Related errors
- Integrity check failed: {joined errors}
- No files found in HF repo {repo_id}.
- Model directory {model_path} is missing required component d
- Model directory {model_path} does not contain a transformer/
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/750b4207e2f31469.
Report an issue: GitHub.