How imkofty/hermuse works
Hermuse combines a self-hosted Telegram AI gateway with a browser-accessible 9Router dashboard. The main chat path is Telegram to the Hermes gateway, which uses either Nous directly or local 9Router for models. Separately, browser requests reach Cloudflare Pages and are relayed through a D1-backed queue to the VM’s 9Router by a long-polling client. The README documents the operational supervisors and watchdogs; source excerpts show the tunnel’s request, polling, and response mechanics. Other runtime script internals were not sampled, so those links rely on README statements.
Main entry points: tunnel-client.mjs Tunnel Client · run-hermes.sh Hermes Gateway · start-9router.sh 9Router · schema.sql D1 Queue
Components 14
Agent and Models
- Hermes Gateway
run-hermes.sh - Nous Models
- 9Router
start-9router.sh
Dashboard Tunnel
- Pages Functions
tunnel/pages-tunnel/functions/[[path]].js - D1 Queue
tunnel/schema.sql - Poll Endpoint
tunnel/pages-tunnel/functions/__tunnel/poll.js - Respond Endpoint
tunnel/pages-tunnel/functions/__tunnel/respond.js - Tunnel Client
tunnel-client.mjs
Runtime Operations
- Gateway Launcher
start-gateway.sh - Service Watchdog
watchdog.sh - Gateway Watchdog
gateway-watch.sh - Boot All
scripts/start-all.sh
Other components
- Telegram User
- Browser
Connections 19
- Telegram User → Hermes Gateway: chats via
README.md - Gateway Launcher → Hermes Gateway: starts
README.md - Hermes Gateway → Nous Models: uses directly
README.md - Hermes Gateway → 9Router: routes models
README.md - Browser → Pages Functions: requests dashboard
README.md - Pages Functions → D1 Queue: queues request
tunnel/pages-tunnel/functions/[[path]].js - Pages Functions → D1 Queue: checks response
tunnel/pages-tunnel/functions/[[path]].js - Poll Endpoint → D1 Queue: claims requests
tunnel/pages-tunnel/functions/__tunnel/poll.js - Tunnel Client → Poll Endpoint: long-polls
tunnel-client.mjs - Tunnel Client → 9Router: forwards requests
tunnel-client.mjs - Tunnel Client → Respond Endpoint: posts responses
tunnel-client.mjs - Respond Endpoint → D1 Queue: stores response
tunnel/pages-tunnel/functions/__tunnel/respond.js - Service Watchdog → 9Router: checks and restarts
README.md - Service Watchdog → Tunnel Client: checks and restarts
README.md - Service Watchdog → Gateway Launcher: restarts gateway
README.md - Gateway Watchdog → Hermes Gateway: checks and restarts
README.md - Boot All → 9Router: starts if down
README.md - Boot All → Tunnel Client: starts if down
README.md - Boot All → Gateway Launcher: starts if down
README.md