Models + performance
Improves Qwen 3.8 Flash Next, GLM 5.3 Flash, and DeepSeek V4 Flash 0731 with MTP, execution optimizations, sparse verification, and bounded-memory fixes.
Mac only · Apple Silicon · native Swift
AFM is built exclusively for Apple Silicon Macs. It serves Hugging Face MLX models or Apple's on-device model on macOS, with the protocol details agent clients need: tools, structured output, streaming, cancellation, concurrency, and operational signals.
$ brew install scouzi1966/afm/afm
$ export MACAFM_MLX_MODEL_CACHE=~/.cache/afm
$ afm mlx -m Qwen3-0.6B-4bit -wServing is self-contained in one native executable. Model weights download on first use.
What's new
Expanded Qwen, GLM, and DeepSeek support; native checkpoint conversion; OpenAI Responses, Anthropic Messages, and image APIs; stronger cache and runtime reliability; an updated WebUI; and detailed cross-machine qualification evidence.
Open the release archive →Read the qualification report →Improves Qwen 3.8 Flash Next, GLM 5.3 Flash, and DeepSeek V4 Flash 0731 with MTP, execution optimizations, sparse verification, and bounded-memory fixes.
Adds Qwen Next conversion controls, mapped or resident n-gram storage, and safer storage preflight and resume handling.
Adds OpenAI Responses, Anthropic Messages and token counting, text completions, and image generation and editing for supported backends.
Improves prefix-cache validation, batch dispatch, capability reporting, assistant prefill, tool-call collection, rate limiting, and fatal startup errors.

What ships
AFM joins model execution, client compatibility, Apple frameworks, and observability in one process.
Choose a runtime
The runtimes are not interchangeable. Pick the one whose constraints match the work.
Compare in the guide →Open language and vision-language models, full sampling controls, agent tooling, KV controls, speculative decoding, and concurrency.
afm mlx -m <model>The system model with minimal setup and support for Apple .fmadapter LoRA adapters. The feature set differs from MLX.
afmA fixed-schedule Metal executor for compatible DeepSeek V4 GGUFs. AFM 0.9.16 resolves and resumes Hugging Face repository downloads directly.
afm mlx -m <owner/repo>Discover Ollama, LM Studio, Jan, and related local servers and expose their models through one list.
afm --gatewayHTTP surface
/v1/chat/completionsChat, SSE, tools, JSON schema, reasoning, logprobs
/v1/responsesResponses, previous-response chaining, tools, media
/v1/messagesAnthropic Messages compatibility and streaming
/v1/completionsRaw-prompt text completions on supported runtimes
/v1/images/generationsLocal image generation with supported FLUX models
/v1/images/editsLocal image editing from PNG, JPEG, or WebP input
Operational truths
Set the model cache explicitly. Use MACAFM_MLX_MODEL_CACHE to avoid the upstream default under ~/Documents, iCloud eviction, and TCC prompts.
Grammar enforcement is opt-in. JSON response modes and token-level xgrammar enforcement are different layers; start the server with --enable-grammar-constraints for the latter.
Speculative decode has a narrow fast path. MTP and EAGLE3 require specific checkpoints, greedy text-only requests, and serial execution. Ineligible requests fall back to ordinary decode.
Parser choice changes tool-call results. Native, repair, and raw modes are deliberate. Record the parser mode when comparing models.
Documentation