Getting started

From installation to a useful local endpoint.

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 macafm

To 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/afm

3. Choose a runtime

RuntimeUse it forStart commandBoundary
MLXOpen models, VLMs, agent controls, tuningafm mlx -m <model>Weights download from Hugging Face or resolve locally.
Foundation ModelsApple's system model and .fmadapter LoRAafmSystem availability and supported OS determine capability.
DwarfStarCompatible fixed-schedule Metal checkpoints--mlx-runtime dwarfstarOnly checkpoints prepared for its layout contract.
GatewayOne model list for other local serversafm --gatewayExecution 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:  x

AFM 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-config

What 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 --vlm and pass media with --media.