fix(config): reject negative max_logprobs (except -1) and long_prefill_token_threshold (#44070)
Signed-off-by: Chenglun Hu <chenglunhu@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
hcl committed
Jun 30, 2026 at 12:02 UTC
af1ee8c475a2326d1d86f58b77e8e163579b44dc
2 files changed
+2
-2
vllm/config/model.py
+1
-1
@@ -213,7 +213,7 @@ class ModelConfig:
213
flexibility."""
214
enable_return_routed_experts: bool = False
215
"""Whether to return routed experts."""
216
- max_logprobs: int = 20
216
+ max_logprobs: int = Field(default=20, ge=-1)
217
"""Maximum number of log probabilities to return when `logprobs` is
218
specified in `SamplingParams`. The default value comes the default for the
219
OpenAI Chat Completions API. -1 means no cap, i.e. all (output_length *
vllm/config/scheduler.py
+1
-1
@@ -77,7 +77,7 @@ class SchedulerConfig:
77
this less than max_num_partial_prefills will allow shorter prompts to jump
78
the queue in front of longer prompts in some cases, improving latency."""
79
80
- long_prefill_token_threshold: int = 0
80
+ long_prefill_token_threshold: int = Field(default=0, ge=0)
81
"""For chunked prefill, a request is considered long if the prompt is
82
longer than this number of tokens."""
83