sgl-project/sglang · error · ValueError

Invalid expert_pack configuration:\n{details}

Error message

Invalid expert_pack configuration:\n{details}

What it means

The expert_pack hook (GGUF expert packing, e.g. deepseek-v4-flash) accumulates all configuration problems (missing source GGUF, bad paths, etc.) and raises a single ValueError listing every error found. The message enumerates each specific problem with a dash bullet.

Source

Thrown at python/sglang/srt/arg_groups/expert_pack_hook.py:186

    if model_kind == DEEPSEEK_V4_MODEL_TYPE:
        required = (
            "source_path",
            "source_sha256",
            "model_identity_sha256",
            "config_sha256",
        )
        for name in required:
            if not loader_config.get(name):
                errors.append(f"deepseek-v4-flash loader config requires {name}")
        source_path = parse_path("source_path", loader_config.get("source_path"))
        if source_path is not None and not source_path.is_file():
            errors.append(
                f"deepseek-v4-flash source GGUF does not exist: {source_path}"
            )

    if errors:
        details = "\n".join(f"- {error}" for error in errors)
        raise ValueError(f"Invalid expert_pack configuration:\n{details}")

    declare_resolution(
        server_args,
        "handle_expert_pack",
        disable_cuda_graph=True,
        disable_shared_experts_fusion=True,
    )
    if model_kind == DEEPSEEK_V4_MODEL_TYPE:
        envs.SGLANG_OPT_FP8_WO_A_GEMM.set(False)
    logger.info(
        "expert_pack selected: CUDA graph and shared-experts fusion are "
        "disabled for correctness."
    )

View on GitHub (pinned to 0132848349)

Solutions

  1. Read each bulleted '- ...' line in the error; fix every listed problem
  2. Verify source GGUF paths exist: ls <path> from the launch directory; use absolute paths
  3. Re-run; the error is raised before server start so nothing to clean up

Example fix

# before
--expert-pack-source relative/path/model.gguf
# after
--expert-pack-source /abs/path/to/model.gguf  # verified with ls
Defensive patterns

Strategy: validation

Validate before calling

import os
for p in expert_pack_source_paths:
    assert os.path.isfile(os.path.expanduser(p)), f"missing GGUF: {p}"

Try / catch

except ValueError as e:
    if 'expert_pack configuration' in str(e):
        for line in str(e).splitlines(): print(line)  # each '- ' bullet
    raise

Prevention

When it happens

Trigger: Enabling expert_pack configuration where the referenced source GGUF file(s) do not exist at the given paths, or other invalid expert_pack fields, validated in handle_expert_pack during arg resolution.

Common situations: Wrong/relative GGUF path in the server args, moving or renaming the GGUF file, running from a different working directory so a relative path no longer resolves.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/fc397b243f6d69b2. Report an issue: GitHub.