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 10, 16:30 UTC
[Frontend] Support GLM-4.5 / GLM-4.7 with enable_thinking: false (#31788)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Chauncey committed
Jan 6, 2026 at 21:53 UTC
0202971a4842e129027b0931870112e45ee9ad65
3 files changed
+11
-9
vllm/reasoning/deepseek_v3_reasoning_parser.py
+3
-3
@@ -24,9 +24,9 @@ class DeepSeekV3ReasoningParser(ReasoningParser):
24
def __init__(self, tokenizer: PreTrainedTokenizerBase, *args, **kwargs):
25
super().__init__(tokenizer, *args, **kwargs)
26
27
- chat_kwargs = kwargs.pop("chat_template_kwargs", {}) or {}
28
- thinking = bool(chat_kwargs.pop("thinking", False))
29
- enable_thinking = bool(chat_kwargs.pop("enable_thinking", False))
27
+ chat_kwargs = kwargs.get("chat_template_kwargs", {}) or {}
28
+ thinking = bool(chat_kwargs.get("thinking", False))
29
+ enable_thinking = bool(chat_kwargs.get("enable_thinking", False))
30
thinking = thinking or enable_thinking
31
32
if thinking:
vllm/reasoning/glm4_moe_reasoning_parser.py
+4
-3
@@ -1,12 +1,13 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
-from vllm.reasoning.deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser
4
+from vllm.reasoning.holo2_reasoning_parser import Holo2ReasoningParser
5
6
7
-class Glm4MoeModelReasoningParser(DeepSeekR1ReasoningParser):
7
+class Glm4MoeModelReasoningParser(Holo2ReasoningParser):
8
"""
9
- Reasoning parser for the Glm4MoeModel model is same as DeepSeekR1ReasoningParser.
9
+ Reasoning parser for the Glm4MoeModel model,which inherits from
10
+ `Holo2ReasoningParser`.
11
"""
12
13
pass
vllm/reasoning/holo2_reasoning_parser.py
+4
-3
@@ -46,9 +46,10 @@ class Holo2ReasoningParser(ReasoningParser):
46
# all requests in the structured output manager. So it is important that without
47
# user specified chat template args, the default thinking is True.
48
49
- enable_thinking = bool(chat_kwargs.get("thinking", True))
50
-
51
- if enable_thinking:
49
+ thinking = bool(chat_kwargs.get("thinking", True))
50
+ enable_thinking = bool(chat_kwargs.get("enable_thinking", True))
51
+ thinking = thinking and enable_thinking
52
+ if thinking:
53
self._parser = DeepSeekR1ReasoningParser(tokenizer, *args, **kwargs)
54
else:
55
self._parser = IdentityReasoningParser(tokenizer, *args, **kwargs)