News for hackers. Stuff that matters.
Re:Claude Haiku 4.5 by criemen on Wednesday October 15, 2025 @01:58PM (#45596244)
I don't understand why we're paying for caching at all (except: model providers can charge for it). It's almost extortion - the provider stores some data for 5min on some disk, and gets to sell their highly limited GPU resources to someone else instead (because you are using the kv cache instead of GPU capacity for a good chunk of your input tokens). They charge you 10% of their GPU-level prices for effectively _not_ using their GPU at all for the tokens that hit the cache.

If I'm missing something about how inference works that explains why there is still a cost for cached tokens, please let me know!

Re:Claude Haiku 4.5 by simonw on Wednesday October 15, 2025 @02:00PM (#45596271)
It's not about storing data on disk, it's about keeping data resident in memory.
Re:Claude Haiku 4.5 by criemen on Wednesday October 15, 2025 @02:08PM (#45596386)
Fascinating, so I have to think more "pay for RAM/redis" than "pay for SSD"?
Re:Claude Haiku 4.5 by nthypes on Wednesday October 15, 2025 @02:43PM (#45596777)
"pay for data on VRAM" RAM of GPU
Re:Claude Haiku 4.5 by criemen on Wednesday October 15, 2025 @02:57PM (#45596934)
But that doesn't make sense? Why would they keep the cache persistent in the VRAM of the GPU nodes, which are needed for model weights? Shouldn't they be able to swap in/out the kvcache of your prompt when you actually use it?
Re:Claude Haiku 4.5 by dotancohen on Wednesday October 15, 2025 @03:23PM (#45597196)
They are not caching to save network bandwidth. They are caching to increase interference speed and reduce (their own) costs.
Re:Claude Haiku 4.5 by tazjin on Wednesday October 15, 2025 @03:44PM (#45597444)
Your intuition is correct and the sibling comments are wrong. Modern LLM inference servers support hierarchical caches (where data moves to slower storage tiers), often with pluggable backends. A popular open-source backend for the "slow" tier is Mooncake: https://github.com/kvcache-ai/Mooncake
Re:Claude Haiku 4.5 by simonw on Wednesday October 15, 2025 @07:31PM (#45599623)
OK that's pretty fascinating, turns out Mooncake includes a trick that can populate GPU VRAM directly from NVMe SSD without it having to go through the host's regular CPU and RAM first!

https://github.com/kvcache-ai/Mooncake/blob/main/doc/en/tran...

> Transfer Engine also leverages the NVMeof protocol to support direct data transfer from files on NVMe to DRAM/VRAM via PCIe, without going through the CPU and achieving zero-copy.

Re:Claude Haiku 4.5 by minimaxir on Wednesday October 15, 2025 @03:00PM (#45596961)
That is slow.
Re:Claude Haiku 4.5 by jbellis on Wednesday October 15, 2025 @08:48PM (#45600247)
Deepseek pioneered automatic prefix caching and caches on SSD. SSD reads are so fast compared to LLM inference that I can't think of a reason to waste ram on it.
Re:Claude Haiku 4.5 by jychang on Thursday October 16, 2025 @01:30AM (#45601738)
It’s not instantly fast though. Context is probably ~20gb of VRAM at max context size. That’s gonna take some time to get from SSD no matter what.

TtFT will get slower if you export kv cache to SSD.