Managed OLLAMA_DEBUG toggle for per-request context tracing #280
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/infrastructure#280
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make
OLLAMA_DEBUGa managed toggle on the ollama role so per-request context usage is traceable from the server log.Why
Tracing context usage during the OpenCode/Qwen-3 eval. With
OLLAMA_DEBUG=1,/opt/homebrew/var/log/ollama.logrecords per-requestprompt_eval/eval_countand - most useful - prompt-cache hit/miss (cache.go msg="cache miss" total=N matched=M). Thematched=field directly explains the 3s (cache hit) vs 3min (cold prefill) first-turn behaviour.Change
ollama_service_envdict loop (idempotent add/set + drift-only reload), so additional env keys ride the same path.ollama_debugtoggle (role defaultfalse,truefor the mac group). On-path pinsOLLAMA_DEBUG=1; symmetric off-path deletes the key. Additive - leaves the flash-attention / kv-cache perf vars alone.Caveat
The brew ollama log is unrotated, so debug is a deliberate opt-in, not a permanent default. If left on long-term, add a newsyslog/logrotate rule.
Builds on #279 (the env-management mechanism).