I built a cache-friendly context compacting plugin for OpenCode
Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.
https://github.com/lennartschoch/opencode-cache-compact
The default context compacting mechanism in OpenCode strips a bunch of tokens from the beginning of the conversation (system prompt, tools etc).
This is fine for hosted models, but on a local model this means you'll prefill the entire conversation that's already cached.
I built a plugin that keeps the conversation as-is, prompts the model to write a summary and then transforms the conversation to erase everything aside from system prompt, tools and summary - because the entire conversation is cached, this is super fast (usually around 1-2 minutes on my Strix Halo, previously >10min).
Would love to get some feedback on this - is this useful for anyone else? This is my first open source project in the local LLM space so I'd love to know your thoughts!
[link] [comments]
More from r/LocalLLaMA
-
NVIDIA shipped OpenShell, an open source sandbox that gives local and open agents real runtime limits instead of prompt rules. Over 100 firms joined the safety stack. OpenAI did not.
Sep 28
-
3090 for $1500???
Sep 28
-
modified qwen 3.8 27b modifies windows credential dumper to bypass EDR detection
Sep 28
-
Minisforum MS-S1 MAX-P495 @ €7.799,00
Sep 28
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.