A lightweight macOS menu bar service that exposes an OpenAI-compatible API using Apple's on-device Foundation Models. It runs headlessly (no Dock icon), controlled from the menu bar. Supports text generation, vision analysis (OCR, object detection), and multimodal chat capabilities.

- Launch the app; look for the brain icon in the menu bar.
- Start/Stop the local server from the menu.
- Use the menu to copy:
- Base URL (e.g.
http://127.0.0.1:11535/v1) - Chat Completions endpoint (e.g.
/v1/chat/completions) - Model name (
AFM-on-device)
- Base URL (e.g.
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:11535/v1",
api_key="not-needed"
)
resp = client.chat.completions.create(
model="AFM-on-device",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)π For detailed examples including multimodal chat, vision APIs, and more β Usage Guide
GET /healthβ Health checkGET /statusβ Model statusGET /v1/modelsβ List modelsPOST /v1/chat/completionsβ Chat completions (SSE supported withstream=true)POST /v1/chat/completions/multimodalβ Multimodal chat (text + images)POST /v1/vision/ocrβ Extract text from imagesPOST /v1/vision/detectβ Detect objects in imagesPOST /v1/vision/analyzeβ Comprehensive image analysis
curl -X POST "http://127.0.0.1:11535/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "AFM-on-device",
"messages": [{"role": "user", "content": "Hello!"}]
}'- Apple Foundation Models Apple's on-device Foundation Models
- apple-on-device-openai a local API server for macOS 26.0 or later
- maclocal-api another local API server for macOS 26.0 or later
- enableAppleAI Enable Apple Intelligence on your device