{"record":{"id":"44fc64a97e64b757","repo":"sgl-project/sglang","slug":"gguf-package-does-not-provide-the-deepseek-name-ma","errorCode":null,"errorMessage":"gguf package does not provide the DeepSeek name map","messagePattern":"gguf package does not provide the DeepSeek name map","errorType":"panic","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/model_loader/deepseek4_gguf.py","lineNumber":140,"sourceCode":"        priority = 3\n    return priority, len(alias), alias\n\n\ndef build_deepseek4_checkpoint_name_map(\n    gguf_module: Any,\n    tensor_names: Iterable[str],\n    num_layers: int,\n) -> dict[str, str]:\n    \"\"\"Map every source GGUF tensor to a DeepSeek checkpoint tensor name.\n\n    The function fails closed if a source tensor has no deterministic mapping\n    or if two source tensors would load the same checkpoint tensor.\n    \"\"\"\n\n    try:\n        arch = gguf_module.MODEL_ARCH.DEEPSEEK2\n    except AttributeError as exc:\n        raise RuntimeError(\n            \"gguf package does not provide the DeepSeek name map\"\n        ) from exc\n\n    name_map = gguf_module.get_tensor_name_map(arch, num_layers)\n    aliases_by_gguf_base: dict[str, list[str]] = defaultdict(list)\n    for alias, mapping in name_map.mapping.items():\n        aliases_by_gguf_base[mapping[1]].append(alias)\n\n    result: dict[str, str] = {}\n    reverse: dict[str, str] = {}\n    missing: list[str] = []\n    for tensor_name in tensor_names:\n        checkpoint_name = _v4_checkpoint_name(tensor_name)\n        if checkpoint_name is None:\n            base, suffix = _split_suffix(tensor_name)\n            candidates = aliases_by_gguf_base.get(base, ())\n            if candidates:\n                alias = min(candidates, key=_candidate_score)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_loader/deepseek4_gguf.py#L122-L158","documentation":"build_deepseek4_checkpoint_name_map tries gguf_module.MODEL_ARCH.DEEPSEEK2 to obtain the GGUF tensor name map for DeepSeek weights, and raises RuntimeError if that attribute doesn't exist. This means the installed gguf package version doesn't ship the DeepSeek architecture mapping that the DeepSeek-V4 GGUF loader requires.","triggerScenarios":"Calling deepseek4_nonexpert_weights_iterator (DeepSeek GGUF loading) with an installed gguf package that predates DeepSeek2 support, i.e. gguf.MODEL_ARCH has no DEEPSEEK2 member.","commonSituations":"Old gguf pip package (<0.10-ish), a different package shadowing the name gguf, or a downgraded environment after a dependency resolution conflict.","solutions":["Upgrade the gguf package: pip install -U gguf (verify gguf.MODEL_ARCH.DEEPSEEK2 exists)","Check for a local file/module named gguf.py shadowing the real package; remove or rename it","Recreate/repair the environment so the correct gguf distribution is imported (pip show gguf)"],"exampleFix":"# before\ngguf==0.9.0  # no DEEPSEEK2 arch\n# after\npip install -U \"gguf>=0.10\"\npython -c \"import gguf; gguf.MODEL_ARCH.DEEPSEEK2\"","handlingStrategy":"validation","validationCode":"import gguf\nif not hasattr(gguf.MODEL_ARCH, 'DEEPSEEK2'):\n    raise RuntimeError('installed gguf lacks DEEPSEEK2 support; run: pip install -U gguf')","typeGuard":null,"tryCatchPattern":"try:\n    it = deepseek4_nonexpert_weights_iterator(path, num_layers)\nexcept RuntimeError as e:\n    if 'does not provide the DeepSeek name map' in str(e):\n        subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U', 'gguf'])\n        raise  # restart process to reload module\n    raise","preventionTips":["Pin gguf>=0.10 in requirements","Add an import-time feature check for MODEL_ARCH.DEEPSEEK2","Avoid local modules named gguf.py"],"tags":["gguf","deepseek","version-mismatch","dependency"],"backgroundTag":"missing-dependency-feature","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}