MLX Swift Examples
Example apps and code showing how to use MLX Swift.
View on GitHub ↗- Stars
- ★ 2,683
- Last commit
- 15 Jun 2026
- Maintenance
- Slowing
- Licence
- MIT
- Category
- On-device AI SDKs
- GitHub
- ml-explore/mlx-swift-examples
Overview
MLX Swift Examples is a collection of example programs built with MLX Swift. The language model examples use the models from MLX Swift LM, and there are also examples for general numerical computing. They run from Xcode or the command line.
Features
- MNISTTrainer trains a LeNet on iOS and macOS
- LLMBasic is a minimal chat example that loads a model and evaluates a prompt
- LLMEval downloads an LLM and tokeniser from Hugging Face and generates text
- Numerical computing examples with no ML model involved
Requirements
The source doesn't list any requirements, so check the project's own docs before you install.
Install
Clone the repo and run the applications or command line tools from Xcode or the terminal
Works with
Listed in
- github.com/ml-explore/mlx-swift-examples
- raw.githubusercontent.com/ml-explore/mlx-swift-examples/HEAD/README.md
Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.
More in this category
Argmax OSS Swift (WhisperKit)
Argmax's open-source on-device speech toolkit for Apple silicon, and the home of WhisperKit.
MLX Swift
Apple's Swift API for MLX, the array and machine-learning framework for Apple silicon.
CoreML-Models
Collection of models converted to Core ML packages, ready to use in iOS and macOS apps.