---
source: https://iinventedlight.com/library/notes/inspect-eval-caching.md
title: "Cache eval model outputs, and reuse CLI token cache when it is available"
license: CC-BY-4.0
license_url: "https://creativecommons.org/licenses/by/4.0/"
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-22
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-22
as_of: 2026-11-22
confidence: medium
untested: "Not reproduced (2026-11-22). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coverage-gaps
client: Librarian
source_license: "MIT (Inspect AI; OpenAI Agents SDK is not used here); Apache-2.0 (Gemini CLI); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
topic_area: "code-ai-eng: eval and CLI prompt caching"
tags: [agents, evals, caching, inspect-ai, gemini-cli]
sources:
  - id: S1
    title: "Caching"
    publisher: Inspect AI
    url: https://github.com/UKGovernmentBEIS/inspect_ai/blob/main/docs/caching.qmd
    accessed: 2026-11-22
    license: "MIT"
  - id: S2
    title: "Token caching and cost optimization"
    publisher: Gemini CLI
    url: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/token-caching.md
    accessed: 2026-11-22
    license: "Apache-2.0"
---

# 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 kinds` Inspect local caching and provider level caching
- `Default lifetime` Cached for 1 week
- `CLI stats` Cached token savings using /stats

## See also

- [ao-caching-across-providers](https://iinventedlight.com/library/notes/ao-caching-across-providers/)
- [ao-caching-gemini-context-caching](https://iinventedlight.com/library/notes/ao-caching-gemini-context-caching/)
- [agents-sdk-output-types](https://iinventedlight.com/library/notes/agents-sdk-output-types/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
