Note
This was made with Claude Code and Opus 4.8.
Apple's on-device Foundation Models from the command line. Small, fast, no API key, no network.
Inspired by llm. Requires macOS 26 with Apple Intelligence enabled.
brew install statico/tap/llmacOr from source: swift build -c release, then copy .build/release/llmac onto your PATH.
llmac "why is the sky blue"
cat error.log | llmac "what went wrong here"
llmac -c "and how do I fix it" # continue the last conversation
llmac -x "a bash one-liner to list files by size" # extract code from fences
llmac -p "summarize this" # append clipboard contentsPrompts come from the argument, from piped stdin, or from the clipboard with -p. When both an
argument and stdin are present, stdin is appended as context.
| command | |
|---|---|
llmac PROMPT |
run a prompt |
llmac chat |
REPL (.new, .id, .exit) |
llmac models |
list model configurations |
llmac logs |
list stored conversations; --show prints one |
llmac ocr [FILE] |
recognize text in an image; reads the clipboard if no file |
llmac serve |
OpenAI-compatible API on localhost |
llmac shell-init zsh|fish |
print shell helpers |
Conversations live in ~/.llmac/conversations (override with $LLMAC_HOME).
eval "$(llmac shell-init zsh)" # zsh
llmac shell-init fish | source # fishDefines ask (answer a question, rendered with glow when present) and cmd (produce a shell
command and load it into your prompt buffer without running it).
ask "what does chmod 755 mean"
cmd "list subprocesses of pid 1234"llmac serve --port 8080Implements GET /v1/models and POST /v1/chat/completions, streaming and non-streaming. Binds to
127.0.0.1. There is no authentication — don't expose it to a network you don't control.
The model itself cannot accept images until macOS 27, so rather than a fake -a flag, OCR is a
separate command that composes through a pipe:
llmac ocr # whatever image is on the clipboard
llmac ocr shot.png
llmac ocr | llmac "summarize this"Uses Vision text recognition, not the model.
- Context is 4096 tokens, input and output combined. Resumed conversations are trimmed oldest-first, always keeping the system prompt.
- Four "models", one engine. Apple exposes a single on-device model with no enumeration API. The four entries are its distinct useCase × guardrails configurations.
- No embeddings. Apple's two on-device text embedding APIs are both unusable here:
NLContextualEmbeddingfails to load outside an app bundle ("Embedding model requires compilation"), andNLEmbedding.sentenceEmbeddingranks lexical distractors above correct answers and scores negations and antonyms above true paraphrases. FoundationModels exposes no embedding API at all. Useswift-embeddingsif you need real ones. - Images, tool calling, structured output schemas, and Private Cloud Compute are out of scope.
Apple ships an official fm CLI with macOS 27. apfel
is a larger, more featureful third-party CLI. llmac is deliberately smaller, and keeps
conversation state on disk so -c and logs just work.
MIT