Files
Strata/include
Eddoursul 0aaa754656 Prompt cache for --serve
A request continues from the longest prefix of its prompt the engine still
holds: the live sequence, checkpoints of the fixed-size sequence state (GDN
recurrence and conv history, QSA indexer tail, PLE history) in host memory,
or a conversation another request replaced, stashed in RAM with its K/V
cells. Checkpoints are taken before a prompt's last <|im_start|>, at the
prompt's end and every --cache-every cells of a long prompt.

Short prompt remainders go through verify windows instead of the batched
prompt path. The decode loop no longer verifies past the output limit or a
drafted end-of-turn token, so the live state ends where the emitted text does.

The server reports reused tokens (OpenAI prompt_tokens_details.cached_tokens,
Anthropic cache_read_input_tokens) and drains the engine to DONE inside the
request lock.

New engine options: --prompt-cache N, --cache-ram MIB, --cache-every N,
--feed-max N.
2026-09-25 00:10:51 +02:00
..
2026-09-25 00:10:51 +02:00