# 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 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.

Website: https://github.com/ml-explore/mlx-examples
