MLX (Apple ML framework)
Machine learning framework developed by Apple
From Wikipedia, the free encyclopedia
MLX is an open-source machine learning framework developed by Apple and designed primarily for Apple silicon. It is used for training and running machine learning models and is optimized for Apple silicon's unified memory architecture, allowing the CPU and GPU to work with the same data without copying it between separate memory pools.[1] MLX can be used for applications including large language model training and inference, image generation, and speech recognition.[2]
| MLX | |
|---|---|
| Developer | Apple |
| Release | December 5, 2023 |
| Written in | C++, Python, CUDA, Metal |
| Type | Machine learning framework |
| License | MIT License |
| Website | mlx-framework |
| Repository | https://github.com/ml-explore/mlx |
History
Apple's machine learning research team released MLX in December 2023.[3] It was initially developed by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert and released under the MIT License.[4] Its design was influenced by numerical and machine learning frameworks including NumPy, PyTorch, and JAX.[5]
A Swift interface for MLX was released in February 2024, allowing machine learning research using Swift on Apple silicon.[6] In March 2026, Ollama introduced support for MLX for running local language models on Apple silicon Macs.[7]
Features
MLX can be used to run and train artificial intelligence models, including large language models, locally on Apple silicon Macs. It provides higher-level neural network and optimization tools similar to PyTorch and supports automatic differentiation, lazy computation, dynamic computation graphs, vectorization, and execution on CPUs and GPUs.[2] On Apple silicon, arrays are stored in shared unified memory and can be processed by either the CPU or GPU without transferring them between separate memory spaces.[8]
MLX provides interfaces for Swift and C, while MLX Core provides bindings for Python and C++. Its Python API is modeled after NumPy, and MLX can run on Apple platforms that support Metal.[9]
The MLX ecosystem includes MLX LM,[10] a package for generating text with and fine-tuning large language models. Apple provides MLX examples for models including Llama, Stable Diffusion, and Whisper. The framework's current releases also provide CPU and CUDA backends for Linux.[11]