@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 49ab23b3cc
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 14, 05:30 UTC

[gpt-oss] use reasoning channel for reasoning text in serving_chat (#22920)

Signed-off-by: Yu Guo <yuguo@meta.com>

Yu Guo committed Aug 24, 2025 at 23:29 UTC 49ab23b3ccc2da9274c739d55f9b19206078c7a9
1 file changed +6 -6
vllm/entrypoints/openai/serving_chat.py
+6 -6
@@ -663,9 +663,9 @@ class OpenAIServingChat(OpenAIServing):
663 harmony_parser = harmony_parsers[i]
664 for token_id in output.token_ids:
665 harmony_parser.process(token_id)
666 - # FIXME(woosuk): Support function calling
667 - is_final = harmony_parser.current_channel == "final"
668 - if not (request.include_reasoning or is_final):
666 + is_reasoning = \
667 + harmony_parser.current_channel == "analysis"
668 + if not request.include_reasoning and is_reasoning:
669 # Skip the reasoning content.
670 continue
671 delta_text = harmony_parser.last_content_delta or ""
@@ -695,11 +695,11 @@ class OpenAIServingChat(OpenAIServing):
695 current_token_ids = as_list(output.token_ids)
696
697 if self.use_harmony:
698 - if is_final:
699 - delta_message = DeltaMessage(content=delta_text)
700 - else:
698 + if is_reasoning:
699 delta_message = DeltaMessage(
700 reasoning_content=delta_text)
701 + else:
702 + delta_message = DeltaMessage(content=delta_text)
703 # handle streaming deltas for tools with named tool_choice
704 elif tool_choice_function_name:
705 if (self.reasoning_parser and not reasoning_end_arr[i]