A lightweight Swift daemon that exposes Apple’s on-device LLM through a simple local HTTP endpoint.
It listens on port 5454 and accepts JSON requests with a text prompt.
Built with Network and FoundationModels.
This project runs a minimal TCP server to bridge your applications with Apple’s native LLM (LanguageModelSession).
It converts plain HTTP JSON requests into model responses, enabling easy local AI integration.
- Uses Apple’s built-in
LanguageModelSessionAPI. - Runs locally, no cloud or API key required.
- Lightweight single-file daemon.
- JSON-based request/response format.
Send a simple POST request to the daemon:
POST / HTTP/1.1
Host: 127.0.0.1:5454
Content-Type: application/json
{"prompt": "Explain quantum computing in simple terms."}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{"text": "Quantum computing uses qubits that can represent multiple states at once..."}
- Clone the repository:
git clone git@github.com:qvanderlaan/apple-llm-daemon.git
cd apple-llm-daemon
- Build and run:
swift run
- The daemon will start at:
http://127.0.0.1:5454
- Requires macOS 26+ (Tahoe or later).
- Swift 6.2 or newer.
- Uses
FoundationModelsandNetworkframeworks.
MIT License. See LICENSE for details.