← All notes

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.

See also

Claims

Sources

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

Permanent ID: iil:note:yv839kkw

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.},
}

Markdown

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.