Files
serverAppConfigs/scripts/frank-zealot.env
T
Frank a4fe5f6839 fix(frank-zealot): serve /metrics so Prometheus can see the endpoint
The scrape has never worked: lastError is "server returned HTTP status 501 Not
Implemented" on http://host.containers.internal:7771/metrics, and the oldest
retained sample of up{job="frank-zealot"} (2026-10-11) is already 0 -- the target
has been red across four payload generations while /health answered 200 the whole
time, keeping the critical LlmEndpointDown alert permanently active. llama.cpp
gates /metrics behind --metrics; halogen serves it natively, which is why the
asymmetry looked like a 3090-only problem.

METRICS=1 in the shipped env, --metrics reaches the argv through EXTRA_ARGS, and
the seam asserts both directions (default ships the flag, METRICS=0 strips it).
Diagnosed via /api/v1/targets lastError rather than the alert list, which is also
the lesson: Alertmanager here has no persistence, so a reboot re-stamps startsAt
and a weeks-old fault looks fresh.
2026-10-18 01:52:19 -07:00

82 lines
4.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# frank-zealot — llama.cpp (PrismML fork build, CUDA) serving
# prism-ml/Ternary-Bonsai-2-27B-gguf at PQ2_0 on the RTX 3090, :7771.
#
# 2026-10-17 (Frank): swap from Qwen3.5-9B-Uncensored Q6_K to the Bonsai-2-27B
# ternary checkpoint at the SAME shape Frank asked for — TWO 200,704-token
# conversations — with q8_0 K + q8_0 V (f16 is arithmetically impossible here,
# see the KV law), MTP off (the file carries no nextn/mtp tensors), verbosity 4.
#
# THE RUNTIME IS A LOCK, NOT A PREFERENCE. The file is general.file_type 141
# with 402 tensors of the CUSTOM GGML type 142 (pq2_0) plus prism.hadamard.*
# metadata (normalized-Sylvester-Walsh transform, block 1024, 401 named
# weights, inverse on token_embd, gdn_v_grouped). Stock llama.cpp refuses type
# 142 at load; only the PrismML fork registers the type AND reads the Hadamard
# metadata. The vendor prebuilt build 10754 (commit 2459f68b5) is what every
# number in this file was measured on; sha256 12ae5baba033d8cd…
LLAMA_BIN=/home/dank/GitPackages/llama-prism/llama-server
MODEL_FILE=/home/dank/models/Bonsai2-PQ2_0/Ternary-Bonsai-2-27B-PQ2_0.gguf
MMPROJ_FILE=/home/dank/models/Bonsai2-PQ2_0/Ternary-Bonsai-2-27B-mmproj-Q8_0.gguf
# The CRACK re-export (dealignai/Bonsai-2-27B-Ternary-CRACK-GGUF, uncensored,
# already on disk at /home/dank/models/Bonsai2-CRACK/) is a ONE-LINE swap: the
# header census proves byte-identical geometry (851 tensors, same
# {pq2_0:402, f32:353, bf16:96} histogram, 64 blocks, vocab 248,320, same
# 8,952-char chat template) and the official file's sha256 is the Hub LFS oid.
# Bonsai-2 is the BASE (censored) Qwen3.8 family; if a compaction or subagent
# request ever comes back with a refusal, point MODEL_FILE at the CRACK file
# and restart — the VRAM ledger below does not move.
#
# Served model id — the harness/family name. The SERVICE, unit, scripts and
# this env file keep the frank-zealot name; only the alias on the wire is the
# model id. Consumers that key on the served id: OpenWebUI (model row,
# access_grant, api_configs model_ids) and the harness models.yml.
ALIAS=frank-zealot
BIND_ADDR=0.0.0.0
LISTEN_PORT=7771
# CTX_SIZE is the POOL llama.cpp divides across slots: 401,408 / 2 = 200,704
# per conversation. MUST stay divisible by PARALLEL (the seam enforces it) and
# the harness contextWindow quotes the PER-SLOT number — a longer prompt is
# answered with a 400, never truncated. The model's native window is 262,144;
# 2 × 262,144 at q8_0 projects 25,758 MiB and does NOT fit this card (measured
# f16 analogue: 41,118). One 262,144 slot fits with 5,995 MiB free but
# serializes compaction, so the pair stays.
CTX_SIZE=401408
PARALLEL=2
BATCH_SIZE=4096
UBATCH_SIZE=2048
# KV law (from the GGUF header, then confirmed by the boot ledger): 16
# full-attention layers (full_attention_interval 4 over 64 blocks) × 4 KV heads
# × 256 dim = 16,384 elements per token per cache. q8_0 bills 17,408 B per
# cache ⇒ 34,816 B/token = 34 KiB, so the 401,408 pool is 13,328.00 MiB — the
# ledger said exactly that. f16 would bill 25,088 MiB and the boot DIES:
# `cudaMalloc failed: out of memory` on the 25,088.00 MiB request, engine fit
# projection 33,198 vs 23,558 free. The 48 DeltaNet layers bill a fixed
# recurrent state per SLOT — ~150 MiB each (context 13,627 − KV 13,328 = 299
# for two slots), which is why pool arithmetic alone under-prices the shape.
CACHE_TYPE_K=q8_0
CACHE_TYPE_V=q8_0
# Boot ledger (2026-10-17, this exact shape, nvidia-smi settled):
# 22,664 MiB used / 1,461 MiB free of 24,123
# fit projection 21,439 = 6,539 model + 13,627 context + 1,272 compute
# the mtmd projector's 873.10 MiB worst-case is NOT inside that projection —
# it lands after the fit check, which is the whole difference between
# "2.6 GiB free on paper" and 1.4 GiB free in reality. Watch it.
# Fallback rung if the margin is ever eaten (desktop, co-tenant): q4_0 KV
# measured 16,392 used / 7,733 free at the same 2 × 200,704.
# 1024 is the ubatch fallback (−616 MiB, measured on the 9B predecessor at
# this card/arch; 2048 was the measured CUDA optimum, +4.6 % prefill).
SPEC_TYPE=none
NGL=99
# Log verbosity threshold (llama.cpp -lv). 4 = debug: KV layout, buffer sizes
# and graph capture land in the journal, which is what the VRAM-fit forensics
# read. Levels above 4 flood the journal.
VERBOSITY=4
# Serve /metrics. llama.cpp answers 501 without --metrics, and Dankclaw's
# Prometheus scrapes /metrics on every fleet endpoint — a 501 reads as DOWN, so
# this service has held the critical LlmEndpointDown alert for as long as the
# metric has history (verified 2026-10-18: the oldest retained sample of
# up{job="frank-zealot"}, 2026-10-11, is already 0; scrapeUrl
# http://host.containers.internal:7771/metrics, lastError "server returned HTTP
# status 501 Not Implemented"). 0 opts out and re-breaks the scrape.
METRICS=1