llama.cpp fork tests opt-in deduplication of repeated agent messages
state: expiredheat: lowuncertainty: mediumrelevance: mediumllama-cpp prompt-deduplication agent-context-costs
What is this?
A llama.cpp fork adds an opt-in llama-server parser pass that replaces later, byte-identical messages from the same role—above a configurable size threshold—with a short reference to the first copy. The author reports that its 15 synthetic agent-loop scenarios all passed with deduplication enabled if they passed without it, and that prompt-token counts fell substantially in some cases. The fork is not shown here to be upstreamed or independently validated; the reported tests do not establish real-world speed gains or broad agent reliability.
Why it matters
This targets a real cost in local agent workflows: repeated tool output can consume context and require prefill again. The fork’s opt-in, deterministic approach is worth watching, especially for users running long coding-agent sessions on llama.cpp. But “lossless” describes the exact-match detection, not necessarily preserved model behavior: the replacement is a reference the model must interpret. The reported token reductions come from a small synthetic eval, not independent testing or end-to-end latency benchmarks.
Current assessment
The Reddit author and fork README describe an opt-in llama-server pass that replaces later messages with a short reference when they are byte-identical to an earlier message from the same role and exceed a configurable size threshold. The first copy remains; deduplication is off by default, and the author says the disabled mode renders prompts identically to upstream. The author reports that all 15 synthetic scenarios that passed without deduplication also passed with it, with substantial prompt-token reductions in some cases (for example, 18,092 to 6,820 tokens). These are author-reported results: the supplied evidence includes no independent validation, upstream adoption, matched-versus-missed real-world repeat analysis, or end-to-end speed measurements. Exact-byte matching will miss near-duplicates or content changed by wrappers such as timestamps; replacing a repeat with prose may also affect model behavior even if the underlying text matched exactly. Potentially useful for repeated large tool outputs, but practical gains and reliability remain unestablished.
Measured heat
no measured readings yet — the hourly heat pass fills this in
How the heat travelled
Evidence (2) — ⭐ canonical anchor
Interpretation history
2026-10-26T02:24:42Z
audience grounding: medium — This targets a real cost in local agent workflows: repeated tool output can consume context and require prefill again. The fork’s opt-in, deterministic approach is worth watching, especially for users running long coding-agent sessions on llama.cpp. But “lossless” describes the exact-match detection, not necessarily preserved model behavior: the replacement is a reference the model must interpret. The reported token reductions come from a small synthetic eval, not independent testing or end-to-end latency benchmarks.
Decision trace
- 10-29 14:55expireexpired deterministically: single-evidence seed quiet 32 days (lifecycle)
- 10-26 13:24groundThis targets a real cost in local agent workflows: repeated tool output can consume context and require prefill again. The fork’s opt-in, deterministic approach is worth watching, especially for users
- 10-09 01:33review_dormantscheduled targets exhausted or 28 quiet days
- 10-09 01:33drop_targetsquiet through full ladder or over cap 8
- 09-27 11:30review_screenNew comments are opinions, questions, and a link note that don't change the assessment: the LiteLLM prior-art claim describes request-level response caching (returning previous results for identi
- 09-27 11:29review_screenjev screen borderline (noul=0.39) — luna review
- 09-27 08:21sensor_dirtycomment_update
- 09-27 01:21sensor_dirtycomment_update
- 09-27 00:37promote_anchororigin walk conf 0.92
- 09-27 00:34groundThe fork independently instantiates Scott's reference-over-value doctrine — configuration-by-reference-for-agents and url-backed-generative-artifacts already argue against carrying repeated paylo
- 09-27 00:26createA genuinely distinct lossless mechanism for repeated agent-loop content that no open local-inference case carries, but a single near-zero-engagement observation keeps it a seed at low heat.