{"record":{"id":"4aa9385b168957de","repo":"sgl-project/sglang","slug":"file-not-found-model-file-name","errorCode":null,"errorMessage":"File not found {model}, {file_name}","messagePattern":"File not found (.+?), (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/hf_transformers/mistral_utils.py","lineNumber":303,"sourceCode":"    for old_name, new_name in moe_config_map.items():\n        if old_name in moe_config:\n            value = moe_config.pop(old_name)\n            config[new_name] = value\n\n    config[\"topk_method\"] = None\n    config[\"scoring_func\"] = \"softmax\"\n    config[\"routing_method_type\"] = 1  # RoutingMethodType.Renormalize\n\n    return config\n\n\nclass MistralConfigParser:\n    def get_hf_file_to_dict(\n        self, file_name: str, model: str | Path, revision: str | None = \"main\"\n    ):\n        file_path = Path(model) / file_name\n        if not file_path.is_file():\n            raise FileNotFoundError(f\"File not found {model}, {file_name}\")\n\n        with open(file_path) as file:\n            return json.load(file)\n\n    def _download_mistral_config_file(self, model, revision) -> dict:\n        config_file_name = \"params.json\"\n        config_dict = self.get_hf_file_to_dict(config_file_name, model, revision)\n        if config_dict is None:\n            raise ValueError(\n                f\"Failed to load mistral '{config_file_name}' config for model \"\n                f\"{model}. Please check if the model is a mistral-format model \"\n                f\"and if the config file exists.\"\n            )\n        assert isinstance(config_dict, dict)\n        return config_dict\n\n    def parse(\n        self,","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/hf_transformers/mistral_utils.py#L285-L321","documentation":"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.","triggerScenarios":"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.","commonSituations":"Pointing at an HF-format repo (which has config.json, not params.json) with the mistral parser forced, or an incomplete local snapshot.","solutions":["Verify the directory actually contains params.json (ls the model path)","Point --model at a real Mistral-format model directory","Drop --model-config-parser mistral / let auto-detection choose 'hf'"],"exampleFix":"# before\n--model /data/hf-model --model-config-parser mistral\n# after\n--model /data/mistral-model   # contains params.json","handlingStrategy":"validation","validationCode":"from pathlib import Path\nif not Path(model, 'params.json').is_file(): don't use mistral parser","typeGuard":null,"tryCatchPattern":"try:\n    parser.parse(model)\nexcept FileNotFoundError as e:\n    retry with model_config_parser='hf'","preventionTips":["Only use --model-config-parser mistral for real Mistral-format dirs containing params.json"],"tags":["mistral","config","file-not-found"],"backgroundTag":"config-file-missing","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}