What should I put in cached prefix?
System prompt, project conventions, stable reference docs, anything identical across turns. Keep it byte-stable; edits bust the cache.
Glossary · Prompt Caching
Pay full price once for stable context.
Direct answer
Prompt caching stores the stable prefix of a context (system prompt, conventions, reference docs) so repeat turns serve it at ~10% of fresh-token price on Claude-class APIs. It never shrinks a single request, but across long sessions the 90% saving compounds hard, since stable layers re-bill every turn. Rule: keep unchanging context byte-stable and first, so cache hits; engineer the dynamic layers (retrieval, memory) separately.
In Anvaya
Questions
System prompt, project conventions, stable reference docs, anything identical across turns. Keep it byte-stable; edits bust the cache.
No, cached noise still dilutes attention. Caching cuts price; curation protects quality. Do both.
Cached input ~10% of fresh price. In sessions with 20+ turns and large stable prefixes, totals drop dramatically.
25.6 MB median RSS. 25 agents ran in parallel on a Core 2 Duo with 4 GB RAM. Hundreds on your machine. Zero cloud required on the Ollama path.
Requires Rust/cargo to build from source. Linux and macOS today, Windows not yet supported. Pre-1.0, public beta. Pricing TBD.