RU version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
100% Positive
Analyzed from 322 words in the discussion.
Trending Topics
#tokens#context#model#cache#compaction#llm#local#while#harness#inference

Discussion (7 Comments)Read Original on HackerNews
One trick I find useful is to have one model with two KV caches running and while first cache has produced tokens, second cache immediately summarizes them during input tokens are being generated (tools time), then harness switches to the second KV cache which takes newly produced input tokens while KV in first cache is getting replaced with compacted summary tokens. This is a kind of ping pong, so we trade more space for less time. Still experimenting but it looks it works, and nice bonus it improves GPU utilization. Btw I have my own harness and model serving code, but it can be easily implemented in any other harness and model server.
I pretty much just start a new session whenever i fill the context.
See: https://github.com/earendil-works/pi/blob/main/packages/codi...