fix: fall back to local llama.cpp when HERMES_PROVIDER=zai lacks GLM_API_KEY
z2b
89c36fd
The Space still carries a HERMES_PROVIDER=zai variable from the cloud era,
which overrode the template default and broke agent init. Now: zai without
key -> custom (local); zai with key still honored.
chore: drop accidentally committed stratum_space/ + __pycache__
z2b
8b61485
feat: serve GLM-4.7-Flash locally via llama.cpp from HF bucket GGUF
z2b
1ed2b54
The Z.ai cloud provider demands credentials (GLM_API_KEY) — but the model
already lives in the mounted HF bucket as GGUF. Now:
- Dockerfile: install llama.cpp b10153 (llama-server) + libgomp1
- start.sh Step 4b: launch llama-server with the bucket's IQ2_M quant
(10.3 GB — only quant fitting the 16 GB CPU-basic tier), alias
glm-4.7-flash, ctx 8192, q8_0 KV cache, readiness poll (non-fatal)
- config.yaml.template: provider defaults to 'custom', base_url
http://127.0.0.1:8080/v1 (still env-overridable to zai/openrouter)
- .env: OPENAI_API_KEY dummy (sk-local-llama) for the local endpoint
- /debug: llama health, bucket GGUF listing, llama.log tail
In double quotes, bash eats the backslash in $, turning the Python regex
r'$\{...' into r'$\{...' — an end-anchor pattern that never matches.
re.sub then returned the template unchanged, leaving literal
'${HERMES_PROVIDER:-zai}' in config.yaml → agent init failed with
Unknown provider. Single-quoted -c + HERMES_HOME from os.environ fixes it.
The 0.19.0 dashboard's pty_ws guard (_ws_host_origin_reason) rejects any
http(s) Origin whose netloc is not the loopback bind. On HF Spaces the
browser Origin is the public *.hf.space URL, so every embedded-chat
upgrade was refused pre-accept with 4403 origin_mismatch (surfaced as 403
to the proxy). Dropping the Origin header makes the guard pass; Host is
already rewritten to 127.0.0.1:9119, token auth via query string, and the
client-IP gate sees loopback from the proxy.
diagnostics: include upstream WS exception in proxy close frame reason
z2b
510b44b
feat: build embedded Chat TUI (ui-tui) via multi-stage Docker build
z2b
4173563
Root cause of 'Chat unavailable': the hermes-agent pip wheel does not
ship ui-tui/ — the dashboard --tui spawns 'node <HERMES_TUI_DIR>/dist/entry.js'
and sys.exit(1)s when node or the TUI tree is missing.
- Stage 1 (node:20-slim): clone NousResearch/hermes-agent @ v2026.7.20
(exact tag matching pip 0.19.0 release date), npm ci + npm run build
- Stage 2: copy node binary + full ui-tui tree (dist + node_modules +
package-lock.json; no prune — _tui_need_npm_install compares lockfiles)
- ENV HERMES_TUI_DIR=/opt/hermes-ui-tui
- libstdc++6 for the node binary
fix: replace stdlib proxy with aiohttp WebSocket-capable reverse proxy
z2b
cb37798
The dashboard embedded chat (--tui) communicates via WebSocket (PTY bridge).
Python stdlib http.server cannot handle Upgrade: websocket handshakes,
so every chat connection died instantly at the proxy layer.
New proxy (aiohttp):
- bidirectional WebSocket pass-through (any path with Upgrade header)
- streamed HTTP proxying (SSE-safe, encoding pass-through)
- keeps /health /version /debug /transport-check + /telegram webhook route
fix: add --tui flag to dashboard for in-browser Chat tab (embedded PTY/WebSocket)
z2b
a7e82a8
diagnostics: save curl warmup output to file, show in /debug