apfel is a command-line interface and local server that exposes Apple's built-in on-device language model to developers and users.
The tool solves the problem of accessing AI capabilities without relying on cloud services or API keys. It works by wrapping Apple's FoundationModels framework, which ships with Apple Silicon Macs running macOS 26 or later with Apple Intelligence enabled. The model runs entirely on-device, offering three interaction modes: a UNIX command-line tool for piping text and files, an OpenAI-compatible HTTP server at localhost:11434/v1 for drop-in integration with existing SDKs, and an interactive REPL chat mode. Tool calling is supported across all modes, and the tool handles context automatically, trimming it to fit the on-device window of 4096 tokens on macOS 26 or 8192 tokens on macOS 27.
Adoption makes sense for developers building on Apple Silicon Macs who want to avoid cloud dependencies, API costs, and key management. It suits projects that need local inference, shell script integration, or a lightweight backend for OpenAI-compatible clients. The tool includes bundled demo scripts covering common tasks like command generation and code explanation, and supports Model Context Protocol servers for extending functionality with external tools, including a built-in calculator. For teams needing configuration management across multiple MCPs or profiles, the separate apfel-run wrapper adds TOML-based config without modifying apfel itself.
Development shows consistent refinement of core functionality. The project maintains clear separation between the base tool and optional layers like configuration management. Documentation is organized into focused guides covering installation methods, background service setup, context strategies, MCP integration, and demo walkthroughs. The tool's design emphasizes UNIX philosophy—flags and environment variables for configuration, no built-in config files—keeping the core lightweight while allowing extensibility through external tools.