Arthur-Ficial/apfel
The free AI already on your Mac. CLI tool, OpenAI-compatible server, and interactive chat — all on-device via Apple Intelligence. No API keys, no cloud, no downloads.
What it solves
apfel provides a way to access the built-in Large Language Model (LLM) that ships with Apple Silicon Macs via Apple FoundationModels. It transforms this on-device model into a usable UNIX tool and a local OpenAI-compatible server, allowing users to avoid API keys, cloud dependencies, and costs while keeping all data 100% on-device.
How it works
The project acts as a bridge to FoundationModels.SystemLanguageModel. It offers three primary interfaces:
- UNIX Tool: A command-line interface (CLI) that supports piping input, attaching files (including PDFs and images via on-device OCR/extraction), and generating JSON or code-only output.
- OpenAI-compatible Server: A local HTTP server (
http://localhost:11434/v1) that allows existing OpenAI SDKs and tools to use the on-device Apple model as a backend. - Interactive REPL: A chat mode (
apfel --chat) for testing prompts and tools.
It also supports the Model Context Protocol (MCP) to allow the LLM to discover and invoke external tools (local or remote).
Who it’s for
Developers and power users on macOS 26 Tahoe+ with Apple Silicon (M1+) who want to run AI locally, integrate AI into shell scripts, or replace cloud-based LLM APIs with a free, private on-device alternative.
Highlights
- 100% On-Device: No cloud, no API keys, and complete privacy.
- OpenAI API Compatibility: Drop-in replacement for OpenAI SDKs via a local server.
- MCP Tool Support: Integration with Model Context Protocol servers for extended capabilities.
- File Integration: Native support for attaching PDFs, images, and text files to prompts.
- JSON/Schema Guided Generation: Guaranteed schema-valid JSON output for scripting.
- Pipe-friendly: Designed for UNIX philosophy, supporting streaming and piped input/output.