Skip to content

qvanderlaan/apple-llm-daemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apple-llm-daemon

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.


🧠 Overview

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.


🚀 Features

  • Uses Apple’s built-in LanguageModelSession API.
  • Runs locally, no cloud or API key required.
  • Lightweight single-file daemon.
  • JSON-based request/response format.

🧩 Example Request

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..."}

🛠️ Build & Run

  1. Clone the repository:
git clone git@github.com:qvanderlaan/apple-llm-daemon.git
cd apple-llm-daemon
  1. Build and run:
swift run
  1. The daemon will start at:

http://127.0.0.1:5454


🧪 Development Notes

  • Requires macOS 26+ (Tahoe or later).
  • Swift 6.2 or newer.
  • Uses FoundationModels and Network frameworks.

📄 License

MIT License. See LICENSE for details.

About

Lightweight Swift daemon for accessing Apple’s local LLM via a simple HTTP interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages