AFM is a native executable for Apple Silicon. The shortest path is Homebrew and a small MLX checkpoint that verifies the complete request path.
Requirements
- Apple Silicon Mac.
- macOS 26 or newer for the complete feature set.
- Xcode 27 for development builds.
- Enough disk and unified memory for the checkpoint you choose.
1. Install
brew install scouzi1966/afm/afm
# Nightly builds
brew install scouzi1966/afm/afm-next
# Python packaging is also available; serving remains native
pip install macafmTo build from source, clone the repository and run ./build.sh. The script initializes submodules, applies AFM-owned vendor patches, builds WebUI assets and Metal resources, then creates the release executable.
2. Choose model storage
# Standard Hugging Face download cache
export HF_HUB_CACHE=~/.cache/huggingface/hub
# Optional read-only lookup root for your curated side-loaded models
export MACAFM_MLX_MODEL_CACHE=/Volumes/Models/afm3. Choose a runtime
| Runtime | Use it for | Start command | Boundary |
|---|---|---|---|
| MLX | Open models, VLMs, agent controls, tuning | afm mlx -m <model> | Weights download from Hugging Face or resolve locally. |
| Foundation Models | Apple's system model and .fmadapter LoRA | afm | System availability and supported OS determine capability. |
| DwarfStar | Compatible fixed-schedule Metal checkpoints | --mlx-runtime dwarfstar | Only checkpoints prepared for its layout contract. |
| Gateway | One model list for other local servers | afm --gateway | Execution stays in Ollama, LM Studio, Jan, or the discovered backend. |
Unqualified model IDs default to the mlx-community organization. For example, Qwen3-0.6B-4bit and mlx-community/Qwen3-0.6B-4bit resolve to the same repository.
4. Start a small model
afm mlx -m Qwen3-0.6B-4bit -w-w opens the built-in WebUI. The API listens at http://127.0.0.1:9999/v1. See the WebUI guide for attachments, model routing, metrics, and limitations.
5. Make a request
curl http://127.0.0.1:9999/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen3-0.6B-4bit",
"messages": [{"role":"user","content":"Explain unified memory briefly."}],
"stream": false
}'6. Connect a client
Most OpenAI-compatible clients need only these values:
Base URL: http://127.0.0.1:9999/v1
API key: xAFM does not gate localhost access on an API key; use a placeholder where a client requires one. Copy-ready source guides exist for OpenCode, OpenClaw, Cline, Continue, Aider, Cursor, and Hermes.
# Generate an OpenClaw provider block with detected capabilities
afm mlx -m Qwen3-Coder-Next-4bit --openclaw-configWhat to configure next
- For long, stable agent prompts: add
--enable-prefix-caching. - For multiple client sessions: add
--concurrent N. - For strict token-level JSON: add
--enable-grammar-constraints. - For a VLM: add
--vlmand pass media with--media.