Skip to content

vllm_mlx.engine

Engine abstraction for vllm-mlx inference.

View the complete module source at #L1-L54.

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.engine

Engine abstraction for vllm-mlx inference.

The package stays intentionally light at import time so server- and contract-level tests can import API modules without eagerly importing MLX, engine_core, or the batched engine stack.

vllm_mlx.engine._ENGINE_CORE_NAMES module-attribute

_ENGINE_CORE_NAMES = frozenset({'EngineCore', 'AsyncEngineCore', 'EngineConfig'})

vllm_mlx.engine.__all__ module-attribute

__all__ = ['BaseEngine', 'GenerationOutput', 'SimpleEngine', 'BatchedEngine', 'EngineCore', 'AsyncEngineCore', 'EngineConfig']

vllm_mlx.engine.__getattr__

__getattr__(name: str)
Source code in vllm_mlx/engine/__init__.py
def __getattr__(name: str):
    if name == "SimpleEngine":
        from .simple import SimpleEngine

        return SimpleEngine

    if name == "BatchedEngine":
        from .batched import BatchedEngine

        return BatchedEngine

    if name in {"EngineCore", "AsyncEngineCore", "EngineConfig"}:
        from ..engine_core import AsyncEngineCore, EngineConfig, EngineCore

        return {
            "EngineCore": EngineCore,
            "AsyncEngineCore": AsyncEngineCore,
            "EngineConfig": EngineConfig,
        }[name]

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

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.

vllm_mlx.engine.__getattr__ · function
vllm_mlx.engine.__getattr__(name: str) -> not annotated

Function __getattr__ calls AttributeError; can raise AttributeError; has 3 explicit return paths.

Parameters

Name Type Required Default Description
name str yes none Required positional or keyword input.

Returns

  • Type: not annotated
  • Direct return expressions: SimpleEngine; BatchedEngine; {'EngineCore': EngineCore, 'AsyncEngineCore': AsyncEngineCore, 'EngineConfig': EngineConfig}[name]

Exceptions and behavior

Function __getattr__ calls AttributeError; can raise AttributeError; has 3 explicit return paths. Directly raised exceptions: AttributeError.

View source #L34-L54.

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
__getattr__ function __getattr__(name: str) -> not annotated Function __getattr__ calls AttributeError; can raise AttributeError; has 3 explicit return paths. #L34-L54