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

  1. Install with Homebrew (or pip install macafm)

    brew install scouzi1966/afm/afm
  2. Start 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

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