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 down
What is 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.
Overview of apfel
What it is
apfel is a command-line tool that exposes the built-in large language model (LLM) on Apple Silicon Macs, powered by Apple FoundationModels via Apple Intelligence. It operates entirely on-device, requiring no API keys, cloud connectivity, or additional downloads. apfel provides three modes: a UNIX pipe-friendly tool, an OpenAI-compatible local server, and an interactive chat REPL.
Key features
- UNIX tool mode: accepts prompts via arguments or piped input, supports file attachments (text, PDF, images), JSON output, exit codes, and schema-valid guided generation.
- OpenAI-compatible server: runs at
http://localhost:11434/v1and supports chat completions (streaming and non-streaming), Responses API, model listing, and health endpoint. - Interactive chat REPL:
apfel --chatfor quick prompt testing and MCP server interaction. - Tool calling: works in all contexts (UNIX tool, server, chat) and supports Model Context Protocol (MCP) servers (local scripts and remote Streamable HTTP).
- Demos: bundled executable shell scripts (e.g.,
cmd,oneliner) that wrap apfel for common tasks; extracted viaapfel demos. - Schema-valid JSON output: use
--schemato enforce a JSON Schema on the model's output. - Token counting:
--count-tokenspreflight token budget estimation.
Use cases
- Scripting and automation: pipe data into apfel for summarization, translation, code generation, or diff review.
- Local AI backend: replace cloud APIs with a local OpenAI-compatible server for applications using the OpenAI SDK.
- Interactive exploration: use
apfel --chatto test prompts or MCP tools. - File analysis: attach PDFs, images, or text files for on-device OCR, text extraction, and content understanding.
- Code generation:
apfel --codeoutputs only code without prose, suitable for piping to files or clipboard.
Getting started
Install via Homebrew: bash brew install apfel Or build from source (requires macOS 26.4 SDK / Swift 6.3): bash git clone https://github.com/Arthur-Ficial/apfel.git && cd apfel && make install Quick start: bash apfel 'Hello, Mac!' apfel --serve curl http://localhost:11434/v1/chat/completions -H 'Content-Type: application/json' -d '{}'
License and pricing
License: MIT. Pricing: open source (free).
Based on the project's public README and repository metadata.