diff --git a/vllm/entrypoints/openai/chat_completion/serving.py b/vllm/entrypoints/openai/chat_completion/serving.py index 8f6d76d7852..92ffc141548 100644 --- a/vllm/entrypoints/openai/chat_completion/serving.py +++ b/vllm/entrypoints/openai/chat_completion/serving.py @@ -57,7 +57,6 @@ from vllm.entrypoints.openai.engine.serving import ( ) from vllm.entrypoints.openai.models.serving import OpenAIServingModels from vllm.entrypoints.openai.parser.harmony_utils import ( - get_stop_tokens_for_assistant_actions, get_streamable_parser_for_assistant, parse_chat_output, ) @@ -158,13 +157,6 @@ class OpenAIServingChat(OpenAIServing): else getattr(mc, "override_generation_config", {}).get("max_new_tokens") ) self.use_harmony = self.model_config.hf_config.model_type == "gpt_oss" - if self.use_harmony: - if "stop_token_ids" not in self.default_sampling_params: - self.default_sampling_params["stop_token_ids"] = [] - self.default_sampling_params["stop_token_ids"].extend( - get_stop_tokens_for_assistant_actions() - ) - self.tool_call_id_type = get_tool_call_id_type(self.model_config) # NOTE(woosuk): While OpenAI's chat completion API supports browsing diff --git a/vllm/entrypoints/openai/parser/harmony_utils.py b/vllm/entrypoints/openai/parser/harmony_utils.py index 7dc3704cea9..e76fa38d3c3 100644 --- a/vllm/entrypoints/openai/parser/harmony_utils.py +++ b/vllm/entrypoints/openai/parser/harmony_utils.py @@ -365,10 +365,6 @@ def render_for_completion(messages: list[Message]) -> list[int]: return token_ids -def get_stop_tokens_for_assistant_actions() -> list[int]: - return get_encoding().stop_tokens_for_assistant_actions() - - def get_streamable_parser_for_assistant() -> StreamableParser: return StreamableParser(get_encoding(), role=Role.ASSISTANT) diff --git a/vllm/entrypoints/openai/responses/protocol.py b/vllm/entrypoints/openai/responses/protocol.py index 370ed9a825d..30a92066365 100644 --- a/vllm/entrypoints/openai/responses/protocol.py +++ b/vllm/entrypoints/openai/responses/protocol.py @@ -372,8 +372,6 @@ class ResponsesRequest(OpenAIBaseModel): if (frequency_penalty := self.frequency_penalty) is None: frequency_penalty = default_sampling_params.get("frequency_penalty", 0.0) - stop_token_ids = default_sampling_params.get("stop_token_ids") - # Structured output structured_outputs = self.structured_outputs @@ -409,7 +407,6 @@ class ResponsesRequest(OpenAIBaseModel): top_k=top_k, max_tokens=max_tokens, logprobs=self.top_logprobs if self.is_include_output_logprobs() else None, - stop_token_ids=stop_token_ids, stop=stop, frequency_penalty=frequency_penalty, presence_penalty=presence_penalty, diff --git a/vllm/entrypoints/openai/responses/serving.py b/vllm/entrypoints/openai/responses/serving.py index 90b1a074934..7da04b3994d 100644 --- a/vllm/entrypoints/openai/responses/serving.py +++ b/vllm/entrypoints/openai/responses/serving.py @@ -46,7 +46,6 @@ from vllm.entrypoints.openai.engine.serving import ( from vllm.entrypoints.openai.models.serving import OpenAIServingModels from vllm.entrypoints.openai.parser.harmony_utils import ( get_developer_message, - get_stop_tokens_for_assistant_actions, get_system_message, get_user_message, has_custom_tools, @@ -222,13 +221,6 @@ class OpenAIServingResponses(OpenAIServing): "For gpt-oss, we ignore --enable-auto-tool-choice " "and always enable tool use." ) - # OpenAI models have two EOS-like tokens: <|return|> and <|call|>. - # We need to add them to the stop token ids. - if "stop_token_ids" not in self.default_sampling_params: - self.default_sampling_params["stop_token_ids"] = [] - self.default_sampling_params["stop_token_ids"].extend( - get_stop_tokens_for_assistant_actions() - ) self.tool_call_id_type = get_tool_call_id_type(self.model_config)