Skip to content

Apple AFM-on-device demon service on macOS 26. Supports text generation, vision analysis (OCR, object detection), and multimodal chat capabilities.

Notifications You must be signed in to change notification settings

iqiancheng/afmd

Repository files navigation

afmd β€” Apple Foundation Model Daemon Service

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. menu bar icon preferences view

Usage

  1. Launch the app; look for the brain icon in the menu bar.
  2. Start/Stop the local server from the menu.
  3. 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)

Quick Start (Python)

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

Endpoints

  • GET /health β€” Health check
  • GET /status β€” Model status
  • GET /v1/models β€” List models
  • POST /v1/chat/completions β€” Chat completions (SSE supported with stream=true)
  • POST /v1/chat/completions/multimodal β€” Multimodal chat (text + images)
  • POST /v1/vision/ocr β€” Extract text from images
  • POST /v1/vision/detect β€” Detect objects in images
  • POST /v1/vision/analyze β€” Comprehensive image analysis

Example cURL

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!"}]
  }'

Acknowledgments

About

Apple AFM-on-device demon service on macOS 26. Supports text generation, vision analysis (OCR, object detection), and multimodal chat capabilities.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages