I think about long-context inference as a combination of reducing repeated work, caching reusable KV data, and making the agent’s activity visible. My posts connect prompt-prefill costs and indexed attention with the practical tradeoffs of disk storage and generation speed.
I argue that inference speed is not fixed at a given context; what matters is the curve.
For a 1M context model to be usable, I think generation and prefill must be fast enough even with very large contexts.
I had the M2.7 implementation ready, but wanted to add it only if it actually M2.7 is better at certain tasks.
In my tests, Minimax M2.7 delivers good code.
I observed that the speed decreases a lot more than DS4 as the context grows for M2.7.
I attributed DS4's comparatively better speed scaling to the compressed and indexed DS4 attention.
I described the compressed/indexed attention as impressive and said it makes DS4F usable at large context windows.
I said compressed and indexed attention makes DS4F usable at large context windows.
I called DeepSeek v4 the gold standard because it combines KV cache compression and indexed attention.
I said we can likely live with the memory cost, but dense attention's computational cost is too heavy for local inference at ~100k context already.
I said other models with vanilla attention are totally unusable at large context windows.
I noted that OpenCode uses freaking 11k tokens of system prompt.
At a prefill rate of ~130 t/s, I estimated that starting a session would mean waiting 84 seconds.
I said the Pi agent is a lot saner here.
I suggested caching very long common KV-cache chunks on disk, hashing each chunk with all the parameters, and giving unused cached data a sensible TTL.
I proposed caching a chunk only after seeing it repeated N times across different sessions.
I described the disk tradeoff: KV data can be a huge amount, and loading it takes time even if loading is faster than prefilling.
I said the tradeoff starts to look different when a model compresses 100k tokens KV cache in 2.8GB.
For long-context DeepSeek v4 attention, I said indexed attention must be written to avoid any useless work.
I said avoiding useless work improves the slop of the t/s in prefilling and generation, with good numbers at 500k ctx size.
After I implemented on-disk KV cache, prefill became a less stringent problem.
I said 400 t/s is not bad for prefill.
I said generation is now the annoying part.
I observed that many coding-agent TUIs are conceived to hide what the model is doing, so it can generate tons of stuff and ideas without the user seeing them.