Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftLMAPP

Local LLM chat manager for Apple Silicon — menu-bar app + browser UI, powered by the SwiftLM inference core.

SwiftLMAPP runs large language models fully on your Mac using the SwiftLM engine (a separate, independent backend from MLX / mlx-vlm). It lives in the menu bar, serves a chat web UI on http://127.0.0.1:5414, and opens it in your browser with one click — no native window, no cloud, no API keys. Install models, chat with streaming output, and manage the engine, all from the browser.

This app uses the SwiftLM inference core. A separate app, MLXAPP, ships a different backend (mlx-vlm / MLX) in its own repository — the two cores are intentionally kept apart so they never get confused.

Badges

License: MIT Platform Language Engine PRs Welcome

Features

  • 🍎 Pure local inference — runs on Apple Silicon via the SwiftLM engine, no GPU cloud, no API key.
  • 🧠 Menu-bar only — no native window; everything (chat, models, engine, settings) happens in the browser UI.
  • 🌐 One-click open — the menu item opens http://127.0.0.1:5414 in your default browser.
  • 🧩 Model hub — search & install models, switch models with one click (server restarts automatically).
  • Streaming chat — token-by-token output with live stats.
  • 🔧 Launch safety — kills orphan SwiftLM processes holding the engine port before starting, so you never get stuck on "Starting…".
  • 📦 Engine install — locates or installs the SwiftLM binary under ~/.swiftlm/.

Quick Start

  1. Build & run: ./build_app.sh then open build/SwiftLMAPP.app.
  2. The app lives in the menu bar. Click Open Chat in Browser to open the web UI.
  3. First time: open Settings → Engine to locate / install SwiftLM (~/.swiftlm/SwiftLM).
  4. In Settings → Models, install a model, then click Use.
  5. Start chatting.

Web UI

  • Left sidebar — collapse button, New Session, saved sessions (localStorage), Settings.
  • Chat area — model picker, token counter, server status pill, streaming message list, file attachments (.txt/.md/.json/.csv/.log), Enter to send / Shift+Enter for newline.
  • Settings panel — General (runtime info, system prompt, expose to network, auto-start), Models, Engine, API reference.

Architecture

SwiftLMBuddy         AppKit menu-bar app: keeps the SwiftLM engine alive and opens
                      the web UI in the browser. No native window.
SwiftLMBuddyCore     SwiftLM process management, health polling, OpenAI-compatible
                      client, and the local web server (page + JSON API).
WebUI/chat.html      Chat page shell (links chat.css + chat.js).
WebUI/chat.css       All styling (light/dark, no-motion, 14px base, no shadows).
WebUI/chat.js        Chat logic: streaming, markdown rendering, settings, API.

The SwiftLM engine is a single-model server process on port 5413; switching models restarts it automatically. The chat UI is served on port 5414.

Local JSON API

Served at http://127.0.0.1:5414:

Method Path Description
GET /api/state Server status, health, engine info, machine info, settings
GET /api/models Installed / recommended / downloading models
GET /api/hf/search?q=&limit= HuggingFace model search proxy (by downloads)
POST /api/models/install {"id"} Install a model
POST /api/models/use {"id"} Switch model (auto-restarts server)
GET/POST /api/settings Read / save settings
POST /api/engine/install Locate / install SwiftLM
POST /api/server/start /api/server/stop Start / stop the engine

Build

./build_app.sh          # release build + .app bundle (ad-hoc signed as SwiftLMAPP)
open build/SwiftLMAPP.app

The app assembles SwiftLMAPP.app whose binary is the SwiftLM-backed build. The SwiftLM engine binary lives under ~/.swiftlm/.

Troubleshooting

  • Stuck on "Starting…" — the launcher now kills orphan SwiftLM processes holding port 5413 before starting. If it persists, check Settings → Engine to confirm SwiftLM is installed.
  • Engine not installed — Settings → Engine → install / locate SwiftLM.
  • Chat works but is slow — try a smaller model, or check memory in Settings → General.

Credits

  • SwiftLM — the independent inference engine this app depends on.
  • Apple MLX / Swift — the underlying on-device ML stack.

Contributing

PRs, issues and feature ideas are welcome. Please open an issue first for larger changes.

License

MIT License — see LICENSE.

About

Local LLM chat manager for Apple Silicon — menu-bar app + browser UI powered by the SwiftLM inference core. Pure on-device inference, no cloud, no API keys. (Separate core from MLXAPP.)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages