# `vllm_mlx.reasoning`

Reasoning parser module for vllm-mlx.

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

## 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
    options:
      members:
        - _REASONING_PARSERS
        - register_parser
        - get_parser
        - list_parsers
        - _register_builtin_parsers
        - __all__
      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.register_parser" markdown="1">
<summary><code>vllm_mlx.reasoning.register_parser</code> · function</summary>

```python
vllm_mlx.reasoning.register_parser(name: str, parser_class: type[ReasoningParser]) -> None
```

Register a reasoning parser.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `name` | `str` | `yes` | `none` | Name to register the parser under (e.g., "qwen3"). |
| `parser_class` | `type[ReasoningParser]` | `yes` | `none` | The parser class to register. |

**Returns**

- Type: `None`

**Exceptions and behavior**

Function `register_parser` contains no state mutation, call, raise, return, await, or yield.
No direct `raise` statement appears in this definition.

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

</details>

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

```python
vllm_mlx.reasoning.get_parser(name: str) -> type[ReasoningParser]
```

Get a reasoning parser class by name.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `name` | `str` | `yes` | `none` | Name of the parser (e.g., "qwen3", "deepseek_r1"). |

**Returns**

- Type: `type[ReasoningParser]`
- Direct return expressions: `_REASONING_PARSERS[name]`

**Exceptions and behavior**

Function `get_parser` calls `list`, `_REASONING_PARSERS.keys`, `KeyError`; can raise `KeyError`; returns `_REASONING_PARSERS[name]`.
Directly raised exceptions: `KeyError`.

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

</details>

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

```python
vllm_mlx.reasoning.list_parsers() -> list[str]
```

List available parser names.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `list[str]`
- Direct return expressions: `list(_REASONING_PARSERS.keys())`

**Exceptions and behavior**

Function `list_parsers` calls `list`, `_REASONING_PARSERS.keys`; returns `list(_REASONING_PARSERS.keys())`.
No direct `raise` statement appears in this definition.

[View source #L66-L73](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L66-L73).

</details>

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

```python
vllm_mlx.reasoning._register_builtin_parsers() -> not annotated
```

Register built-in parsers.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `not annotated`

**Exceptions and behavior**

Function `_register_builtin_parsers` calls `register_parser`.
No direct `raise` statement appears in this definition.

[View source #L76-L94](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L76-L94).

</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 |
| --- | --- | --- | --- | --- |
| [`register_parser`](#contract-vllm_mlx.reasoning.register_parser) | function | `register_parser(name: str, parser_class: type[ReasoningParser]) -> None` | Register a reasoning parser. | [#L34-L42](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L34-L42) |
| [`get_parser`](#contract-vllm_mlx.reasoning.get_parser) | function | `get_parser(name: str) -> type[ReasoningParser]` | Get a reasoning parser class by name. | [#L45-L63](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L45-L63) |
| [`list_parsers`](#contract-vllm_mlx.reasoning.list_parsers) | function | `list_parsers() -> list[str]` | List available parser names. | [#L66-L73](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L66-L73) |
| [`_register_builtin_parsers`](#contract-vllm_mlx.reasoning._register_builtin_parsers) | function | `_register_builtin_parsers() -> not annotated` | Register built-in parsers. | [#L76-L94](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/reasoning/__init__.py#L76-L94) |
