Apfel: Free CLI Tool to Access Apple's On-Device LLM on macOS

✍️ OpenClawRadar📅 Published: April 7, 2026🔗 Source
Apfel: Free CLI Tool to Access Apple's On-Device LLM on macOS
Ad

What Apfel Does

Apfel is a free tool that gives you direct access to the LLM Apple ships with macOS 26 (Tahoe) on Apple Silicon Macs. Apple normally restricts this model to Siri and system features, but Apfel exposes it through three interfaces: a UNIX command-line tool, an OpenAI-compatible HTTP server, and an interactive chat.

Technical Details

The tool is built in Swift 6.3 and wraps Apple's FoundationModels framework, specifically the LanguageModelSession API. All inference runs on the Neural Engine and GPU - no network calls, no cloud, and nothing leaves your machine.

Key specifications from the source:

  • Version: v0.6.13
  • Requirements: macOS 26+ (Tahoe), Apple Silicon, Apple Intelligence enabled
  • Context window: 4,096 tokens (input and output combined)
  • License: MIT
  • Installation: brew install Arthur-Ficial/tap/apfel

Three Usage Modes

1. CLI Tool

Pipe-friendly UNIX tool with stdin/stdout support, JSON output, file attachments, and proper exit codes:

$ apfel "What is the capital of Austria?"
The capital of Austria is Vienna.

$ apfel -o json "Translate to German: hello" | jq .content "Hallo"

2. OpenAI-Compatible Server

Drop-in replacement at localhost:11434 that works with any OpenAI SDK:

$ apfel --serve
Server running on http://127.0.0.1:11434

any OpenAI client works

$ curl localhost:11434/v1/chat/completions

Supports streaming (SSE), tool calling, CORS, response formats, temperature, max_tokens, and seed parameters.

3. Interactive Chat

Multi-turn conversations with automatic context management and five trimming strategies:

$ apfel --chat -s "You are a coding assistant"
Chat started. Type /quit to exit.
> How do I reverse a list in Python?
Ad

What Apfel Adds Over Apple's Raw API

  • Proper exit codes for shell scripting
  • JSON output format
  • File attachment support
  • Five context trimming strategies for the 4,096-token window
  • Real token counting via the SDK
  • Conversion of OpenAI tool schemas to Apple's native Transcript.ToolDefinition format

Included Power Tools

The demo/ folder includes several shell scripts:

  • cmd: Natural language to shell command conversion
  • oneliner: Generates pipe chains from plain English
  • mac-narrator: Narrates system activity like a nature documentary
  • explain: Explains commands, error messages, or code snippets
  • wtd: Instant project orientation for any codebase
  • gitsum: Summarizes recent git commits

Who This Is For

Developers who want to experiment with Apple's on-device LLM without writing Swift applications or paying for cloud API calls.

📖 Read the full source: HN AI Agents

Ad

👀 See Also

Bio-Inspired Memory System for Local LLMs: LTP and Selective Oblivion Implementation
Tools

Bio-Inspired Memory System for Local LLMs: LTP and Selective Oblivion Implementation

A developer built a local MCP server implementing bio-inspired memory mechanics including Long-Term Potentiation reinforcement, selective oblivion decay, and weekly consolidation cycles. The system uses hybrid search with sqlite-vec and text fallbacks, non-blocking architecture with asyncio executors, and maintains state via a persistent 'Soul' file.

OpenClawRadar
Lucas Gerads demonstrates MCP servers for oscilloscope and SPICE simulator integration with Claude Code
Tools

Lucas Gerads demonstrates MCP servers for oscilloscope and SPICE simulator integration with Claude Code

Lucas Gerads built MCP servers for his LeCroy oscilloscope and SPICE simulator, enabling Claude Code to validate SPICE circuits and models, handle embedded programming, and automate data analysis tasks like time axis normalization and data alignment.

OpenClawRadar
Pilot Protocol: A P2P Network Stack for AI Agents Built with Claude
Tools

Pilot Protocol: A P2P Network Stack for AI Agents Built with Claude

A developer built Pilot Protocol, a pure user-space peer-to-peer virtual network stack in Go specifically for autonomous AI agents, enabling direct communication without centralized infrastructure. The protocol uses UDP multiplexing, NAT traversal, and end-to-end encryption, with benchmarks showing 89 MB/s local throughput and 2.1 MB/s cross-continent WAN throughput.

OpenClawRadar
PeaDB: Redis-Compatible Database Coded with AI Assistants in C++20
Tools

PeaDB: Redis-Compatible Database Coded with AI Assistants in C++20

A developer created PeaDB, a Redis 7.2.5 drop-in replacement written in C++20 using Codex, Copilot, and Claude, implementing ~147 commands with persistence, replication, and cluster support. Benchmarks show performance close to Redis.

OpenClawRadar