MLX

Tools & Infrastructure 💻 C++ ⚖️ MIT 🟢 Actively maintained
28.3k stars

MLX is an array framework for machine learning on Apple silicon, developed by Apple's machine learning research team. It provides familiar NumPy-like APIs, composable function transformations, and a unified memory model to simplify model training and deployment. It is designed for machine learning researchers who want a user-friendly yet efficient framework.

mlx

✨ Key features

  • Familiar APIs: Python API closely follows NumPy; also C++, C, and Swift APIs.
  • Composable function transformations: automatic differentiation, vectorization, and graph optimization.
  • Lazy computation: arrays materialize only when needed.
  • Dynamic graph construction: no slow compilations on shape changes.
  • Multi-device support: operations run on CPU and GPU.
  • Unified memory model: arrays in shared memory, no data transfer between devices.

🎯 Use cases

  • Training transformer language models.
  • Large-scale text generation with LLaMA and finetuning with LoRA.
  • Generating images with Stable Diffusion.
  • Speech recognition with OpenAI's Whisper.

📦 Installation

🧰 Requirements: macOS for standard install; Linux with CUDA or CPU-only packages available. No API keys required.

pip install mlx

To install the CUDA backend on Linux:

pip install mlx[cuda]

To install a CPU-only Linux package:

pip install mlx[cpu]

🚀 Usage

See the quick start guide in the documentation: https://ml-explore.github.io/mlx/build/html/usage/quick_start.html

⚠️ Good to know

MLX is designed for Apple silicon and Linux with optional CUDA; it is not a general-purpose framework for all platforms.

❓ FAQ

What platforms does MLX support?

MLX supports macOS (Apple silicon) and Linux with either CUDA or CPU-only packages.

Does MLX have a Python API?

Yes, MLX has a Python API that closely follows NumPy, along with C++, C, and Swift APIs.

How does MLX handle memory?

MLX uses a unified memory model where arrays live in shared memory, allowing operations on any device without data transfer.

Is MLX suitable for training large models?

Yes, MLX is designed for efficient training and deployment, with examples like LLaMA and Stable Diffusion.

📊 Repository

Stars★ 28,311
Forks🍴 2,225
Open issues🐛 134
Last commit🕒 Sep 4, 2026
Created📅 Nov 2023
Language💻 C++
License⚖️ MIT
Topics mlx

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.