A high-throughput and memory-efficient inference and serving engine for LLMs
[Bugfix] Reject out-of-range temperature values in SamplingParams (#44965)
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
Peter Pan committed
Jun 15, 2026 at 14:12 UTC
ebb0a71ad0b2e2a09ed76b14338465f6b121ebfd
1 file changed
+6
vllm/sampling_params.py
+6
@@ -526,6 +526,12 @@ class SamplingParams(
526
parameter="temperature",
527
value=self.temperature,
528
)
529
+ if self.temperature > 2.0:
530
+ raise VLLMValidationError(
531
+ f"temperature must be in [0, 2], got {self.temperature}.",
532
+ parameter="temperature",
533
+ value=self.temperature,
534
+ )
535
if not 0.0 < self.top_p <= 1.0:
536
raise VLLMValidationError(
537
f"top_p must be in (0, 1], got {self.top_p}.",