IntelliBridge: Authenticated, On‑Device Apple Intelligence via an OpenAI‑Compatible API

For years I’ve wanted a secure, local way to use AI across my own projects—without sending data to the cloud. With Apple Intelligence’s on‑device Foundation Models, that door finally opened. IntelliBridge is my most exciting build yet: an authenticated, OpenAI‑compatible web API that runs on my machine and powers my portfolio site and other apps.
The Problem
Developers who want private, on‑device AI hit the same roadblocks:
- Popular SDKs expect cloud endpoints and API keys.
- On‑device models aren’t exposed through familiar, unified routes.
- Auth is often bolted on, leaving multi‑app setups brittle.
I needed a trusted gateway to local models that I could reuse across my portfolio and internal tools—without rewriting clients.
The Solution: An Authenticated OpenAI‑Style Gateway
IntelliBridge provides a clean HTTP interface to Apple’s on‑device Foundation Models, with built‑in authentication. Because it mirrors OpenAI/OpenRouter endpoints, existing client libraries work out of the box.
What It Offers
- OpenAI‑compatible endpoints: Chat and non‑chat completions with streaming.
- Authentication first: Token‑based access for users/apps with scoped permissions.
- Multiple models:
base(default guardrails) andpermissive(relaxed filtering). - Structured outputs & tool calling: For richer, automatable workflows.
- Runs on‑device: Local inference for privacy and speed—no external cloud.
How It Works
Under the hood, IntelliBridge is built with Swift and Vapor, interfacing with Apple’s Foundation Models.
- Auth Layer: Issue and validate tokens; enforce scopes per route.
- Model Sessions: Manage conversational context and single‑prompt completions.
- Routes that feel familiar:
/chat/completions,/completions, plus streaming via SSE. - Streaming: Tokens stream in real time for responsive UIs.
- Policy Selection: Choose
baseorpermissiveper request.
Example Usage
Using cURL (chat):
curl http://localhost:8080/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "base",
"messages": [
{"role": "user", "content": "Summarize the benefits of on-device AI."}
]
}'
Streaming:
curl http://localhost:8080/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "permissive",
"messages": [
{"role": "user", "content": "Write a short, cozy bedtime story about a curious robot."}
],
"stream": true
}'
The Outcome
With IntelliBridge, I can plug my portfolio website and other apps into local, authenticated AI—no cloud, no custom client glue. It’s fast, private, and familiar to integrate. Most importantly, it opens new avenues for building AI‑powered features entirely on my own machine.
If you’ve wanted trustworthy, on‑device AI with production‑grade auth and OpenAI‑style ergonomics, IntelliBridge makes it practical—and fun—to ship.