Back to directory

MLX Examples

A collection of standalone examples for Apple's MLX machine-learning framework, covering text, image, video, audio and multimodal models such as LLaMA, Mistral, Stable Diffusion, Whisper and CLIP.

MLX Examples

MLX Examples is a collection of standalone examples that use the MLX machine-learning framework for Apple silicon. The MNIST example is a starting point for learning MLX, and MLX LM is a more fully featured companion Python package for working with LLMs on MLX.

Text examples cover training a Transformer language model, large-scale text generation with LLaMA and Mistral, a Mixtral 8x7B mixture-of-experts model, parameter-efficient fine-tuning with LoRA or QLoRA, T5 for text-to-text tasks, and BERT for bidirectional language understanding. Other examples cover image generation with FLUX, Stable Diffusion or SDXL, image classification with ResNets, a convolutional variational autoencoder, text-to-video and image-to-video generation with Wan2.1, speech recognition with Whisper, audio compression and generation with EnCodec, music generation with MusicGen, joint text-image embeddings with CLIP, image-and-text generation with LLaVA, image segmentation with Segment Anything, semi-supervised learning on graphs with GCN, and a Real NVP normalizing flow.

Converted model checkpoints are available from the MLX Community organization on Hugging Face. It is written in Python under the MIT license.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.