Commit Graph
18 Commits
Author SHA1 Message Date
mozempkandClaude Opus 4.8 ea852087c4 feat(slot-proxy): live load/prefill/decode progress on :48090
Add a slot-cache-proxy service (profile stack) in front of llama-swap-stack.
Injects return_progress into streaming chat, taps llama.cpp prompt_progress
SSE, serves GET /progress {loading|prefill|generating|idle} with pct/tok_s/
ETA. The pi-load-progress extension polls it; point pi llmruntime baseUrl at
http://localhost:48090/v1. host net + pid:host (load tracker reads the
containerised llama-server /proc/io). Transparent superset of llama-swap
(no endpoint lost; /progress is net-new). Script mirrors llmruntime-x570.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 13:22:33 +02:00
mozempkandClaude Opus 4.8 c8ab0b93ce feat(bonsai): add Bonsai-27B-Q1_0 fully-on-GPU (1650 Ti 4GB)
Add a 4th binary to the swap-stack: PrismML llama-server-ternary (Q1_0_g128
ternary kernels, built sm75/CUDA-12.8 static) for Bonsai-27B-Q1_0.

Config: 3.8GB weights ALL on the 4GB GPU (ngl 99) + KV in CPU RAM
(--no-kv-offload, since VRAM cannot hold both) + q4_0 KV + --flash-attn
(GPU attention; iq4_nl forces CPU attention) + tiny batch (-b 64) to fit
the ~100MB VRAM headroom. Fits at 3611/3718 MiB. ~7 t/s decode, ~27 pp
prefill (1650 Ti has no tensor cores + KV over PCIe = the ceiling).

