ml-explore/mlx-swift-examples

Examples using MLX Swift

What it solves

This repository provides a collection of practical examples and reusable libraries for developers using MLX Swift, allowing them to see how to implement AI models and numerical computing tasks on Apple silicon. It bridges the gap between the raw MLX Swift framework and building actual applications on iOS and macOS.

How it works

The project organizes examples into three main categories: AI applications (like chat apps and image generators), command-line tools for quick testing, and numerical computing simulations. It leverages the mlx-swift-lm library for language models and provides its own implementations for Stable Diffusion and MNIST.

Who it’s for

Swift developers who want to build AI-powered applications for Apple platforms (iOS and macOS) using the MLX framework.

Highlights

  • Diverse AI Examples: Includes implementations for LLMs, VLMs, and Stable Diffusion for image generation.
  • Cross-Platform: Many examples run on both iOS and macOS.
  • Fine-Tuning: Includes a LoRA training example for fine-tuning LLMs on macOS.
  • Numerical Computing: Demonstrates general numerical tasks like heat diffusion and Mandelbrot set rendering using custom Metal kernels.
  • Ready-to-Use Tools: Provides CLI tools for text and image generation to quickly test models from Hugging Face.

Related

  • Project
  • Project
  • Project
  • Project
  • Project