Agent sessions are idle for most of their life, and engines choose what to keep by recency. On a slow or shared disk, writing everything turned out worse than having no disk tier at all.
Layby replaces recency with two things: a prediction of when the session will come back, and the measured cost of each option on the machine it runs on.
The prediction comes from a 33.8M model built on jhu-clsp/ettin-encoder-32m . It runs on the host CPU in 11-19 ms and takes no GPU memory. The cost comes from a 412-line rule that reads what the engine measures live. Both run inside vLLM 0.34 and SGLang 0.5.23.
On a held-out GLM-5.3-Flash run (320B MoE, 4x RTX PRO 6000), mean TTFT was 21.5 s. With no disk tier it was 91.6 s. With LMCache it was 42.2 s, and Layby used a third less disk. On a 141 MB/s disk under vLLM it writes nothing and still beats no-disk.
The writeup also shows where it loses.
Writeup: https://huggingface.co/blog/Avifenesh/layby-kv-cache-placement
Paper: Avifenesh/layby-dwell
Code + ReturnBench (Apache-2.0): https://github.com/avifenesh/layby
Model: Avifenesh/layby-dwell