ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

SSD tree cache KV cache

Open canapaio opened this issue 6 months ago • 3 comments

Since you’re saving the KV cache to an SSD, wouldn’t it be a good idea to create a database tree, perhaps using ‘Patricia trie’ or RocksDB? After all, system prompts are constantly repeated, and saving most of the work you’ve done would save a huge amount of inference.

canapaio avatar May 08 '26 22:05 canapaio

https://github.com/canapaio/ds4

tree https://github.com/canapaio/ds4/blob/main/READMEtree.md

canapaio avatar May 10 '26 14:05 canapaio

This idea sounds similar to SGLang's radix cache

empty-quiver avatar May 15 '26 18:05 empty-quiver

My idea is that locally, by frequently reusing the same prompts across multiple agents that start identically, we can leverage the KV cache to skip most of the initial inference overhead.

canapaio avatar May 21 '26 14:05 canapaio