{"record":{"id":"3f6685a8271af3e2","repo":"vllm-project/vllm","slug":"quantization-config-is-only-supported-when-quantiz","errorCode":null,"errorMessage":"quantization_config is only supported when quantization is one of {sorted(ONLINE_QUANT_SHORTHAND_NAMES)}, got quantization={quantization!r}","messagePattern":"quantization_config is only supported when quantization is one of (.+?), got quantization=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/quantization.py","lineNumber":172,"sourceCode":"    \"online\",\n)\n\n\ndef resolve_quantization_config(\n    quantization: str | None,\n    quantization_config: dict[str, Any] | QuantizationConfigArgs | None,\n) -> QuantizationConfigArgs | None:\n    \"\"\"Resolve `--quantization` shorthand and `--quantization-config` into a\n    QuantizationConfigArgs.\n\n    `quantization` is a CLI shorthand that desugars into a base config via\n    `_ONLINE_SHORTHANDS`. `quantization_config` is a dict or pre-built args\n    object. When both are given, fields explicitly set in `quantization_config`\n    take precedence over the shorthand.\n    \"\"\"\n    if quantization is not None and quantization not in ONLINE_QUANT_SHORTHAND_NAMES:\n        if quantization_config is not None:\n            raise ValueError(\n                f\"quantization_config is only supported when quantization is \"\n                f\"one of {sorted(ONLINE_QUANT_SHORTHAND_NAMES)}, \"\n                f\"got quantization={quantization!r}\"\n            )\n        return None\n\n    base = _ONLINE_SHORTHANDS.get(quantization) if quantization else None\n\n    if quantization_config is None:\n        return base\n\n    if isinstance(quantization_config, dict):\n        quantization_config = QuantizationConfigArgs(**quantization_config)\n\n    if base is None:\n        return quantization_config\n\n    return QuantizationConfigArgs(","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/quantization.py#L154-L190","documentation":"resolve() combines --quantization (a shorthand that must be one of ONLINE_QUANT_SHORTHAND_NAMES, the keys of _ONLINE_SHORTHANDS) with --quantization-config. If quantization is set to anything other than a known shorthand AND quantization_config is also supplied, the combination is rejected: a non-shorthand quantization value cannot be merged with an overrides dict.","triggerScenarios":"Running with --quantization fp8 --quantization-config '{\\\"k\\\": v}' where 'fp8' is not a key of _ONLINE_SHORTHANDS (the registered shorthand is e.g. fp8_per_tensor); or passing an arbitrary/checkpoint-derived quantization string together with a config dict programmatically.","commonSituations":"Using legacy quantization names ('fp8', 'awq') that predate the shorthand registry; passing quantization_config while leaving quantization set from a previous config file; version change that renamed shorthands.","solutions":["Use an exact ONLINE_QUANT_SHORTHAND_NAMES entry for --quantization (the message lists them)","Or drop --quantization-config and put the full desired spec inside quantization_config alone","Or drop --quantization and rely solely on quantization_config","If the value comes from a checkpoint's quant_method, route it through the checkpoint path, not the shorthand resolver"],"exampleFix":"# before\n--quantization fp8 --quantization-config '{\"linear\": ...}'\n\n# after\n--quantization fp8_per_tensor --quantization-config '{\"linear\": ...}'","handlingStrategy":"validation","validationCode":"from vllm.config.quantization import ONLINE_QUANT_SHORTHAND_NAMES\n\ndef combinable(quantization: str | None, qcfg: object) -> bool:\n    return quantization is None or quantization in ONLINE_QUANT_SHORTHAND_NAMES or qcfg is None","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Keep --quantization unset when using --quantization-config","Keep a canonical list of valid shorthands next to launch scripts","Fail fast in deploy scripts if both flags are populated"],"tags":["quantization","cli","config","validation"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}