checks: cover residency, and prove a short-keep_alive caller is overridden

24 asserts forge's runner is permanently resident, not merely loaded at the
moment of the check — a cold load is 21-66 s and lands in front of the caller,
so "loaded right now" is not the property that matters.

25 is the regression that would otherwise be silent: an explicit finite
keep_alive from a caller BEATS forge's OLLAMA_KEEP_ALIVE default, so the router
override is the only thing stopping one such caller evicting the 64 GB model for
everyone else. The check sends keep_alive:"30s" natively and asserts residency
survives it.

Both pass on lounge and nidavellir, 25/25.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Dolon (Agent)
2026-09-18 20:10:39 +00:00
co-authored by Claude Opus 5
parent f7cd9b6690
commit 820bcc8e4e
+12
View File
@@ -51,3 +51,15 @@ echo "22 ollama /api/pull guard (expect 400) HTTP $(j -XPOST $GOOD/local-strict
# Every forge-bound request carries the pinned num_ctx; the runner forge reports
# must match it, or callers are thrashing the 64 GB model on every alternation.
echo "23 num_ctx pin == runner context ....... HTTP $(j $GOOD/status) $(sed -n 's/.*"num_ctx_pin": *\([0-9null]*\).*"runner_context": *\([0-9null]*\).*/pin=\1 runner=\2/p' /tmp/b)"
# ---- residency ---------------------------------------------------------------
# A cold load is 21-66 s and lands in front of the caller, so the model must be
# permanently resident, not merely loaded right now. runner_resident=true means
# forge reports "forever"; false means the next idle spell costs a cold load.
echo "24 model is permanently resident ....... HTTP $(j $GOOD/status) $(sed -n 's/.*"keep_alive_pin": *\(-\{0,1\}[0-9null]*\).*"runner_resident": *\([a-z]*\).*/pin=\1 resident=\2/p' /tmp/b)"
# A caller that sends its own SHORT keep_alive must not be able to evict the model
# for everyone else: the router overrides it. Send 30s natively, then re-read.
j -XPOST $GOOD/local-strict/api/chat -H 'Content-Type: application/json' \
-d '{"model":"gpt-oss:120b","messages":[{"role":"user","content":"hi"}],"stream":false,"think":false,"keep_alive":"30s"}' >/dev/null
echo "25 short keep_alive caller overridden .. HTTP $(j $GOOD/status) $(sed -n 's/.*"runner_resident": *\([a-z]*\).*/resident=\1 (want true)/p' /tmp/b)"