[Bugfix][Frontend] Preserve logprobs when top_logprobs is null (#47838)

Signed-off-by: Ting Sun <suntcrick@gmail.com>
Signed-off-by: Flora Feng <4florafeng@gmail.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
Ting SUN
2026-10-05 22:43:31 +00:00
committed by GitHub
co-authored by Flora Feng
parent 89a00995c9
commit 4a705c7b54
7 changed files with 46 additions and 12 deletions
@@ -33,6 +33,7 @@ from vllm.entrypoints.generate.base.protocol import (
StopParam,
StreamOptions,
ToolCall,
TopLogprobsParam,
structured_outputs_from_response_format,
validate_cache_salt,
validate_structural_tag_response_format,
@@ -222,7 +223,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
frequency_penalty: float | None = None
logit_bias: dict[str, float] | None = None
logprobs: bool | None = False
top_logprobs: int | None = 0
top_logprobs: TopLogprobsParam = 0
max_tokens: int | None = Field(
default=None,
deprecated="max_tokens is deprecated in favor of "
@@ -1095,7 +1096,7 @@ class BatchChatCompletionRequest(OpenAIBaseModel):
frequency_penalty: float | None = 0.0
logit_bias: dict[str, float] | None = None
logprobs: bool | None = False
top_logprobs: int | None = 0
top_logprobs: TopLogprobsParam = 0
logprob_token_ids: list[int] | None = Field(
default=None,
description=(