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/v1 and supports chat completions (streaming and non-streaming), Responses API, model listing, and health endpoint.
  • Interactive chat REPL: apfel --chat for 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 via apfel demos.
  • Schema-valid JSON output: use --schema to enforce a JSON Schema on the model's output.
  • Token counting: --count-tokens preflight 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 --chat to 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 --code outputs 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.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/arthur-ficialapfel.svg)](https://yunodb.com/tools/arthur-ficialapfel?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/arthur-ficialapfel?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/arthur-ficialapfel.svg" alt="Featured on YunoDB" height="20"></a>