{"record":{"id":"d6e875e328f3c71e","repo":"vllm-project/vllm","slug":"suffix-decoding-min-token-prob-self-suffix-decodi","errorCode":null,"errorMessage":"suffix_decoding_min_token_prob={self.suffix_decoding_min_token_prob} must be in [0, 1]","messagePattern":"suffix_decoding_min_token_prob=(.+?) must be in \\[0, 1\\]","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/speculative.py","lineNumber":1177,"sourceCode":"            )\n        # Validate values\n        if self.suffix_decoding_max_tree_depth < 1:\n            raise ValueError(\n                f\"suffix_decoding_max_tree_depth=\"\n                f\"{self.suffix_decoding_max_tree_depth} must be >= 1\"\n            )\n        if self.suffix_decoding_max_cached_requests < 0:\n            raise ValueError(\n                f\"suffix_decoding_max_cached_requests=\"\n                f\"{self.suffix_decoding_max_cached_requests} must be >= 0\"\n            )\n        if self.suffix_decoding_max_spec_factor < 0:\n            raise ValueError(\n                f\"suffix_decoding_max_spec_factor=\"\n                f\"{self.suffix_decoding_max_spec_factor} must be >= 0\"\n            )\n        if not 0 <= self.suffix_decoding_min_token_prob <= 1:\n            raise ValueError(\n                f\"suffix_decoding_min_token_prob=\"\n                f\"{self.suffix_decoding_min_token_prob} must be in [0, 1]\"\n            )\n\n    @staticmethod\n    def _maybe_override_draft_max_model_len(\n        speculative_max_model_len: int | None,\n        draft_max_model_len: int,\n        target_max_model_len: int,\n    ) -> int:\n        \"\"\"Determine the max sequence len for the draft model. This is usually\n        the draft_max_model_len, but may be the target_max_model_len if it is\n        less than the draft_max_model_len, or may be speculative_max_model_len\n        if it is specified.\n\n        This is necessary so that sequences do not exceed the capacity of the\n        draft model or the target model.\n","sourceCodeStart":1159,"sourceCodeEnd":1195,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/speculative.py#L1159-L1195","documentation":"Raised by _validate_suffix_decoding when suffix_decoding_min_token_prob is outside [0, 1]. The value is a probability threshold used to prune low-confidence draft tokens from the suffix tree; anything below 0 or above 1 is not a valid probability.","triggerScenarios":"speculative_config={'method': 'suffix', 'suffix_decoding_min_token_prob': 1.5} or a negative value; passing a percentage (e.g. 50) instead of a fraction.","commonSituations":"Unit confusion (percent vs. probability); sweeping thresholds that overshoot the [0,1] interval; copy-paste from configs of systems that use log-probabilities.","solutions":["Set suffix_decoding_min_token_prob to a fraction in [0, 1] (e.g. 0.05 to prune unlikely tokens)","Divide percentage values by 100 before passing","Remove the key to use the default"],"exampleFix":"# before\nspeculative_config={\"method\": \"suffix\", \"suffix_decoding_min_token_prob\": 5}\n# after\nspeculative_config={\"method\": \"suffix\", \"suffix_decoding_min_token_prob\": 0.05}","handlingStrategy":"validation","validationCode":"p = spec_cfg.get(\"suffix_decoding_min_token_prob\", 0.0)\nassert 0.0 <= p <= 1.0, f\"min_token_prob={p} must be a probability in [0, 1]\"","typeGuard":"def is_probability(p: float) -> bool:\n    return 0.0 <= p <= 1.0","tryCatchPattern":null,"preventionTips":["Convert percentages to fractions (divide by 100) before passing probability-typed knobs","Name probability variables with a _prob suffix in your config layer to signal the domain"],"tags":["speculative-decoding","suffix-decoding","probability","range-validation"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}