pixano_inference.frameworks.mlx
MLX framework adapter (Apple Silicon).
Provides framework-neutral device/dtype resolution and numpy interchange for custom models written in MLX. MLX runs on Apple-Silicon GPUs (Metal) and CPU. MLX is imported lazily; importing this module does not require it.
MlxAdapter
:class:~pixano_inference.frameworks.base.FrameworkAdapter for MLX.
from_numpy(array, device=None, dtype=None)
Convert a numpy array to an MLX array. MLX manages device placement implicitly.
Source code in pixano_inference/frameworks/mlx.py
is_available()
resolve_device(num_gpus)
Return an MLX device: the Metal GPU when requested and available, else CPU.
Source code in pixano_inference/frameworks/mlx.py
resolve_dtype(dtype)
Resolve an mlx dtype from a string (e.g. "float32", "bfloat16").