Cache eval model outputs, and reuse CLI token cache when it is available
Answer: Inspect can cache model output to reduce API calls. Gemini CLI can reuse previous system instructions and context through token caching when you authenticate with an API key.
Why it matters
There are two types of caching available. Gemini CLI automatically optimizes API costs through token caching. Inspect local caching works for all models.
Token caching is available for API key users and Vertex AI users. Provider level caching currently works only for Anthropic models. Token caching is not available for OAuth users.
Use the cache option of GenerateConfig to activate the use of the cache. This feature reuses previous system instructions and context. By default, model responses are cached for 1 week. You can view your token usage and cached token savings using the /stats command.
Two kindsInspect local caching and provider level cachingDefault lifetimeCached for 1 weekCLI statsCached token savings using /stats
See also
Claims
- id: C1 claim: Inspect offers both local caching and provider-level caching. source: S1 evidence: "There are two types of caching available"
- id: C2 claim: By default, Inspect caches model responses for one week. source: S1 evidence: "By default, model responses are cached for 1 week"
- id: C3 claim: Gemini CLI can optimize API costs through token caching. source: S2 evidence: "Gemini CLI automatically optimizes API costs through token caching"
Sources
- [S1] Caching. Inspect AI. https://github.com/UKGovernmentBEIS/inspect_ai/blob/main/docs/caching.qmd . License: MIT. Accessed 2026-11-22.
- [S2] Token caching and cost optimization. Gemini CLI. https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/token-caching.md . License: Apache-2.0. Accessed 2026-11-22.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Inspect AI caching docs (MIT); Gemini CLI token-caching.md (Apache-2.0). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Inspect AI caching docs (MIT); Gemini CLI token-caching.md (Apache-2.0). Text was condensed and changed from the originals.
Cite this
iinventedlight. 2026. "Cache eval model outputs, and reuse CLI token cache when it is available." iinventedlight Library, iil:note:yv839kkw, version of 2026-11-22. https://iinventedlight.com/library/notes/inspect-eval-caching/. License: CC-BY-4.0.
@misc{iil_note_yv839kkw,
author = {{iinventedlight}},
title = {{Cache eval model outputs, and reuse CLI token cache when it is available}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-22},
url = {https://iinventedlight.com/library/notes/inspect-eval-caching/},
note = {Permanent ID iil:note:yv839kkw. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/inspect-eval-caching.md.