Examples in the MLX framework
This repo contains a variety of standalone examples using the MLX framework.
The MNIST example is a good starting point to learn how to use MLX. Some more useful examples are listed below. Check-out MLX LM for a more fully featured Python package for LLMs with MLX.
You can directly use or download converted checkpoints from the MLX Community organization on Hugging Face. We encourage you to join the community and contribute new models.
We are grateful for all of our contributors. If you contribute to MLX Examples and wish to be acknowledged, please add your name to the list in your pull request.
The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX Examples useful in your research and wish to cite it, please use the following BibTex entry:
@software{mlx2023,
author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
url = {https://github.com/ml-explore},
version = {0.0},
year = {2023},
}Contribute Hugging Face models to the MLX Community
segment_anything: fuse attention with mx.fast.scaled_dot_product_attention
Community project: Depth-Anything-V2 running via a from-scratch PyTorch-API shim (torch-mlx)
Proposal: neural surface-code decoder (QEC) example?
Suggestion: add a Stable Fast 3D (SF3D) example — native MLX single-image-to-3D-mesh
[whisper] `mlx_whisper` CLI overwrites output file when multiple audio inputs are provided
whisper: numerical parity tests fail with MLX 0.32.0 on Apple Silicon
whisper/convert.py outputs `model.safetensors` but `mlx_whisper.load_models` expects `weights.safetensors`
mlx_lm.fuse can not work
Stable Diffusion: Transformer2D's GroupNorm uses MLX's default eps (1e-5) where diffusers uses 1e-6