Working with the model cache
Many providers cache the beginning of a request for a few minutes: the system prompt, tools, and earlier conversation. The next request with the same beginning reads that part from the cache at a lower price. When the cache expires, the next request is billed in full again.
Explyt CLI saves the cache in two ways: chat forks and warming.
Forks keep the cache
When the agent hands part of a task to a fork, the fork starts from the same context as the main chat and reuses the provider's cache. Side work doesn't clutter the main context or throw away cache you've already paid for. See Subagents.
Cache warming
Explyt models are not warmed, and no credits are spent on warming. Warming is mainly useful if you work with your own Anthropic key.
Anthropic's cache lives five minutes by default. If the pause between requests is longer, the next request pays to write the whole history again. There are two ways to avoid this:
- One-hour cache. Start the agent with the
EXPLYT_CACHE_RETENTION=longenvironment variable. Writing to this cache costs 2× the base input token price instead of 1.25×. - Warming, described below.
When 90% of the cache lifetime has passed, but no later than 10 seconds before it expires, the agent repeats the last request with the answer limited to one token. The cache is extended, and the next real request reads it at the lower price again.
When it pays off
Warming pays off with a large context, an expensive model, and long pauses inside a task: a long build, slow tests, a slow tool.
Each warming is a real paid request: the whole prompt is billed at the cache-read price plus one output token. A warming not followed by a real request is pure cost. So the agent decides on each warming itself and warms only if the expected saving is at least $0.05. Warming costs count toward the session's usage, but they don't appear in the conversation.
Modes
| Value | What it does |
|---|---|
off | No warming (default) |
streaming | Warms while the agent works on a request and stops when it's done, but no later than after one hour. Useful when the agent waits more than five minutes for a build, tests, or a slow tool |
idle | Also warms for up to 30 minutes after the last request, in case you write again soon |
idle costs the most: most warmings between requests aren't followed by a new request in time.
Warming stops one hour after the last real request in a task (30 minutes between tasks), when you turn the mode off, and when the conversation moves elsewhere: you switched to another branch or session, or the context was compacted.
How to turn it on
Warming is off by default. Turn it on with explyt config in the terminal. This setting isn't in the /settings menu:
explyt config set cacheWarming streaming # or idle
To check the current value and turn it off:
explyt config get cacheWarming
explyt config set cacheWarming off
You can also ask the agent in the chat: Turn on cache warming. It explains the trade-off and changes the setting.
The setting is stored in the agent's own settings, not in .explyt/settings.json, and applies to all projects. A change applies to sessions started after it. The /session command in the terminal shows the current warming decision for the session.
Which models it works with
Only models with a known cache lifetime. In the built-in catalog, these are Anthropic (Claude) models: the cache lives 5 minutes, or 1 hour if the agent is started with the EXPLYT_CACHE_RETENTION=long environment variable.
Warming doesn't work:
- with models from other catalog providers, since their cache lifetime is unknown;
- with Explyt account models and your own providers, since they have no cache lifetime or price set, so the benefit can't be estimated;
- with Claude models that reason with a fixed budget rather than adaptively.