Back to directory

MLX Swift

A Swift API for the MLX array framework, letting machine learning research and inference run natively on Apple silicon from Swift, with example apps for chat, text generation and Stable Diffusion image generation.

MLX Swift

MLX Swift is a Swift-language API for MLX, an array framework for machine learning built for Apple silicon. It brings MLX's research and experimentation workflow to Swift developers building iOS and macOS applications, rather than only Python.

Example projects distributed alongside it include an MNIST digit classifier that trains a LeNet model on-device, a chat application supporting both language and vision-language models, a command-line and app-based tool that downloads a large language model and tokenizer from Hugging Face and generates text from a prompt, and an example that downloads a Stable Diffusion model from Hugging Face to generate images; language model implementations specifically live in a companion mlx-swift-lm package.

It installs through Xcode or Swift Package Manager, with a separate CMake-based build that supports native Linux builds. The core MLX framework is written in C++ and released under the MIT license.

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.