vllm.parser.qwen3 ¶
Qwen3 parser for tool calls and reasoning.
Qwen3 XML tool call format::
<tool_call>
<function=func_name>
<parameter=key>value</parameter>
</function>
</tool_call>
The argument body consists of <parameter=NAME>VALUE</parameter> tags. The _qwen3_arg_converter parses these into a JSON object.
Classes:
-
Qwen3Parser–Qwen3 parser:
<think>/</think>reasoning +
Qwen3Parser ¶
Bases: ParserEngine
Qwen3 parser: <think>/</think> reasoning + <tool_call> XML tool calls in a single engine.
<tool_call>as implicit reasoning end- Unpaired
<tool_call>token ID detection foris_reasoning_end
Subclasses that share the grammar but differ only in the four wrapper token strings (reasoning + tool-call) override the class attributes below; everything else is inherited unchanged.
Source code in vllm/parser/qwen3.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |