{"record":{"id":"3be5255608c258d0","repo":"sgl-project/sglang","slug":"failed-to-load-mistral-config-file-name-config","errorCode":null,"errorMessage":"Failed to load mistral '{config_file_name}' config for model {model}. Please check if the model is a mistral-format model and if the config file exists.","messagePattern":"Failed to load mistral '(.+?)' config for model (.+?)\\. Please check if the model is a mistral-format model and if the config file exists\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/hf_transformers/mistral_utils.py","lineNumber":312,"sourceCode":"    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,\n        model: str | Path,\n        revision: str | None = None,\n        **kwargs,\n    ) -> tuple[dict, PretrainedConfig]:\n        config_dict = self._download_mistral_config_file(model, revision)\n        if config_dict.get(\"max_position_embeddings\") is None:\n            logger.warning(\n                \"The params.json file is missing 'max_position_embeddings'\"\n                \" and could not get a value from the HF config.\"","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/hf_transformers/mistral_utils.py#L294-L330","documentation":"After reading params.json for a Mistral-format model, the parsed config came back None/empty, so the model is likely not Mistral-format or the params.json is malformed. Note the code path makes this reachable mainly when the JSON file parses to null.","triggerScenarios":"A params.json that literally contains 'null' or is emptied out, while --model-config-parser mistral is active.","commonSituations":"Corrupted or placeholder params.json in a partially downloaded model directory.","solutions":["Inspect params.json in the model dir and confirm it is a non-null JSON object","Re-download the model snapshot (hf download / huggingface-cli) to repair corrupted files","Use the HF-format variant of the model"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json; d = json.load(open(Path(model)/'params.json'))\nassert isinstance(d, dict) and d","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify params.json is a non-empty JSON object before launching","Re-download on partial snapshots"],"tags":["mistral","config","corrupt-file"],"backgroundTag":"invalid-model-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}