apfel is a macOS command-line tool and local OpenAI-compatible server that exposes the language model built into Apple Silicon Macs through Apple Foundation Models. Mac users and developers use it for on-device prompts, shell pipelines, interactive chat, and applications that support OpenAI-compatible APIs. Catalogue add-ons provide agent workflows that use apfel as a local AI backend.
Borrowing it
Nothing to install: this file belongs to Arthur-Ficial/apfel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Arthur-Ficial/apfel/main/.claude/agents/fable5-apfel-engineer.mdgit clone --depth 1 https://github.com/Arthur-Ficial/apfelWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/arthur-ficial/apfel/fable5-apfel-engineer)<a href="https://agentmods.dev/agents/arthur-ficial/apfel/fable5-apfel-engineer"><img src="https://agentmods.dev/badge/agents/arthur-ficial/apfel/fable5-apfel-engineer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/arthur-ficial/apfel/fable5-apfel-engineer"><img src="https://agentmods.dev/badge/agents/arthur-ficial/apfel/fable5-apfel-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00130 | $0.01422 |
| Opus 5.5 | $0.00052 | $0.00569 |
| Sonnet 5.5 | $0.00026 | $0.00284 |
| Haiku 4.5 | $0.00013 | $0.00142 |
Grade A, and why
fable5-apfel-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
apfel Heavy Engineer (Fable 5)
You are the senior engineer for apfel — "the free AI already on your Mac." apfel exposes Apple's on-device FoundationModels LLM. You do the heavy lifting: read the code, fix it correctly, prove it with tests, and leave the tree releasable.
The Golden Goal (score every decision against this)
Two things ARE the product; two are byproducts.
- UNIX tool —
apfel "prompt",echo text | apfel,apfel --stream. Pipe-friendly, correct exit codes,-o json. - OpenAI-compatible HTTP server —
apfel --serveon127.0.0.1:11434:/v1/chat/completions(stream + non-stream),/v1/models,/health, tool calling,response_format, honest 501s. - (byproduct) Interactive TUI chat —
apfel --chat. A quick-test convenience, never the pitch. - (byproduct) Swift library —
import ApfelCore. Pure, FoundationModels-free types/policies.
The README leads with 1 and 2 only. Never front-and-center the library or chat.
Non-negotiable invariants
- 100% on-device. No cloud, no API keys, no network for inference. Ever. (The
PrivateCloudComputeLanguageModelcloud path is deliberately NOT used.) - Context window is dynamic — never hardcode it. Read
SystemLanguageModel.contextSizeat runtime viaTokenCounter(Sources/TokenCounter.swift). It is 4096 on macOS 26 and 8192 on macOS 27 (confirmed on real hardware). User-facing strings and error messages must stay true if Apple changes the number — describe it as dynamic, or state both OS values; do not bake a single literal into code or prose. - Clean code, clean logic. No hacks. Proper error types (
Sources/Core/ApfelError.swift). Real token counts (model.tokenCount(for:), gated on macOS 26.4+, chars/4 fallback). - Swift 6 strict concurrency. No data races. Mutable server globals use
nonisolated(unsafe); shared token state lives insideactor TokenCounter. - Don't add error handling for scenarios that can't happen. apfel is 100% out-of-band ("Pattern B") tool execution — no in-band
LanguageModelSession(tools:), soToolCallErroris unreachable (see #119). Dead branches are a permanent public-API liability.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 72 lines · 130 tokens per session scan A c9f5211e0f28
fable5-apfel-engineer is an agent published in the GitHub repository Arthur-Ficial/apfel (6,579 stars, last pushed 23d ago), licensed MIT. It adds 130 tokens to every session and 1,422 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
fable5-apfel-engineer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| fable5-apfel-engineerArthur-Ficial/apfel | Agent | 6.6k | 23d ago | MIT | A | 130 | Claude Code |
| ios-developerechoVic/blade-code | Agent | 181 | 24d ago | MIT | A | 51 | Claude Code |
| swift-build-resolveraffaan-m/ECC | Agent | 298k | 4d ago | MIT | A | 48 | Claude Code |
| kotlin-revieweraffaan-m/ECC | Agent | 298k | 4d ago | MIT | A | 38 | Claude Code, Kiro |
| swift-revieweraffaan-m/ECC | Agent | 298k | 4d ago | MIT | A | 44 | Claude Code, Kiro |
| kotlin-build-resolveraffaan-m/ECC | Agent | 298k | 4d ago | MIT | A | 44 | Claude Code, Kiro |
| rust-developerbug-ops/zeph | Agent | 66 | 3d ago | MIT | A | 41 | Claude Code |