@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 873910d608
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 3, 17:45 UTC

[Frontend] add support for thinking_token_budget in completions (#42116)

Walter Beller-Morales committed May 13, 2026 at 16:01 UTC 873910d608b4f6296eabd2f0c2cfc1d7d89b9aa8
1 file changed +9
vllm/entrypoints/openai/completion/protocol.py
+9
@@ -177,6 +177,14 @@ class CompletionRequest(OpenAIBaseModel):
177 "can detect such behavior and terminate early, saving time and tokens.",
178 )
179
180 + thinking_token_budget: int | None = Field(
181 + default=None,
182 + description=(
183 + "Maximum number of tokens allowed for thinking operations "
184 + "(reasoning models). -1 = unlimited."
185 + ),
186 + )
187 +
188 # --8<-- [end:completion-extra-params]
189
190 def build_tok_params(self, model_config: ModelConfig) -> TokenizeParams:
@@ -322,6 +330,7 @@ class CompletionRequest(OpenAIBaseModel):
330 extra_args=extra_args or None,
331 skip_clone=True, # Created fresh per request, safe to skip clone
332 repetition_detection=self.repetition_detection,
333 + thinking_token_budget=self.thinking_token_budget,
334 )
335
336 @model_validator(mode="before")