This documentation is organized around decisions: which runtime to start, which protocol behavior to expect, and which performance features are actually eligible for your request.
Getting started
Install AFM, choose a runtime, make a request, and connect an existing OpenAI client.
WebUI
Browser chat, model routing, media attachments, the live metrics panel, security, and troubleshooting.
API contract
Compatibility boundaries, every request field, streaming lifecycle, errors, operations, OpenAPI, and agent-readable indexes.
Tool calling
Native model formats, repair mode, raw inspection, tool choice, and strict JSON output.
Parameter recipes
Composed startup flags and request parameters for agents, extraction, VLMs, throughput, profiling, and reproducibility.
Environment variables
Every runtime variable, exact accepted values, defaults, precedence, and unsafe benchmark controls.
Model architectures
Every accepted model_type, modality classification, normalized alias, and blocked architecture.
Apple-native APIs
Vision OCR, document tables, speech recognition, text-to-speech, and contextual embeddings.
Performance
Prefix reuse, concurrent decode, KV memory, speculative fast paths, and honest benchmark boundaries.
DwarfStar + DeepSeek V4
Runtime selection, executor conversion, exact checkpoint contract, DSpark, concurrency, and hard limitations.
Model storage
Where AFM looks for checkpoints, where downloads land, and how each cache variable behaves.
Swift package
The modular AFMKit products and how to depend on the narrowest library layer.
If you are trying to…
| Goal | Read first | Critical detail |
|---|---|---|
| Connect a coding agent | API contract | Start with /llms.txt or /openapi.json, then choose the tool parser deliberately. |
| Chat from a browser | WebUI | The interface reflects the selected backend; it does not make unsupported features available. |
| Choose a useful flag combination | Parameter recipes | Some flags compose; others silently change execution paths. |
| Configure paths or diagnostics | Environment variables | Operator settings and unstable benchmark switches are separate surfaces. |
| Check a checkpoint architecture | Model architectures | config.json.model_type is authoritative, not the repository name. |
| Build RAG locally | Apple-native embeddings | The multilingual model supports Latin-script languages. |
| Process invoices or PDFs | Vision OCR | Requests are bounded by size, page count, and pixel dimensions. |
| Improve repeated agent turns | Prefix caching | Stable prefixes help; changed prompt boundaries do not. |
| Run DeepSeek V4 on DwarfStar | DwarfStar + DeepSeek V4 | The executor requires a converted, aligned, self-contained local checkpoint. |
| Embed inference in a Mac app | Swift package | Import the narrowest AFMKit product you need. |