apfel
A command-line tool, OpenAI-compatible server, and chat REPL that expose the language model already built into Apple Intelligence on Apple Silicon Macs.
apfel wraps Apple's on-device FoundationModels framework as a Unix-style tool that reads a prompt as an argument or from a pipe, returning plain text, file attachments, JSON output, and standard exit codes, entirely on-device with no API key or cloud call. The same model can instead be served as a local OpenAI-compatible HTTP endpoint, letting existing OpenAI SDKs and tools such as chat clients point at it as if it were Ollama, and tool calling works in every mode.
Its context window is 4096 tokens on macOS 26 and 8192 tokens on macOS 27, read at runtime. A --chat mode provides an interactive REPL for testing prompts or MCP tool servers, and the server can run in the foreground or as a background service.
It requires an Apple Silicon Mac running macOS 26 or later with Apple Intelligence enabled, and is written in Swift under the MIT license.