2026-11-27 16:25 UTC

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

09-24 14:00⭐ origin echo-reconstructedREADME_DEDUPLICATION.md in the fork opens: \"This fork of llama.cpp adds an opt-in pass to `llama-server`. It shortens the prompt when a cha
llopresto87 (GitHub username; evidently the same person as Reddit poster Odd_Cauliflower_8004) on github (echo) · attributed from reddit.post.1wqrbdl
—
09-26 14:02first on r/LocalLLaMA · published · +48.0hI've found a transparent, loseless prompt deduplicator for LLAMA.CPP
Odd_Cauliflower_8004
—
09-26 14:02amplified on r/LocalLLaMA 👑reddit.post.1wqrbdl
Odd_Cauliflower_8004
peak 0 · 11 comments · 101% of case engagement
09-26 14:20our radar first saw it · +48.3hdiscovery anchor: reddit.post.1wqrbdl—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟠 redditI've found a transparent, loseless prompt deduplicator for LLAMA.CPP
LocalLLaMA
Odd_Cauliflower_8004011
🟧 echo.github ⭐README_DEDUPLICATION.md in the fork opens: \"This fork of llama.cpp adds an opt-in pass to `llama-server`. It shortens the prompt when a challopresto87 (GitHub username; evidently the same person as Reddit poster Odd_Cauliflower_8004)——

Interpretation history

Decision trace