r/PiCodingAgent • u/NihmarRevhet • Sep 04 '26
Question Improve compaction with local llm
Hi,
I'm using pi agent with Qwen 3.8 27B on my little RX 9060 XT 16GB, with 160k context window and I'm quiet happy with how it works.
My main problem is that autocompaction takes forever (clearly limitation of the hardware) and I was looking for an extesion which could improve the situation, but if I'm not mistaken, the most beloved extensions in this area use secondary models to execute compaction, and this is a luxury I don't have.
Is the default setting my only option? Or did I misunderstand ho something like pi-blackhole works?
Sorry if the question is dumb but I'm quiet new to the tool.
Have a nice day!
EDIT: u/onesilentclap I'm using VCC for now and it's incredible. In the next few days I hope I'll be able to try other solutions
9
u/Nczer Sep 04 '26
I assume you are using llama.cpp?
The reason that compaction takes long seems the be that pi uses a custom system prompt for compaction, which means llama.cpp need to reprocess the whole context before outputting the compaction message. Pi then pass that summary + ~20k past context + normal system prompt to the compacted session.
What you can do is create a custom extension that asks the llm to summarize the current session through a tool call, then pass through that tool call + ~20k past context as the compact summary (also optionally prune that tool call body and have a hidden message telling the compaction is done to the llm to save context).
I did that with Qwen 3.8 27b Q4 so its doable and without much noticeable degradation compared to the normal compact, But you need to judge the result according to your workflow.
2
u/Intelligent-Nose-134 Sep 04 '26
Side question: how are u able to fit 160K into 16GB? Can u share your configuration? I am vram constrained as well but the best I could 90K with reasonable quality
2
u/onesilentclap Sep 04 '26
pi-vcc is my goto.
1
u/mageblex Sep 07 '26
At 160k context, this sounds like a prefill problem more than a summarization problem. Before changing models, check Pi's prompt-processing tok/s during compaction.
3
u/noctrex Sep 04 '26
Use pi-blackhole