This is an early release preview. You may encounter bugs.
Apfel logo
Unclaimed

Tool interface inference

Apfel

The free AI already on your Mac. CLI tool, OpenAI-compatible server, and interactive chat — all on-device via Apple Intelligence. No API key

A 83/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About Apfel.

Apfel exposes the language model built into Apple Silicon Macs (Apple FoundationModels, the model behind Apple Intelligence) as a UNIX command-line tool and as a local OpenAI-compatible server. Inference runs entirely on the device, with no API keys and no network calls. An interactive chat mode serves for testing prompts and MCP servers.

As a command-line tool it takes prompts as arguments or piped input, attaches files (text, PDFs, and images, with on-device OCR), streams output, and returns plain text, code only, JSON, or schema-valid JSON through guided generation. As a server it acts as a drop-in backend for OpenAI SDKs, supporting chat completions, the Responses API, streaming, tool calling, JSON schema output, and image input on macOS 27.

The on-device model has about 3 billion parameters and is not configurable. The context window covers input and output combined: 4096 tokens on macOS 26 and on M1/M2 Macs, and 8192 tokens on macOS 27 with an M3 or newer chip and 12 GB or more of memory. Embeddings and legacy text completions are not available, Apple's guardrails may block benign prompts (a permissive mode reduces false positives), and the model has no knowledge of the current date.

A family of companion projects builds on it, including a macOS chat client, clipboard and overlay utilities, MCP servers sized for the small context window, a TOML configuration wrapper, and a Swift package for tools that talk to the server.

  • UNIX tool: pipe-friendly answers with file attachments, JSON output, code-only output, and exit codes
  • OpenAI-compatible server: chat completions and the Responses API with streaming, tool calling, and JSON schema output
  • Guided generation: schema-conforming JSON output from a JSON Schema
  • MCP tools: attaches local or remote (Streamable HTTP) MCP servers in CLI, chat, and server modes
  • File extraction: PDFs and images are read on-device through text extraction and OCR
  • Token counting: preflights a prompt's token budget against the context window
  • Context strategies: chat history is trimmed automatically, with server extension fields to tune it
  • Server security: optional bearer token, origin checks, and opt-in CORS
  • Shell demos: bundled scripts such as English-to-shell-command translation and git summaries
  • Swift library: the core logic ships as the ApfelCore Swift package

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with Apfel.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Apfel →

Browse the catalog