{"record":{"id":"7affb77cfbfc1e38","repo":"sgl-project/sglang","slug":"config-list-contains-configs-from-2-methods-must","errorCode":null,"errorMessage":"Config list contains configs from 2 methods, must be only 1","messagePattern":"Config list contains configs from 2 methods, must be only 1","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/configs/model_config.py","lineNumber":1572,"sourceCode":"            \"w8a8_fp8\": [\"compressed-tensors\", \"compressed_tensors\"],\n            \"auto-round-int8\": [\"compressed-tensors\", \"compressed_tensors\"],\n        }\n        if self.quantization is not None:\n            self.quantization = self.quantization.lower()\n\n        # Parse quantization method from the HF and ModelSlim model config, if available.\n        # Only one function should return config, other should return None.\n        cfg_list = []\n        hf_config = self._parse_quant_hf_config()\n        modelslim_config = self._find_quant_modelslim_config()\n        quant_config = modelslim_config or hf_config\n        if quant_config is not None:\n            cfg_list.append(quant_config)\n\n        # Filter out None values\n        cfg_list = [item for item in cfg_list if item is not None]\n        if len(cfg_list) > 1:\n            raise ValueError(\n                \"Config list contains configs from 2 methods, must be only 1\"\n            )\n        quant_cfg = cfg_list[0] if cfg_list else None\n\n        if quant_cfg is not None:\n            quant_method = quant_cfg.get(\n                \"quant_method\", \"\" if not self.quantization else self.quantization\n            ).lower()\n\n            # ModelOpt FP4 and mixed checkpoints can quantize only the target\n            # model; an embedded MTP draft may stay unquantized, so an explicit\n            # nvfp4_online opt-in for the draft wins over checkpoint detection.\n            # The online loader rejects already-packed weights at load time.\n            preserve_online_draft_quantization = (\n                self.is_draft_model\n                and self.quantization == \"nvfp4_online\"\n                and quant_method in (\"modelopt_fp4\", \"modelopt_mixed\")\n            )","sourceCodeStart":1554,"sourceCodeEnd":1590,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/configs/model_config.py#L1554-L1590","documentation":"_verify_quantization collects quantization configs from several sources (HF quantization_config in config.json, checkpoint overrides, etc.) into cfg_list. If more than one non-None source yields a config, the quantization method is ambiguous and sglang raises this error instead of guessing.","triggerScenarios":"Loading a model whose HF config.json has a quantization_config while another source (e.g. a separate quant_config passed to ModelConfig or an override) also supplies one; ModelConfig.__init__ calls _verify_quantization and len(cfg_list) > 1.","commonSituations":"Merging quantized checkpoints, editing config.json of an already-quantized model, passing --quantization overrides that materialize as a second config, or using a draft-model setup with mismatched configs.","solutions":["Inspect the model directory's config.json(s) and remove the duplicate quantization_config entries so exactly one source defines quantization","If you intentionally requantize, keep only the checkpoint config and let sglang map it (or clear the stale one)","Re-export the model with a single quantization tool so only one quantization_config block exists"],"exampleFix":"// before: config.json contains two quantization_config blocks / plus an override\n{\n  \"quantization_config\": {\"quant_method\": \"fp8\"},\n  \"overrides\": {\"quantization_config\": {\"quant_method\": \"awq\"}}\n}\n// after: keep exactly one\n{\n  \"quantization_config\": {\"quant_method\": \"fp8\"}\n}","handlingStrategy":"validation","validationCode":"import json\ncfg = json.load(open(f\"{model_dir}/config.json\"))\nsources = [k for k in (\"quantization_config\",) if cfg.get(k)]\n# plus any hf_quant_config.json / override files you inject\nassert len(sources) <= 1, f\"multiple quantization configs: {sources}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit extra quantization_config blocks into a quantized model's config.json","After quantization tooling runs, audit the output dir for exactly one quant config source"],"tags":["quantization","config-conflict","model-config","sglang"],"backgroundTag":"conflicting-config-values","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}