# `vllm_mlx.cli_arg_types`

Argparse type helpers shared by CLI entrypoints.

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

## 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.cli_arg_types
    options:
      members:
        - parse_json_object_arg
        - make_json_object_arg_parser
        - positive_int_arg
        - parse_positive_int_arg
        - make_positive_int_arg_parser
      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.cli_arg_types.parse_json_object_arg" markdown="1">
<summary><code>vllm_mlx.cli_arg_types.parse_json_object_arg</code> · function</summary>

```python
vllm_mlx.cli_arg_types.parse_json_object_arg(value: str, option_name: str) -> dict[str, Any]
```

Parse and validate that an option value is a JSON object.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `str` | `yes` | `none` | Required positional or keyword input. |
| `option_name` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `dict[str, Any]`
- Direct return expressions: `parsed`

**Exceptions and behavior**

Function `parse_json_object_arg` calls `json.loads`, `argparse.ArgumentTypeError`, `isinstance`; can raise `argparse.ArgumentTypeError`; returns `parsed`.
Directly raised exceptions: `argparse.ArgumentTypeError`.

[View source #L10-L22](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L10-L22).

</details>

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

```python
vllm_mlx.cli_arg_types.make_json_object_arg_parser(option_name: str) -> Callable[[str], dict[str, Any]]
```

Create an argparse type parser for JSON object options.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `option_name` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `Callable[[str], dict[str, Any]]`
- Direct return expressions: `_parser`

**Exceptions and behavior**

Function `make_json_object_arg_parser` returns `_parser`.
No direct `raise` statement appears in this definition.

[View source #L25-L31](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L25-L31).

</details>

<details class="api-contract" id="contract-vllm_mlx.cli_arg_types.make_json_object_arg_parser._parser" markdown="1">
<summary><code>vllm_mlx.cli_arg_types.make_json_object_arg_parser._parser</code> · nested function</summary>

```python
vllm_mlx.cli_arg_types.make_json_object_arg_parser._parser(value: str) -> dict[str, Any]
```

Nested Function `make_json_object_arg_parser._parser` calls `parse_json_object_arg`; returns `parse_json_object_arg(value, option_name)`.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `dict[str, Any]`
- Direct return expressions: `parse_json_object_arg(value, option_name)`

**Exceptions and behavior**

Nested Function `make_json_object_arg_parser._parser` calls `parse_json_object_arg`; returns `parse_json_object_arg(value, option_name)`.
No direct `raise` statement appears in this definition.

[View source #L28-L29](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L28-L29).

</details>

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

```python
vllm_mlx.cli_arg_types.positive_int_arg(value: str) -> int
```

Parse an argparse integer that must be greater than zero.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `int`
- Direct return expressions: `parsed`

**Exceptions and behavior**

Function `positive_int_arg` calls `int`, `argparse.ArgumentTypeError`; can raise `argparse.ArgumentTypeError`; returns `parsed`.
Directly raised exceptions: `argparse.ArgumentTypeError`.

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

</details>

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

```python
vllm_mlx.cli_arg_types.parse_positive_int_arg(value: str, option_name: str) -> int
```

Parse and validate that an option value is a positive integer.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `str` | `yes` | `none` | Required positional or keyword input. |
| `option_name` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `int`
- Direct return expressions: `parsed`

**Exceptions and behavior**

Function `parse_positive_int_arg` calls `int`, `argparse.ArgumentTypeError`; can raise `argparse.ArgumentTypeError`; returns `parsed`.
Directly raised exceptions: `argparse.ArgumentTypeError`.

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

</details>

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

```python
vllm_mlx.cli_arg_types.make_positive_int_arg_parser(option_name: str) -> Callable[[str], int]
```

Create an argparse type parser for positive integer options.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `option_name` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `Callable[[str], int]`
- Direct return expressions: `_parser`

**Exceptions and behavior**

Function `make_positive_int_arg_parser` returns `_parser`.
No direct `raise` statement appears in this definition.

[View source #L56-L62](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L56-L62).

</details>

<details class="api-contract" id="contract-vllm_mlx.cli_arg_types.make_positive_int_arg_parser._parser" markdown="1">
<summary><code>vllm_mlx.cli_arg_types.make_positive_int_arg_parser._parser</code> · nested function</summary>

```python
vllm_mlx.cli_arg_types.make_positive_int_arg_parser._parser(value: str) -> int
```

Nested Function `make_positive_int_arg_parser._parser` calls `parse_positive_int_arg`; returns `parse_positive_int_arg(value, option_name)`.

**Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `str` | `yes` | `none` | Required positional or keyword input. |

**Returns**

- Type: `int`
- Direct return expressions: `parse_positive_int_arg(value, option_name)`

**Exceptions and behavior**

Nested Function `make_positive_int_arg_parser._parser` calls `parse_positive_int_arg`; returns `parse_positive_int_arg(value, option_name)`.
No direct `raise` statement appears in this definition.

[View source #L59-L60](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L59-L60).

</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 |
| --- | --- | --- | --- | --- |
| [`parse_json_object_arg`](#contract-vllm_mlx.cli_arg_types.parse_json_object_arg) | function | `parse_json_object_arg(value: str, option_name: str) -> dict[str, Any]` | Parse and validate that an option value is a JSON object. | [#L10-L22](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L10-L22) |
| [`make_json_object_arg_parser`](#contract-vllm_mlx.cli_arg_types.make_json_object_arg_parser) | function | `make_json_object_arg_parser(option_name: str) -> Callable[[str], dict[str, Any]]` | Create an argparse type parser for JSON object options. | [#L25-L31](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L25-L31) |
| [`make_json_object_arg_parser._parser`](#contract-vllm_mlx.cli_arg_types.make_json_object_arg_parser._parser) | nested function | `make_json_object_arg_parser._parser(value: str) -> dict[str, Any]` | Nested Function `make_json_object_arg_parser._parser` calls `parse_json_object_arg`; returns `parse_json_object_arg(value, option_name)`. | [#L28-L29](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L28-L29) |
| [`positive_int_arg`](#contract-vllm_mlx.cli_arg_types.positive_int_arg) | function | `positive_int_arg(value: str) -> int` | Parse an argparse integer that must be greater than zero. | [#L34-L42](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L34-L42) |
| [`parse_positive_int_arg`](#contract-vllm_mlx.cli_arg_types.parse_positive_int_arg) | function | `parse_positive_int_arg(value: str, option_name: str) -> int` | Parse and validate that an option value is a positive integer. | [#L45-L53](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L45-L53) |
| [`make_positive_int_arg_parser`](#contract-vllm_mlx.cli_arg_types.make_positive_int_arg_parser) | function | `make_positive_int_arg_parser(option_name: str) -> Callable[[str], int]` | Create an argparse type parser for positive integer options. | [#L56-L62](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L56-L62) |
| [`make_positive_int_arg_parser._parser`](#contract-vllm_mlx.cli_arg_types.make_positive_int_arg_parser._parser) | nested function | `make_positive_int_arg_parser._parser(value: str) -> int` | Nested Function `make_positive_int_arg_parser._parser` calls `parse_positive_int_arg`; returns `parse_positive_int_arg(value, option_name)`. | [#L59-L60](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/cli_arg_types.py#L59-L60) |
