[Bugfix][Frontend] Honor stop_token_ids on the Responses API (#56592)

Signed-off-by: YeonwooSung <neos960518@gmail.com>
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
Yeonwoo Sung
2026-10-08 18:47:30 +00:00
committed by GitHub
co-authored by Flora Feng
parent c4a5ff5c18
commit 56e6da2c47
2 changed files with 4 additions and 0 deletions
@@ -47,6 +47,7 @@ class TestResponsesRequestSamplingParams:
repetition_penalty=1.2,
seed=42,
stop=["END", "STOP"],
stop_token_ids=[42, 43],
ignore_eos=True,
vllm_xargs={"custom": "value"},
)
@@ -56,6 +57,7 @@ class TestResponsesRequestSamplingParams:
assert sampling_params.repetition_penalty == 1.2
assert sampling_params.seed == 42
assert sampling_params.stop == ["END", "STOP"]
assert sampling_params.stop_token_ids == [42, 43]
assert sampling_params.ignore_eos is True
assert sampling_params.extra_args == {"custom": "value"}
@@ -363,6 +363,7 @@ class ResponsesRequest(OpenAIBaseModel):
repetition_penalty: float | None = None
seed: int | None = Field(None, ge=_INT64_MIN, le=_INT64_MAX)
stop: StopParam = []
stop_token_ids: list[int] | None = []
ignore_eos: bool = False
vllm_xargs: dict[str, str | int | float | list[str | int | float]] | None = Field(
default=None,
@@ -521,6 +522,7 @@ class ResponsesRequest(OpenAIBaseModel):
max_tokens=max_tokens,
logprobs=self.top_logprobs if self.is_include_output_logprobs() else None,
stop=stop,
stop_token_ids=self.stop_token_ids,
frequency_penalty=frequency_penalty,
presence_penalty=presence_penalty,
repetition_penalty=repetition_penalty,