{"record":{"id":"5723354faeae6835","repo":"sgl-project/sglang","slug":"resolved-gguf-path-is-not-a-gguf-file-resolved","errorCode":null,"errorMessage":"Resolved GGUF path is not a GGUF file: {resolved}","messagePattern":"Resolved GGUF path is not a GGUF file: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/transformer_load_utils.py","lineNumber":610,"sourceCode":"        return None\n    # A `~` can reach us unexpanded from a config file or a quoted argument.\n    override = os.path.expanduser(override)\n    if not names_gguf_checkpoint(override):\n        return None\n\n    # Before any download: a Hub reference would otherwise fetch gigabytes and\n    # only then hit an unsupported-configuration error.\n    _validate_gguf_runtime_support(server_args, component_name)\n\n    is_local_reference = os.path.isabs(override) or override.startswith(\".\")\n    resolved = (\n        override\n        if is_local_reference\n        else resolve_hf_gguf_reference(override, revision=server_args.revision)\n        or override\n    )\n    if not check_gguf_file(resolved):\n        raise ValueError(f\"Resolved GGUF path is not a GGUF file: {resolved}\")\n    logger.info(\"using GGUF transformer weights from: %s\", resolved)\n    return resolved\n\n\ndef resolve_transformer_safetensors_to_load(\n    server_args: ServerArgs, component_model_path: str\n) -> list[str]:\n    \"\"\"Resolve transformer weights from the base component path or an override.\"\"\"\n    quantized_path = server_args.transformer_weights_path\n\n    if quantized_path:\n        original_quantized_path = quantized_path\n        direct_url = _HF_SAFETENSORS_URL_RE.fullmatch(original_quantized_path)\n        if direct_url is not None:\n            quantized_path = hf_hub_download(\n                repo_id=direct_url.group(\"repo\"),\n                filename=direct_url.group(\"filename\"),\n                revision=direct_url.group(\"revision\"),","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/transformer_load_utils.py#L592-L628","documentation":"After resolving the --transformer-weights-path override (local path, ~-expanded path, or HF reference), the file's magic bytes are checked with check_gguf_file; if it is not a valid GGUF file the load is rejected.","triggerScenarios":"resolve_transformer_gguf_to_load resolves the override (locally or via resolve_hf_gguf_reference) but check_gguf_file(resolved) returns False — e.g. pointing at a safetensors/bin file, a corrupt/truncated download, or a wrong HF repo file.","commonSituations":"Passing a .safetensors or .bin file with a .gguf-looking flag, a partially downloaded file, or an HF repo id that resolves to a non-GGUF weight file.","solutions":["Verify the file is a real GGUF file (e.g. `file model.gguf` or check the GGUF magic bytes)","Re-download the checkpoint if it may be truncated/corrupt","Point --transformer-weights-path at the correct .gguf file or HF GGUF reference"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def is_gguf(path: str) -> bool:\n    try:\n        with open(path, 'rb') as f:\n            return f.read(4) == b'GGUF'\n    except OSError:\n        return False\n\nif not is_gguf(resolved_path):\n    raise SystemExit(f'{resolved_path} is not a valid GGUF file')","typeGuard":"def is_gguf(path: str) -> bool:\n    try:\n        with open(path, 'rb') as f:\n            return f.read(4) == b'GGUF'\n    except OSError:\n        return False","tryCatchPattern":"try:\n    gguf = resolve_transformer_gguf_to_load(server_args, override)\nexcept ValueError as e:\n    logger.error('GGUF resolution failed: %s', e); raise","preventionTips":["Validate the GGUF magic bytes before launching the server","Verify downloads completed (compare file size/etag with the HF repo)"],"tags":["gguf","file-validation","checkpoint"],"backgroundTag":"invalid-checkpoint-file","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}