CLI Tools2026年5月13日·1 分钟阅读

apfel — On-Device OpenAI-Compatible AI for macOS

apfel exposes Apple Foundation Models as a CLI and local OpenAI-compatible server (no API keys), with streaming, files, and tool calling on macOS 26+.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 94/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Cli
安装
Brew
信任
信任等级:Established
入口
brew install apfel
通用 CLI 安装命令
npx tokrepo install ba18be09-e80b-5803-989c-e8ffdd99386d

简介

apfel 把 Apple Foundation Models 暴露成 UNIX CLI 与本地 OpenAI 兼容服务,让你在本机 100% 离线/本地推理(无需 API key)。它支持工具调用与 4096 token 上下文,GitHub 已验证 5,329★。

最适合: 希望在 Mac 上获得本地 OpenAI 兼容后端(无需云端 key)的开发者与 agent 工具链

适配: macOS 26+ Apple Silicon;OpenAI SDK 可用 base_url;Shell 管道;文件附件提示

配置时间: 10–20 分钟

关键事实(已验证)

  • README 提供 apfel --serve:本地 OpenAI 兼容服务端点 http://localhost:11434/v1
  • 要求:macOS 26 Tahoe+、Apple Silicon(M1+)且已启用 Apple Intelligence。
  • README 徽章标注版本 1.3.3,并提到 4096 token 上下文。
  • GitHub:5,329 stars · 205 forks;最近更新 2026-05-12(GitHub API 验证)。

正文

apfel 有两种更“工程化”的用法:

1)脚本/终端 CLI:把输入输出放进管道里,用 -f 附件把文件内容塞进提示词,并用 JSON 输出方便自动化。 2)本地服务端:把任意 OpenAI 兼容 SDK/agent 的 base_url 指向 http://localhost:11434/v1,把提示与上下文留在本机。

建议先选一种路径接入你的工具链(CLI 或 server),再加一个最小健康检查(小提示词 + 快速返回),确保系统升级后能第一时间发现问题。

README 原文节选(verbatim)

apfel

The free AI already on your Mac.

Version 1.3.3 Swift 6.3+ macOS 26 Tahoe+ No Xcode Required License: MIT 100% On-Device Website #agentswelcome

Apple Silicon Macs ship a built-in LLM via Apple FoundationModels. apfel exposes it as a UNIX tool and a local OpenAI-compatible server. 100% on-device. No API keys, no cloud.

Mode Command What you get
UNIX tool apfel "prompt" / echo "text" | apfel Pipe-friendly answers, file attachments, JSON output, exit codes
OpenAI-compatible server apfel --serve Drop-in local http://localhost:11434/v1 backend for OpenAI SDKs

apfel --chat - interactive REPL.

Tool calling works in all contexts. 4096-token context.

apfel CLI

Requirements & Install

macOS 26 Tahoe+, Apple Silicon (M1+), Apple Intelligence enabled.

brew install apfel

Update:

brew upgrade apfel

Build from source (Command Line Tools with macOS 26.4 SDK / Swift 6.3, no Xcode):

git clone https://github.com/Arthur-Ficial/apfel.git && cd apfel && make install

Nix, same-day tap, Mint, mise, troubleshooting: docs/install.md.

🙏

来源与感谢

Source: https://github.com/Arthur-Ficial/apfel > License: MIT > GitHub stars: 5,329 · forks: 205

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产