maclocal-api (afm)
The 'afm' CLI and local server that exposes Apple's Foundation Models (and MLX models) through an API.
View on GitHub ↗- Stars
- ★ 347
- Last commit
- 5 Oct 2026
- Maintenance
- Active
- Licence
- MIT
- Category
- Other
- GitHub
- scouzi1966/maclocal-api
Overview
AFM turns an Apple silicon Mac into a private, OpenAI-compatible AI server. It runs Hugging Face MLX models or Apple's on-device Foundation Model, so you can connect the clients and SDKs you already use without a cloud account or API key. It is a native Swift executable and is built with multi-turn, tool-using agents in mind.
Features
- Chat, streaming, tools, structured output, reasoning and logprobs
- OpenAI Responses and Anthropic Messages compatibility
- MLX runtime for open models and VLMs, plus Apple Foundation Models with .fmadapter adapters
- Gateway mode that combines Ollama, LM Studio, Jan and other local servers into one model list
- Web UI and a full-screen terminal chat (--tui)
- Built-in evaluation suites for local models
Requirements
- An Apple silicon Mac
- macOS 26 or later
- MLX model weights download from Hugging Face on first use
Install
Install with Homebrew (or pip install macafm)
brew install scouzi1966/afm/afmStart a small MLX model and open the Web UI
afm mlx -m Qwen3-0.6B-4bit -w
Example
Run afm --tui for a private terminal chat with Apple's on-device model.
Works with
Listed in
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
apfel
Command-line tool, chat mode and local OpenAI-compatible server for the on-device model in Apple's FoundationModels framework. Needs macOS 26 and Apple silicon.
MCP Swift SDK
The official Swift SDK for building MCP clients and servers.
iCTRL
Runs a long-lived XCUITest on a real iPhone and exposes an HTTP API so agents can tap, type, read the UI and take screenshots. Meant for testing on your own devices.