Measured alt configs (all worse): ngl48+KV-VRAM = 8.5 t/s decode but only
10 pp prefill (CPU layers tank prefill); ngl99+KV-VRAM OOMs even at ctx 2048.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 05:17:13 +02:00
mozempkandClaude Fable 5 c7bb54a253 compose: retire duo-warmboot auto-save sidecar
Periodic slot saves queue on the serving slot and blocked in-flight
requests (user hit connection timeouts). Prefix reuse via --cache-reuse
+ ttl 0 does not need the sidecar and stays; duo-warmboot.sh remains
for manual restore after stack restarts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:39:00 +02:00
mozempkandClaude Fable 5 f078677c88 warmboot: heal fully-down duo when stack is idle
Stack restart after the sidecar's boot pass left duo_up=0 and the heal
branch (which required exactly one member) never fired. Heal now also
triggers when zero duo members run AND the running list is empty, so a
bounced stack repopulates automatically. A deliberate swap to a non-duo
model still isn't fought (running list non-empty).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:21:46 +02:00
mozempkandClaude Fable 5 67c1b6b827 warmboot: self-heal crashed duo members + boot-restore guard
Suspend/resume kills the GPU-side duo member (CUDA context lost; often
wedged nvidia_uvm on this machine). Daemon now ticks every 60s: if
exactly one duo member is running, the missing one is reloaded via its
/upstream health endpoint and its snapshot restored. Saves stay at
5-min cadence. Boot restore skips members that are already running.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:13:01 +02:00
mozempkandClaude Fable 5 b27c37a552 swap-stack: duo-warmboot sidecar — automatic prompt-KV restore/save
curlimages/curl sidecar (profile stack, depends_on healthy): restores
duo slot caches on boot (pre-loads both duo servers) and auto-saves
every 300s while loaded. No manual duo-warmboot.sh calls needed; the
script remains for ad-hoc use. Snapshot tracks the latest real session;
prefix matching (--cache-reuse) handles divergent new sessions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:16:24 +02:00
mozempkandClaude Fable 5 597b882743 swap-stack: slot KV save/restore for duo prompt caches (x570 S5 pattern)
--slot-save-path + --cache-reuse 256 on both duo members, ./kv-cache
mounted at /cache. Measured on ornith (3K-token system prompt): warm
prefix reuse 296ms vs 106.7s cold prefill (361x); slot save 84MB in
59ms, GDN recurrent state serializes. scripts/duo-warmboot.sh wraps
save/restore/status via llama-swap /upstream passthrough. Restore
after restart: run 'duo-warmboot.sh restore' post stack boot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:13:20 +02:00
mozempkandClaude Fable 5 85e27a1a47 compose: replace open-webui with AnythingLLM on swap-stack endpoint; drop IQ4 GGUFs
AnythingLLM (port 3001, profile webui) points at llama-swap-stack:8080
via generic-openai, default model ornith-35b-duo (131K ctx). Deleted the
two >RAM IQ4 GGUFs (36.5GB — thrash-only until 64GB RAM upgrade) and
their swap-stack entries; re-download paths noted in config comment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:02:33 +02:00
mozempkandClaude Fable 5 aba5dd0a45 swap-stack: drop concluded A/B build variants (ik, upstream-master)
FINDINGS answered their questions: ik_llama -23% decode / +13% prefill,
upstream master parity with turboquant on K-quant decode. Binaries stay
in the image, macros kept for future experiments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 15:56:21 +02:00
mozempkandClaude Fable 5 2a2305490a swap-stack: ornith duo 128K via mixed KV (q8 K + turbo2 V); turbo-KV root cause
Probe matrix proved K is the broken side of turbo KV on Qwen3-4B
(QK-norm gamma outliers vs PolarQuant's no-per-channel-range format)
while V tolerates 2-bit for free. Applied to ornith duo main: K q8_0 +
V turbo2 = 128K ctx in ~880MB RAM at full speed (8.7-10.1 t/s concurrent,
vs 3x decode loss with turbo2 K). Qwen duo stays q4/q4 24K — only clean
mix is bigger than q4/q4. InnerQ equalizer confirmed broken as shipped
(compensation error grows with scale strength); documented in
MOE-FINDINGS with the full matrix and fix ladder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 15:44:19 +02:00
mozempkandClaude Fable 5 da655e074d swap-stack: duo bigger contexts — ornith 64K (CPU q8 KV), qwen 24K (GPU q4 KV ceiling)
Ornith GDN-hybrid KV is cheap (10/40 layers, 680MB @ 64K in RAM).
Qwen3-4B full-GQA KV is 40KB/tok at q4_0: 32K OOMs on 4GB VRAM, 24K fits
(3564 MiB). turbo KV rejected — broken on Qwen3-4B (PPL 438, FINDINGS §2).
Concurrent throughput unchanged: ornith 9.2 / qwen 43.2 t/s.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:35:07 +02:00
mozempkandClaude Fable 5 5e68d30d31 swap-stack: duo config — qwen3-4b full GPU, ornith-35b pure CPU
Duo group (resident main+subagent for pi): flip VRAM to the small model.
Ornith experts never touch VRAM; its dense-on-GPU split starved qwen to
176 MiB / 5.8 t/s concurrent. After flip: qwen 43 t/s, ornith 8 t/s.
CUDA_VISIBLE_DEVICES= required for ornith — ngl 0 still allocates ~1GB
pp compute buffer on CUDA builds (OOM+segfault). Duo section in
MOE-FINDINGS.md; also snapshots prior swap-stack migration state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:28:32 +02:00
mozempk 322364e6fc compose: fix server command structure (critical bug)
Compose shlex-splits 'command: |' block scalar into a list when used with
'entrypoint: ["/bin/sh","-c"]'. Docker then runs '/bin/sh -c exec' where
'exec' is the only -c argument and '/app/llama-server' becomes $0. 'exec'
with no program in sh exits 0 immediately → 37-restart crash-loop, no server.

Fix: use 'entrypoint: []' and 'command: [/bin/sh, -c, <|block>]' so the full
shell command is passed as a single list element — not further split by Compose.
2026-05-06 23:31:12 +02:00
mozempk e7e389c0e1 llama+compose: fix bigctx startup timing
- compose: increase start_period for bigctx services
  - gemma4-e4b-bigctx: 60s -> 150s (5 GiB model + warmup + 163840 ctx takes ~90-120s)
  - gemma4-e2b-bigctx: 60s -> 120s (large ctx 393216 allocation)
  - smollm3/qwen3-4b bigctx: 60s -> 90s
- llama: extend health poll from 30x2s=60s to 75x2s=150s
- llama: require 3 consecutive unhealthy before giving up (avoids
  false positives during Docker start_period window)
2026-05-06 19:03:31 +02:00
mozempk 0618078937 llama: fix bigctx double-profile conflict (llama_server name collision) 2026-05-06 17:41:20 +02:00
mozempk 33333507a5 llama: remove stopped containers before start to fix name conflict 2026-05-06 17:37:47 +02:00
mozempk 9f0193c3fc Add llama launcher script
- ./llama (interactive menu) or ./llama <cmd> [args]
- start <model> [--bigctx] [--webui]: verify model file, warn before stopping running server, health-wait after start
- stop: stop all llama containers
- status: running model + health + env vars
- logs [--follow]: tail server logs
- build: build TurboQuant images
- bench <model>: run llama-bench via bench profile
2026-05-06 17:31:35 +02:00
mozempk 4ad296608b Initial commit: tuned multi-model llama.cpp stack
- 5 models: SmolLM3-3B, Gemma4-E2B/E4B, Qwen3-4B, Qwen3.5-9B
- TurboQuant image (FORCE_MMQ): +6-11% free speed on Turing GPUs
- Bigctx profiles (-nkvo KV in RAM): 2-16x context gain
- turbo2 KV: 2x smaller, benchmarked against PPL quality gate
- Per-model env files with justified parameters
- kv_quant_test.sh + cpu_ctx_test.sh benchmark scripts
- docs/FINDINGS.md: surprises, pitfalls, recommendations
- docs/ARCHITECTURE.md: compose + test script design
2026-05-06 15:56:40 +02:00