feat(2.0): Phase 4 — Hermes-Schicht (MC-Seite + Runbook)
MC-Seite: services/agent.py + routers/agent.py (GET /api/agent/status: Gateway/WebUI-Reachability + Verdrahtungs-Hinweise), AgentView (Status- Tiles, Hermes-oeffnen-Button, Offline-Hinweis). deploy/hermes-webui.service (systemd-USER, :8787). Box-Runbook docs/HERMES_SETUP.md (hermes-webui installieren, Brain=model:auto via Gateway, Tools/MCP verdrahten inkl. mcp_mc+mcp_memory, SSH-Windows, LiteLLM-Caveat #26489). Lokal verifiziert: agent/status + Frontend-Build + Browser (Hermes-View). Box-Ausfuehrung der Verdrahtung steht aus (Runbook). Docs aktualisiert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# Hermes-Schicht — Box-Runbook (Phase 4)
|
||||
|
||||
> Diese Schritte laufen **auf der Bosgame** (`192.168.178.151`, User `hitonabi`).
|
||||
> MC betreibt Hermes nicht — es zeigt nur Status + verlinkt das WebUI. Hier wird die
|
||||
> eigentliche **volle Verdrahtung** gemacht (das war in v1 der „Hermes ist dumm"-Grund).
|
||||
|
||||
## Reihenfolge der Dienste
|
||||
`llama-swap (:8080)` → `LiteLLM-Gateway (:4000)` → `hermes-gateway (:8642)` → `hermes-webui (:8787)`
|
||||
|
||||
## 1. LiteLLM-Gateway starten + Auto-Routing prüfen
|
||||
```bash
|
||||
uv pip install "litellm[proxy]" # oder pipx
|
||||
litellm --config /opt/mission-control-2/gateway/config.yaml --port 4000
|
||||
curl -s http://127.0.0.1:4000/v1/models # fast/heavy/vision/coder/auto?
|
||||
# 'auto' testen: einfacher Prompt → fast; harter/zu langer → Fallback heavy.
|
||||
```
|
||||
⚠️ **Complexity-Auto-Router** (model:auto wählt nach Schwierigkeit) ist versionsabhängig — gegen die
|
||||
installierte LiteLLM-Version verifizieren (docs.litellm.ai/docs/proxy/auto_routing). Baseline =
|
||||
fast + Fallback heavy ist bereits in `gateway/config.yaml`.
|
||||
|
||||
## 2. Engine: Hirne + Ko-Residenz (llama-swap groups)
|
||||
In MC (Modelle & Routing) bzw. direkt: Qwen3.6-35B-A3B (Alias `fast`, `--jinja`!) und
|
||||
Qwen3.5-122B-A10B (Alias `heavy`) eintragen, Gruppe `brains` mit `swap:false` (ko-resident).
|
||||
```bash
|
||||
curl -s http://127.0.0.1:9001/api/groups # MC2 (Phase 0/1 API)
|
||||
```
|
||||
|
||||
## 3. hermes-webui installieren (standalone)
|
||||
```bash
|
||||
cd ~ && git clone https://github.com/nesquena/hermes-webui && cd hermes-webui
|
||||
python3 bootstrap.py # erkennt hermes-agent, installiert Abhängigkeiten
|
||||
# Dienst: deploy/hermes-webui.service → ~/.config/systemd/user/, Passwort setzen:
|
||||
mkdir -p ~/.config/environment.d
|
||||
echo 'HERMES_WEBUI_PASSWORD=<dein-passwort>' > ~/.config/environment.d/hermes-webui.conf
|
||||
systemctl --user enable --now hermes-webui
|
||||
loginctl enable-linger hitonabi
|
||||
```
|
||||
Zugriff vom Windows-PC: `http://192.168.178.151:8787` (mit Passwort).
|
||||
|
||||
## 4. Hermes-Brain = `model: auto` über den Gateway
|
||||
In `~/.hermes/config.yaml` (bzw. via `hermes`-CLI/WebUI-Settings) das Modell auf den **Gateway** zeigen:
|
||||
```yaml
|
||||
model:
|
||||
provider: openai # NICHT 'custom' → Hänger-Bug #26489
|
||||
base_url: http://127.0.0.1:4000/v1
|
||||
api_key: local
|
||||
name: auto # schnell im Alltag, eskaliert auf heavy
|
||||
```
|
||||
|
||||
## 5. Tools/MCP verdrahten (der eigentliche Fix)
|
||||
Hermes' Tools sind by-default AUS. Aktivieren:
|
||||
- **Built-in:** terminal/shell, read_file/search_files, file-ops. `approvals: auto` (rein lokal).
|
||||
- **MCP-Server** (`hermes mcp` oder config `mcp_servers`):
|
||||
- geteiltes Gedächtnis: `python /opt/mission-control-2/mcp/mcp_memory.py` (Env `MC_URL=http://127.0.0.1:9001`)
|
||||
- Stack-Management: `python /opt/mission-control-2/mcp/mcp_mc.py` (Env `MC_URL=http://127.0.0.1:9001`)
|
||||
- **SSH→Windows-PC** (voller Zugriff auf deinen PC): OpenSSH-Server auf Windows aktiv + Key
|
||||
`~/.ssh/id_ed25519_hermes_agent` autorisiert; Hermes nutzt sein Shell-Tool für `ssh TobisPC@<win-ip> …`.
|
||||
- **100 % lokal:** Hermes' eingebauter web_search/browser laufen über Nous Portal (Cloud). Für rein
|
||||
lokal stattdessen einen **lokalen Browser-/Such-MCP** binden (optional, später).
|
||||
|
||||
## 6. Verifikation
|
||||
- WebUI öffnet vom Windows-PC, Chat antwortet (Brain via Gateway).
|
||||
- Hermes kann via `mcp_mc` ein Modell listen/Routing ändern (`list_models`, `set_route`).
|
||||
- Hermes erreicht den Windows-PC (SSH-Kommando) und das Netz.
|
||||
- 14B-Loop weg (Guard-Beschreibungen in mcp_memory + tool-fähiges Brain).
|
||||
Reference in New Issue
Block a user