frank-large: pin the prompt cache (16 GB) and capture the engine ledger on disk

Auto cache-sizing is OFF on this box: the boot ledger refused it at
36.9 GB (2 x full-entry) floor vs 35.7 GB free, so every deep agent
request re-prefills its whole 79-81k context (84.9-179.8 s measured on
serve_api lines, 2026-10-06) for ~500-650 new tokens per turn. Pin
HALOGEN_CACHE_MB=16384 (>= one full-slot entry at ~70 KB/token) — the
documented override; the per-store reserve re-check keeps the host safe.

Also: the serve script's 'podman run -d > LOG' captured only the
container ID — the runbook's boot-ledger grep read a one-line hex file
and the ledger existed nowhere on disk. Foreground 'podman run' makes
the ledger land in the log file as documented; exit-code and ExecStop
semantics are unchanged. Test seam updated for both.
This commit is contained in:
Frank committed 2026-10-06 00:26:28 -07:00
1 parent 8343397584
commit ba67ca5c9e
3 files changed
+47 -21

No files matched your search

+11 -6
View File
@@ -119,7 +119,7 @@ mkdir -p "$(dirname "$LOG")"
# either. No comment lines inside the backslash
# chain — a mid-chain # terminates the continuation (the 2026-10-05
# exit-127 crash loop on the sibling serve script).
podman run -d --name "$FRANK_LARGE_CONTAINER" \
podman run --name "$FRANK_LARGE_CONTAINER" \
--publish "$FRANK_LARGE_PUBLISH" \
--ipc=host \
--ulimit memlock=-1:-1 \
@@ -139,8 +139,13 @@ podman run -d --name "$FRANK_LARGE_CONTAINER" \
"$FRANK_LARGE_IMAGE" \
> "$LOG" 2>&1
# This script's lifetime IS the container's: podman wait returns the
# container's exit code, so a crash is a nonzero ExecStart and the unit's
# Restart=always is real. systemd stop goes through the unit's ExecStop
# (podman wait alone cannot stop the child).
exec podman wait "$FRANK_LARGE_CONTAINER"
# FOREGROUND `podman run`: the engine's stdout/stderr are this script's
# output, so the boot ledger (kv pool, prompt cache, drafter state, any
# clamp) lands in $LOG as documented. The previous `-d` + `exec podman
# wait` shape captured only the container ID — the ledger existed
# nowhere on disk and the runbook's post-deploy grep read a one-line
# hex file (found 2026-10-06 while tuning). podman run returns the
# container's exit code, so a crash is a nonzero ExecStart and the
# unit's Restart=always stays real; systemd stop goes through the
# unit's ExecStop and the run client forwards SIGTERM to the engine,
# which drains on it.