vllm.reasoning.qwen3_reasoning_parser ¶
Qwen3ReasoningParser ¶
Bases: BaseThinkingReasoningParser
Reasoning parser for the Qwen3 model.
The Qwen3 model uses
Source code in vllm/reasoning/qwen3_reasoning_parser.py
extract_reasoning_content ¶
extract_reasoning_content(
model_output: str,
request: Union[ChatCompletionRequest, ResponsesRequest],
) -> tuple[Optional[str], Optional[str]]
Extract reasoning content from the model output.
Qwen3 has stricter requirements - it needs both start and end tokens to be present, unlike other models that work with just the end token.
For text
Returns:
Type | Description |
---|---|
tuple[Optional[str], Optional[str]] | tuple[Optional[str], Optional[str]]: reasoning content and content |