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

  1. Clone the repo and run the applications or command line tools from Xcode or the terminal

Works with

Not stated by the source

Listed in

GitHub search

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