# `vllm_mlx.reasoning.qwen3_parser`

Reasoning parser for Qwen3 models.

[View the complete module source at #L1-L68](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L1-L68).

## API details

Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.

::: vllm_mlx.reasoning.qwen3_parser
    options:
      members:
        - Qwen3ReasoningParser
      filters: []
      show_if_no_docstring: true

## Complete contract reference

Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.

<details class="api-contract" id="contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser" markdown="1">
<summary><code>vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser</code> · class</summary>

```python
vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser()
```

Reasoning parser for Qwen3 models.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Constructs: `vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser`

**Exceptions and behavior**

Class `Qwen3ReasoningParser` derives from `BaseThinkingReasoningParser` and declares 3 direct member(s).
No direct `raise` statement appears in this definition.

[View source #L15-L68](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L15-L68).

</details>

<details class="api-contract" id="contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.start_token" markdown="1">
<summary><code>vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.start_token</code> · method</summary>

```python
vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.start_token() -> str
```

Return the Qwen3 reasoning opening marker.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `str`
- Direct return expressions: `'<think>'`

**Exceptions and behavior**

Method `Qwen3ReasoningParser.start_token` returns `'<think>'`.
No direct `raise` statement appears in this definition.

[View source #L36-L39](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L36-L39).

</details>

<details class="api-contract" id="contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.end_token" markdown="1">
<summary><code>vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.end_token</code> · method</summary>

```python
vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.end_token() -> str
```

Return the Qwen3 reasoning closing marker.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `str`
- Direct return expressions: `'</think>'`

**Exceptions and behavior**

Method `Qwen3ReasoningParser.end_token` returns `'</think>'`.
No direct `raise` statement appears in this definition.

[View source #L42-L45](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L42-L45).

</details>

<details class="api-contract" id="contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.extract_reasoning" markdown="1">
<summary><code>vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.extract_reasoning</code> · method</summary>

```python
vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.extract_reasoning(model_output: str) -> tuple[str | None, str | None]
```

Extract reasoning from Qwen3 output.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `model_output` | `str` | `yes` | `none` | Complete model output text. |

**Returns**

- Type: `tuple[str | None, str | None]`
- Direct return expressions: `(None, model_output)`; `super().extract_reasoning(model_output)`

**Exceptions and behavior**

Method `Qwen3ReasoningParser.extract_reasoning` calls `super().extract_reasoning`, `super`; has 2 explicit return paths.
No direct `raise` statement appears in this definition.

[View source #L47-L68](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L47-L68).

</details>

## Complete symbol map

This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.

| Symbol | Kind | Signature and inputs | What it does | Source |
| --- | --- | --- | --- | --- |
| [`Qwen3ReasoningParser`](#contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser) | class | `Qwen3ReasoningParser()` | Reasoning parser for Qwen3 models. | [#L15-L68](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L15-L68) |
| [`Qwen3ReasoningParser.start_token`](#contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.start_token) | method | `Qwen3ReasoningParser.start_token() -> str` | Return the Qwen3 reasoning opening marker. | [#L36-L39](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L36-L39) |
| [`Qwen3ReasoningParser.end_token`](#contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.end_token) | method | `Qwen3ReasoningParser.end_token() -> str` | Return the Qwen3 reasoning closing marker. | [#L42-L45](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L42-L45) |
| [`Qwen3ReasoningParser.extract_reasoning`](#contract-vllm_mlx.reasoning.qwen3_parser.Qwen3ReasoningParser.extract_reasoning) | method | `Qwen3ReasoningParser.extract_reasoning(model_output: str) -> tuple[str \| None, str \| None]` | Extract reasoning from Qwen3 output. | [#L47-L68](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/qwen3_parser.py#L47-L68) |
