apfel - Free AI on Your Mac
Key insight: Every Apple Silicon Mac with macOS 26 (Tahoe) ships with a built-in LLM. apfel unlocks it as a CLI tool, OpenAI-compatible server, and chat interface.
Why this matters
- 100% On-Device: Every token generated locally on Apple Silicon. Nothing leaves your machine.
- Zero Cost: No API keys, no subscriptions, no per-token billing.
- OpenAI Compatible: Drop-in replacement at localhost:11434.
Technical Details
- Context window: 4,096 tokens (input + output combined)
- Model: Apple's on-device LLM (shipped with macOS)
- SDK: FoundationModels.framework (Swift API)
- Hardware: Apple Silicon (Neural Engine + GPU)
What apfel adds
apfel wraps LanguageModelSession and exposes it three ways:
- UNIX command-line tool with stdin/stdout
- OpenAI-compatible HTTP server (built on Hummingbird)
- Interactive chat with context management
Installation
# Via Homebrew (recommended)
$ brew install Arthur-Ficial/tap/apfel
$ apfel "Hello, Mac!"
# Or build from source
$ git clone https://github.com/Arthur-Ficial/apfel.git
$ cd apfel && make install
Features
- cmd: Natural language to shell command
- oneliner: Pipe chains from plain English (awk, sed, sort, uniq)
- mac-narrator: Narrates Mac system activity like a nature documentary
- explain: Explain any command or code snippet
- wtd: What's this directory? Instant project orientation
- gitsum: Summarize recent git commits
OpenAI API Compatibility
- ✓ POST /v1/chat/completions
- ✓ Streaming (SSE)
- ✓ Tool calling / function calling
- ✓ GET /v1/models
- ✓ response_format: json_object
- ✓ temperature, max_tokens, seed
- ✓ CORS for browser clients
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1",
api_key="unused" # no auth needed
)
resp = client.chat.completions.create(
model="apple-foundationmodel",
messages=[{"role": "user", "content": "What is 1+1?"}],
)
print(resp.choices[0].message.content)