MLX LM

Apple's Python package for generating text and fine-tuning language models on Apple silicon Macs with the MLX framework.

  • Libraries
  • MIT · Open source
  • macOS
  • Verified

MLX LM is a Python package for running and fine-tuning language models on Apple silicon with MLX, Apple's machine-learning framework for its chips. It connects to the Hugging Face Hub, so a single command can download and use thousands of models, and it can quantize a model and upload the result back to the Hub.

The quick start is two commands: mlx_lm.generate produces text from a prompt, and mlx_lm.chat opens a chat session in the terminal. It supports low-rank (LoRA) and full-model fine-tuning, including on quantized models, and distributed inference and fine-tuning across machines with mx.distributed. Install it with pip install mlx-lm or from conda-forge.

MLX is designed around Apple's unified memory, which makes it a natural fit for running models on a Mac. Other tools build on it too: LM Studio says it uses MLX under the hood. It only targets Apple hardware, so if you use Windows or Linux, look at llama.cpp, Ollama or vLLM instead.

Good for

  • Mac owners who want fast local text generation and a Python API
  • Fine-tuning small and medium models with LoRA on a Mac
  • Quantizing a model and sharing the result on the Hugging Face Hub

Watch out for

  • It runs on Apple silicon only
  • It is a package and command-line tool rather than a graphical app
  • Not every new model architecture is supported on day one

Links