Skip to content

MLX

An array framework for machine learning on Apple silicon, with a NumPy-style Python API.

Stars
29k
Forks
2.4k
Licence
MIT
Language
C++
Last update
4 days ago
Type
Library

What it is

MLX is an open-source framework for building and running machine learning code on Apple silicon Macs. It provides array operations with a Python API that closely follows NumPy, plus higher-level packages for neural networks and optimizers. Its main distinguishing feature is a unified memory model, where arrays live in shared memory and can be used by the CPU or GPU without copying data.

  • Install with pip and run array operations in Python using a NumPy-like syntax
  • Explore the MLX examples repo, such as Transformer language model training or Whisper speech recognition
  • Use mlx.nn and mlx.optimizers to build and train neural network models
  • Use function transformations such as automatic differentiation and vectorization on your own code

Great for

  • Researchers experimenting with machine learning models on a Mac with Apple silicon
  • Developers who already know NumPy or PyTorch and want a familiar API
  • People who want to run or fine-tune models like LLaMA or Whisper locally using the MLX examples
  • Developers who want C++, C, or Swift bindings for Apple silicon machine learning

Not ideal for

  • Users who need to deploy on Windows or non-Apple hardware: the README lists CPU and GPU devices, and the Linux install options mention CUDA and CPU-only packages, so cross-platform support is narrower than general frameworks
  • People looking for a finished end-user application: MLX is a framework for building models, not a ready-made app
Step-by-step guide: how to use MLXInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python (version not stated in the README) · pip

    Install on macOS

    pip install mlx

    Install CUDA backend on Linux

    pip install mlx[cuda]

    Install CPU-only Linux package

    pip install mlx[cpu]
  2. 2

    Run it

    • Install MLX with pip install mlx on macOS
    • Follow the quick start guide in the documentation at ml-explore.github.io/mlx
    • Try a basic array operation in Python to confirm the install works
    • Browse the MLX examples repo for a model to run
  3. 3

    Get the most out of it

    • Use the MLX examples repo for end-to-end models such as LLaMA, LoRA finetuning, Stable Diffusion, and Whisper
    • Use mlx.nn and mlx.optimizers to build models with a PyTorch-like structure
    • Try the C, Swift, or C++ APIs if your project is not in Python, via the linked mlx-c and mlx-swift repos
    • Read the documentation for building from source if you need a custom build

Downloads

Strengths

  • Familiar NumPy-like and PyTorch-like APIs lower the learning curve for many developers
  • Unified memory lets operations run on CPU or GPU without transferring data, per the README
  • Backed by Apple machine learning research and has examples for several well-known models

Trade-offs

  • The README describes it as built for Apple silicon, so its main use case is limited to that hardware
  • The README is truncated and does not give detailed performance numbers or a full feature list, so some claims need checking in the docs

How it compares

ProjectStarsTypeLevelUpdatedBest for
mlx (this)29kLibraryintermediate4 days agoResearchers experimenting with machine learning models on a Mac with Apple silicon
tinygrad33.8kLibraryintermediate4 days agoDevelopers who want to read and modify how a deep learning stack works internally
llmfit38.6kCLIbeginner4 days agoPeople deciding which local LLM to download for their laptop or desktop
voicebox59.2kAppbeginner30 days agoPeople who want text-to-speech or voice cloning without sending audio to cloud services

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.