# `vllm_mlx.plugin`

vLLM Platform Plugin for MLX.

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

## 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.plugin
    options:
      members:
        - logger
        - mlx_platform_plugin
        - is_mlx_available
        - get_mlx_device_info
      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.plugin.mlx_platform_plugin" markdown="1">
<summary><code>vllm_mlx.plugin.mlx_platform_plugin</code> · function</summary>

```python
vllm_mlx.plugin.mlx_platform_plugin() -> str | None
```

Platform plugin entry point for vLLM.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `str | None`
- Direct return expressions: `None`; `'vllm_mlx.vllm_platform.MLXPlatform'`

**Exceptions and behavior**

Function `mlx_platform_plugin` calls `logger.debug`, `platform.machine`, `mx.array`, `mx.sum`; has 2 explicit return paths.
No direct `raise` statement appears in this definition.

[View source #L17-L70](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/plugin.py#L17-L70).

</details>

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

```python
vllm_mlx.plugin.is_mlx_available() -> bool
```

Check if MLX platform can be used.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `bool`
- Direct return expressions: `mlx_platform_plugin() is not None`

**Exceptions and behavior**

Function `is_mlx_available` calls `mlx_platform_plugin`; returns `mlx_platform_plugin() is not None`.
No direct `raise` statement appears in this definition.

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

</details>

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

```python
vllm_mlx.plugin.get_mlx_device_info() -> dict
```

Get information about the MLX device.

**Parameters**

This callable has no explicit inputs.

**Returns**

- Type: `dict`
- Direct return expressions: `info`

**Exceptions and behavior**

Function `get_mlx_device_info` calls `is_mlx_available`, `subprocess.run`, `result.stdout.strip`, `int`; returns `info`.
No direct `raise` statement appears in this definition.

[View source #L83-L155](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/plugin.py#L83-L155).

</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 |
| --- | --- | --- | --- | --- |
| [`mlx_platform_plugin`](#contract-vllm_mlx.plugin.mlx_platform_plugin) | function | `mlx_platform_plugin() -> str \| None` | Platform plugin entry point for vLLM. | [#L17-L70](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/plugin.py#L17-L70) |
| [`is_mlx_available`](#contract-vllm_mlx.plugin.is_mlx_available) | function | `is_mlx_available() -> bool` | Check if MLX platform can be used. | [#L73-L80](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/plugin.py#L73-L80) |
| [`get_mlx_device_info`](#contract-vllm_mlx.plugin.get_mlx_device_info) | function | `get_mlx_device_info() -> dict` | Get information about the MLX device. | [#L83-L155](https://github.com/waybarrios/vllm-mlx/blob/a69d47912bcb21d8fe04d48f75fa896b620ffcfa/vllm_mlx/plugin.py#L83-L155) |
