talira

An array framework for Apple silicon

open sourceMITself-hostablefree

MLX is an array framework for machine learning on Apple silicon from Apple's machine learning research team. It has a Python API that closely follows NumPy, PyTorch-like mlx.nn and mlx.optimizers packages, and C++, C and Swift APIs that mirror it. Arrays live in unified memory, so operations run on the CPU or GPU without copying data, computation is lazy, graphs are built dynamically, and composable function transformations give automatic differentiation, vectorization and graph optimization. It's installed with pip on macOS, with a CUDA backend and a CPU-only package for Linux, and is used to train and run models, including LLMs, locally on Macs.

Problems it solves

  • train and run machine learning models efficiently on my Apple Silicon Mac
  • run LLMs locally on a Mac using its GPU and unified memory
  • a NumPy-like array library that uses the Mac GPU
  • fine-tune a model on a MacBook without an NVIDIA GPU
  • use machine learning from Swift on Apple platforms
  • port a PyTorch model to run natively on Apple Silicon

Features

  • NumPy-like Python API
  • PyTorch-like mlx.nn and mlx.optimizers
  • C++, C and Swift APIs
  • unified memory: no copies between CPU and GPU
  • lazy computation and dynamic graphs
  • automatic differentiation, vectorization and graph optimization
  • CUDA backend and CPU-only package on Linux

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what MLX does.

  1. JAX Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more
  2. llama.cpp LLM inference in C/C++
  3. Burn A Rust tensor library and deep learning framework for training and inference on any hardware.
  4. TensorFlow An Open Source Machine Learning Framework for Everyone
  5. Keras Deep Learning for humans
  6. PyTorch Tensors and dynamic neural networks in Python with strong GPU acceleration

Compare MLX with the top 3