sgl-project/sglang · error · FileNotFoundError

File not found {model}, {file_name}

Error message

File not found {model}, {file_name}

What it means

MistralConfigParser.get_hf_file_to_dict expects a local directory containing the named file; Path(model)/file_name does not exist, so the Mistral params/config file cannot be read.

Source

Thrown at python/sglang/srt/utils/hf_transformers/mistral_utils.py:303

    for old_name, new_name in moe_config_map.items():
        if old_name in moe_config:
            value = moe_config.pop(old_name)
            config[new_name] = value

    config["topk_method"] = None
    config["scoring_func"] = "softmax"
    config["routing_method_type"] = 1  # RoutingMethodType.Renormalize

    return config


class MistralConfigParser:
    def get_hf_file_to_dict(
        self, file_name: str, model: str | Path, revision: str | None = "main"
    ):
        file_path = Path(model) / file_name
        if not file_path.is_file():
            raise FileNotFoundError(f"File not found {model}, {file_name}")

        with open(file_path) as file:
            return json.load(file)

    def _download_mistral_config_file(self, model, revision) -> dict:
        config_file_name = "params.json"
        config_dict = self.get_hf_file_to_dict(config_file_name, model, revision)
        if config_dict is None:
            raise ValueError(
                f"Failed to load mistral '{config_file_name}' config for model "
                f"{model}. Please check if the model is a mistral-format model "
                f"and if the config file exists."
            )
        assert isinstance(config_dict, dict)
        return config_dict

    def parse(
        self,

View on GitHub (pinned to 0132848349)

Solutions

  1. Verify the directory actually contains params.json (ls the model path)
  2. Point --model at a real Mistral-format model directory
  3. Drop --model-config-parser mistral / let auto-detection choose 'hf'

Example fix

# before
--model /data/hf-model --model-config-parser mistral
# after
--model /data/mistral-model   # contains params.json
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
if not Path(model, 'params.json').is_file(): don't use mistral parser

Try / catch

try:
    parser.parse(model)
except FileNotFoundError as e:
    retry with model_config_parser='hf'

Prevention

When it happens

Trigger: Using --model-config-parser mistral (or auto-resolution to mistral) with --model pointing at a directory lacking params.json, or a path that is a hub id never downloaded locally.

Common situations: Pointing at an HF-format repo (which has config.json, not params.json) with the mistral parser forced, or an incomplete local snapshot.

Related errors


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