@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 104605cbf2
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 6, 10:45 UTC

Remove deprecated reasoning_content message field(part-2) (#37480)

Signed-off-by: JartX <sagformas@epdcenter.es> Signed-off-by: Ifta Khairul Alam Adil <ikaadil007@gmail.com> Signed-off-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Philip Ottesen <phiott256@gmail.com> Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Signed-off-by: Michael Goin <mgoin64@gmail.com> Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai> Signed-off-by: Andy Lo <andy@mistral.ai> Signed-off-by: Thillai Chithambaram <thillaichithambaram.a@gmail.com> Signed-off-by: sihao.li <sihao.li@intel.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: JartX <sagformas@epdcenter.es> Co-authored-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Philip Ottesen <phiott256@gmail.com> Co-authored-by: Woosuk Kwon <woosuk.kwon@berkeley.edu> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Giancarlo Delfin <32987265+TheEpicDolphin@users.noreply.github.com> Co-authored-by: Andy Lo <andy@mistral.ai> Co-authored-by: Thillai Chithambaram <79466435+thillai-c@users.noreply.github.com> Co-authored-by: sihao_li <165983188+1643661061leo@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Ifta khairul Alam Adil committed Mar 19, 2026 at 16:20 UTC 104605cbf2046d09436a41a2367a975f73116138
8 files changed +36 -38
docs/features/reasoning_outputs.md
+1 -1
@@ -5,7 +5,7 @@ vLLM offers support for reasoning models like [DeepSeek R1](https://huggingface.
5 Reasoning models return an additional `reasoning` field in their outputs, which contains the reasoning steps that led to the final conclusion. This field is not present in the outputs of other models.
6
7 !!! warning
8 - `reasoning` used to be called `reasoning_content`. For now, `reasoning_content` will continue to work. However, we encourage you to migrate to `reasoning` in case `reasoning_content` is removed in future.
8 + `reasoning` used to be called `reasoning_content`. To migrate, directly replace `reasoning_content` with `reasoning`.
9
10 ## Supported Models
11
tests/entrypoints/openai/chat_completion/test_serving_chat.py
+3 -3
@@ -484,7 +484,7 @@ class TestGPTOSSSpeculativeChat:
484 )
485
486 content = ""
487 - reasoning_content = ""
487 + reasoning = ""
488 async for chunk in stream:
489 delta = chunk.choices[0].delta
490 if delta.content:
@@ -492,9 +492,9 @@ class TestGPTOSSSpeculativeChat:
492
493 chunk_reasoning = getattr(delta, "reasoning", None)
494 if chunk_reasoning:
495 - reasoning_content += delta.reasoning
495 + reasoning += delta.reasoning
496
497 - assert len(reasoning_content) > 0, "No reasoning was generated."
497 + assert len(reasoning) > 0, "No reasoning was generated."
498 assert content.strip() == "4"
499
500
tests/reasoning/test_step3p5_reasoning_parser.py
+20 -20
@@ -21,119 +21,119 @@ def step3p5_tokenizer():
21
22 SIMPLE_REASONING = {
23 "output": "This is a reasoning section</think>This is the rest",
24 - "reasoning_content": "This is a reasoning section",
24 + "reasoning": "This is a reasoning section",
25 "content": "This is the rest",
26 "is_reasoning_end": True,
27 }
28 # need to get into parser again to remove newline after </think>
29 COMPLETE_REASONING = {
30 "output": "This is a reasoning section</think>",
31 - "reasoning_content": "This is a reasoning section",
31 + "reasoning": "This is a reasoning section",
32 "content": None,
33 "is_reasoning_end": False,
34 }
35 NO_CONTENT = {
36 "output": "This is content",
37 - "reasoning_content": "This is content",
37 + "reasoning": "This is content",
38 "content": None,
39 "is_reasoning_end": False,
40 }
41 NO_REASONING_STREAMING = {
42 "output": "This is a reasoning section",
43 - "reasoning_content": "This is a reasoning section",
43 + "reasoning": "This is a reasoning section",
44 "content": None,
45 "is_reasoning_end": False,
46 }
47 MULTIPLE_LINES = {
48 "output": "This\nThat</think>This is the rest\nThat",
49 - "reasoning_content": "This\nThat",
49 + "reasoning": "This\nThat",
50 "content": "This is the rest\nThat",
51 "is_reasoning_end": True,
52 }
53 SHORTEST_REASONING_NO_STREAMING = {
54 "output": "</think>This is the rest",
55 - "reasoning_content": None,
55 + "reasoning": None,
56 "content": "This is the rest",
57 "is_reasoning_end": True,
58 }
59 SHORTEST_REASONING = {
60 "output": "</think>This is the rest",
61 - "reasoning_content": None,
61 + "reasoning": None,
62 "content": "This is the rest",
63 "is_reasoning_end": True,
64 }
65 REASONING_WITH_THINK = {
66 "output": "<think>This is a reasoning section</think>This is the rest",
67 - "reasoning_content": "This is a reasoning section",
67 + "reasoning": "This is a reasoning section",
68 "content": "This is the rest",
69 "is_reasoning_end": True,
70 }
71 COMPLETE_REASONING_WITH_THINK = {
72 "output": "<think>This is a reasoning section</think>",
73 - "reasoning_content": "This is a reasoning section",
73 + "reasoning": "This is a reasoning section",
74 "content": None,
75 "is_reasoning_end": False,
76 }
77 MULTIPLE_LINES_WITH_THINK = {
78 "output": "<think>This\nThat</think>This is the rest\nThat",
79 - "reasoning_content": "This\nThat",
79 + "reasoning": "This\nThat",
80 "content": "This is the rest\nThat",
81 "is_reasoning_end": True,
82 }
83 SHORTEST_REASONING_NO_STREAMING_WITH_THINK = {
84 "output": "</think>This is the rest",
85 - "reasoning_content": None,
85 + "reasoning": None,
86 "content": "This is the rest",
87 "is_reasoning_end": True,
88 }
89 SHORTEST_REASONING_WITH_THINK = {
90 "output": "</think>This is the rest",
91 - "reasoning_content": None,
91 + "reasoning": None,
92 "content": "This is the rest",
93 "is_reasoning_end": True,
94 }
95 THINK_NO_END = {
96 "output": "<think>This is a reasoning section",
97 - "reasoning_content": "This is a reasoning section",
97 + "reasoning": "This is a reasoning section",
98 "content": None,
99 "is_reasoning_end": False,
100 }
101 EMPTY = {
102 "output": "",
103 - "reasoning_content": None,
103 + "reasoning": None,
104 "content": None,
105 "is_reasoning_end": False,
106 }
107 EMPTY_STREAMING = {
108 "output": "",
109 - "reasoning_content": None,
109 + "reasoning": None,
110 "content": None,
111 "is_reasoning_end": False,
112 }
113 NEW_LINE = {
114 "output": "\n<think>This is a reasoning section</think>\nThis is the rest",
115 - "reasoning_content": "This is a reasoning section",
115 + "reasoning": "This is a reasoning section",
116 "content": "This is the rest",
117 "is_reasoning_end": True,
118 }
119
120 NEW_LINE_STREAMING = {
121 "output": "\n<think>This is a reasoning section\n</think>\nThis is the rest",
122 - "reasoning_content": "\nThis is a reasoning section",
122 + "reasoning": "\nThis is a reasoning section",
123 "content": "This is the rest",
124 "is_reasoning_end": True,
125 }
126
127 NEW_LINE_STREAMING_COMPLEX_CONTENT = {
128 "output": "\n This is a \n reasoning section\n\n\n</think>\n\nThis is the rest",
129 - "reasoning_content": "\n This is a \n reasoning section\n\n",
129 + "reasoning": "\n This is a \n reasoning section\n\n",
130 "content": "\nThis is the rest",
131 "is_reasoning_end": True,
132 }
133
134 MULTI_TURN_PROMPT_CONTENT = {
135 "output": "<think> This is last turn's reasoning section </think> hello <think>",
136 - "reasoning_content": "",
136 + "reasoning": "",
137 "content": "",
138 "is_reasoning_end": False,
139 }
@@ -296,7 +296,7 @@ def test_reasoning(
296 print(f"content: {content}")
297 test_id = request.node.callspec.id if hasattr(request.node, "callspec") else None
298 if request.node.callspec.id != "multi_turn_prompt_content":
299 - assert reasoning == param_dict["reasoning_content"]
299 + assert reasoning == param_dict["reasoning"]
300 assert content == param_dict["content"]
301
302 # Test is_reasoning_end
vllm/entrypoints/openai/parser/responses_parser.py
+3 -3
@@ -61,10 +61,10 @@ class ResponsesParser:
61 # Store the finish_reason from the output
62 self.finish_reason = output.finish_reason
63
64 - reasoning_content, content = self.reasoning_parser_instance.extract_reasoning(
64 + reasoning, content = self.reasoning_parser_instance.extract_reasoning(
65 output.text, request=self.request
66 )
67 - if reasoning_content:
67 + if reasoning:
68 self.response_messages.append(
69 ResponseReasoningItem(
70 type="reasoning",
@@ -73,7 +73,7 @@ class ResponsesParser:
73 content=[
74 Content(
75 type="reasoning_text",
76 - text=reasoning_content,
76 + text=reasoning,
77 )
78 ],
79 )
vllm/entrypoints/openai/responses/utils.py
+4 -4
@@ -191,13 +191,13 @@ def _construct_single_message_from_response_item(
191 ],
192 )
193 elif isinstance(item, ResponseReasoningItem):
194 - reasoning_content = ""
194 + reasoning = ""
195 if item.encrypted_content:
196 raise ValueError("Encrypted content is not supported.")
197 elif item.content and len(item.content) >= 1:
198 - reasoning_content = item.content[0].text
198 + reasoning = item.content[0].text
199 elif len(item.summary) >= 1:
200 - reasoning_content = item.summary[0].text
200 + reasoning = item.summary[0].text
201 logger.warning(
202 "Using summary text as reasoning content for item %s. "
203 "Please use content instead of summary for "
@@ -206,7 +206,7 @@ def _construct_single_message_from_response_item(
206 )
207 return {
208 "role": "assistant",
209 - "reasoning": reasoning_content,
209 + "reasoning": reasoning,
210 }
211 elif isinstance(item, ResponseOutputMessage):
212 return {
vllm/parser/abstract_parser.py
+1 -1
@@ -199,7 +199,7 @@ class Parser:
199 request: The request object used to generate the output.
200
201 Returns:
202 - A tuple of (reasoning_content, response_content).
202 + A tuple of (reasoning, response_content).
203 """
204
205 @abstractmethod
vllm/reasoning/nemotron_v3_reasoning_parser.py
+3 -5
@@ -17,9 +17,7 @@ class NemotronV3ReasoningParser(DeepSeekR1ReasoningParser):
17 def extract_reasoning(
18 self, model_output: str, request: ChatCompletionRequest | ResponsesRequest
19 ) -> tuple[str | None, str | None]:
20 - reasoning_content, final_content = super().extract_reasoning(
21 - model_output, request
22 - )
20 + reasoning, final_content = super().extract_reasoning(model_output, request)
21 chat_template_kwargs = getattr(request, "chat_template_kwargs", None)
22
23 if (
@@ -30,6 +28,6 @@ class NemotronV3ReasoningParser(DeepSeekR1ReasoningParser):
28 )
29 and final_content is None
30 ):
33 - reasoning_content, final_content = final_content, reasoning_content
31 + reasoning, final_content = final_content, reasoning
32
35 - return reasoning_content, final_content
33 + return reasoning, final_content
vllm/tool_parsers/step3p5_tool_parser.py
+1 -1
@@ -295,7 +295,7 @@ class StreamingXMLToolCallParser:
295 final_delta = DeltaMessage(
296 role=None,
297 content=None,
298 - reasoning_content=None,
298 + reasoning=None,
299 tool_calls=[
300 DeltaToolCall(
301 index=self.tool_call_index - 1,