Back to directory

MLX Swift Examples

A collection of example iOS and macOS applications and command-line tools built with MLX Swift, showing how to train and run language models, vision-language models and other machine learning workloads on Apple hardware.

MLX Swift Examples

This repository holds runnable examples for MLX Swift, Apple's array framework for machine learning. Examples include an MNIST digit trainer, a minimal LLM chat app, an LLM evaluator that downloads a model and tokenizer from Hugging Face and reports run statistics, a chat app supporting both language and vision-language models, and a LoRA fine-tuning example.

Command-line tools generate text from language models, generate images from a Stable Diffusion model, and train a LeNet model on MNIST, all downloaded from Hugging Face. Other examples apply MLX's array operations, compilation, and custom Metal kernels to general numerical problems such as curve fitting, heat diffusion, and Mandelbrot set rendering.

The reusable model libraries used by several of these examples have moved to a separate repository; this one keeps the example applications themselves.

More in Inference

See all 770
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • Lifeboat

    iterate.ai

    A local inference server that puts an OpenAI- and Anthropic-compatible API in front of open-weight language models running on hardware you control, from a laptop to a GPU cluster.

  • Claude S40

    github.com

    An unofficial Claude chat client for 2007-era Nokia Series 40 phones, built as a Java ME app plus a small Go relay server, with web search, reading mode and saved chats.