{"record":{"id":"d074438db6fe7015","repo":"vllm-project/vllm","slug":"target-model-config-must-be-present-for-dspark","errorCode":null,"errorMessage":"target_model_config must be present for dspark","messagePattern":"target_model_config must be present for dspark","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/speculative.py","lineNumber":775,"sourceCode":"\n        if self.model is None and self.num_speculative_tokens is not None:\n            if self.method == \"mtp\":\n                if self.target_model_config is None:\n                    raise ValueError(\"target_model_config must be present for mtp\")\n                if self.target_model_config.hf_text_config.model_type == \"deepseek_v32\":\n                    # FIXME(luccafong): cudagraph with v32 MTP is not supported,\n                    # remove this when the issue is fixed.\n                    self.enforce_eager = True\n                # use the draft model from the same model:\n                self.model = self.target_model_config.model\n                # Align the quantization of draft model for cases such as\n                # --quantization fp8 with a bf16 checkpoint.\n                if not self.quantization:\n                    self.quantization = self.target_model_config.quantization\n            elif self.method == \"dspark\":\n                # DeepSeek DSpark can ship the weights inside the target checkpoint\n                if self.target_model_config is None:\n                    raise ValueError(\"target_model_config must be present for dspark\")\n                self.model = self.target_model_config.model\n                if not self.quantization:\n                    self.quantization = self.target_model_config.quantization\n            elif self.method in (\"ngram\", \"[ngram]\"):\n                self.model = \"ngram\"\n            elif self.method == \"ngram_gpu\":\n                self.model = \"ngram_gpu\"\n            elif self.method == \"suffix\":\n                self.model = \"suffix\"\n            elif self.method == \"extract_hidden_states\":\n                self.model = \"extract_hidden_states\"\n            elif self.method == \"custom_class\":\n                # method was set explicitly, but model should already contain the\n                # custom module path. If not, this is a configuration error.\n                if self.model is None:\n                    raise ValueError(\n                        \"method='custom_class' requires 'model' to contain the \"\n                        \"custom proposer module path (e.g., 'my_module.MyProposer').\"","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/speculative.py#L757-L793","documentation":"Same guard as the MTP one, but for method == 'dspark': DeepSeek DSpark draft weights may ship inside the target checkpoint, so when no separate model is given, vLLM must read the target ModelConfig to locate them. A missing target_model_config makes resolution impossible and fails immediately.","triggerScenarios":"SpeculativeConfig(method='dspark', num_speculative_tokens=N) built without target_model_config; invoking dspark speculation through a nonstandard code path that skips attaching the target config.","commonSituations":"Programmatic engine construction; wrapping/re-validating SpeculativeConfig in tooling; version changes in how the engine wires target_model_config.","solutions":["Go through standard engine entrypoints so target_model_config is attached","Pass target_model_config explicitly when constructing SpeculativeConfig yourself","Or point model= at the DSpark draft checkpoint if you have it separately"],"exampleFix":"# before\nSpeculativeConfig(method='dspark', num_speculative_tokens=2)\n\n# after\nSpeculativeConfig(method='dspark', num_speculative_tokens=2, target_model_config=target_cfg)","handlingStrategy":"validation","validationCode":"def dspark_config_ready(cfg: 'SpeculativeConfig') -> bool:\n    return not (cfg.method == 'dspark' and cfg.model is None and cfg.num_speculative_tokens is not None and cfg.target_model_config is None)","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Use standard engine entrypoints for dspark speculation","Pass target_model_config explicitly in manual construction"],"tags":["speculative-decoding","dspark","config","api-misuse"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}