A JOURNAL OF ARTIFICIAL INTELLIGENCE
my ai daily

Prompt Caching Setup: Cut LLM Latency on Claude & OpenAI

Academic testing shows prompt caching cuts agent API costs 41%–80% and TTFT latency 13%–31%—but GPT-6.2 appends top-level instructions after input, quietly busting caches unless you reorder payloads cleanly and configure Claude’s dual TTL breakpoints.

AI-generated editorial illustration showing a locked sequence of translucent glowing amber glass prefix blocks feeding a faceted cyan optical prism beside a neatly detached clear modular end-cap block on a dark slate bench.
AI-generated illustration / my ai dailyIllustrative image.

THE STORY IN THREE POINTS

  • Across 500+ multi-turn research-agent sessions with 10,000-token system prompts evaluated in arXiv 2601.06007v2 ("Don’t Break the Cache"), working prompt caches cut total API costs by 41%–80% and reduced Time to First Token (TTFT) by 13%–31% across providers.
  • Critical GPT-6.2 Responses API gotcha: starting with GPT-6.2, OpenAI appends top-level instructions after the input array; any shared reusable prompt left in top-level instructions misses the prefix cache completely and bills at full uncached rates unless moved into a leading developer message.
  • On Anthropic’s Messages API, caching obeys strict byte-identical prefix order (tools -> system -> messages), supports mid-messages system entries (added May 28, 2026) to avoid full-history busts, offers 5-minute vs 1-hour TTL breakpoints, and benefits from boot-time warm-up pings.

How prefix caching slashes TTFT by 13%–31% in long-horizon agents

Every time an autonomous coding or research agent calls an LLM API with a 10K-to-100K-token bundle of tools, schemas, and repo context, repeating prefill computation inflates both spend and Time to First Token (TTFT). Testing over 500 long-horizon agent sessions in arXiv 2601.06007v2 ("Don’t Break the Cache") found that properly stabilized prompt caches reduce API costs by 41%–80% and speed up TTFT by 13%–31% across major providers.

Building on our earlier coverage of OpenAI Codex’s persistent caches and 12-hour API caching, OpenAI Decisions API, and cross-provider cache rate tables, engineers ship real latency wins by avoiding silent prefix-order traps rather than tuning prompts alone.

OpenAI GPT-6.2 Responses API trap: move reusable prompts out of top-level instructions

On September 22, 2026, OpenAI’s GPT-6 prompt caching update expanded automatic shared-prefix reuse (30-minute default window, paired October 20 with an optional 12-hour Responses API lifetime) and added cache-prewarming plus miss diagnostics. Yet OpenAI’s official GPT-6.2 developer documentation flags a subtle behavior shift capable of silently breaking cache hit rates during upgrades.

Starting with GPT-6.2 models (including Astra and Sol), the Responses API appends top-level instructions after input. Any reusable prompt text, rubric, or shared policy left in top-level instructions shifts behind changing conversation turns and becomes uncacheable. Move static shared rules into a developer message placed at the start of input, keep top-level instructions solely for per-turn dynamic guidance, and keep model snapshots pinned with stable tools and reasoning settings.

Anthropic Messages API: strict byte-match order, 5m vs 1h TTL, and May 28 system placement

Anthropic’s Messages API caches exact byte-identical prefixes in strict sequence—tools first, then system, then messages—up to explicit cache_control breakpoints (typically billing reads at 10% of base input or even steeper 95%–97.5% discounts on Claude 5.5 and Fable 5.2). Modifying a single JSON tool schema key forces a re-write across everything downstream.

As documented in Shattered.io’s November 4 Claude caching guide, Anthropic resolved a major mid-session busting pain point on May 28, 2026 by letting developers place system entries directly inside the messages array so dynamic state changes do not wipe earlier cached context. Pair stable system and tool definitions with either default 5-minute ephemeral breakpoints (1.25x write) for steady traffic or explicit 1-hour breakpoints ({"type": "ephemeral", "ttl": "1h"}, 2.0x write) when human-in-the-loop pauses routinely exceed five minutes.

Production hygiene: deterministic JSON tools, pinned snapshots, and boot warm-ups

Three implementation habits keep production hit rates consistently above 90%: serialize tool schemas with sorted keys rather than unstable runtime maps, lock exact dated model snapshot IDs so seamless backend alias bumps do not reset your entire cache fleet simultaneously, and track cache_read_input_tokens ratio as a first-class SLO.

For latency-sensitive interactive apps where cold first turns hurt UX, Cadence’s Anthropic engineering guide recommends prewarming caches at service startup—illustrated by dispatching a minimal max_tokens: 0 request carrying your static tools and system prefix before routing live user sessions.

Sources: Better Prompt Caching for GPT-6|OpenAI ↗ Using GPT-6.2 (Responses API Instructions & Caching)|OpenAI Developers ↗ Prompt Caching on the Claude API: 12 Steps [2026]|Shattered.io ↗ Don’t Break the Cache: Prompt Caching for Long-Horizon Agentic Tasks|arXiv ↗ Prompt Caching With Anthropic API: Complete Guide|Cadence ↗

THE BROADER CONTEXT · FRONTIER LABS DOSSIER

Explore full product specifications, pricing analysis, and continuous coverage in the Frontier Labs Desk Hub and Others Dossier. Independent benchmarks available on the AI Intelligence Index and Coding Agents Leaderboard.

02The next story

News

Ollama Context Length: Why It Caps at 4K & How to Fix It

Ollama silently locks context at 4,096 tokens on machines under 24 GiB VRAM—and setting OLLAMA_NUM_CTX or passing num_ctx to /v1/chat/completions does nothing. Here is the OLLAMA_CONTEXT_LENGTH fix and how to verify it with ollama ps.

ComfyUI Out of Memory Fix: DynamicVRAM & Batch Leaks

ComfyUI’s 2026 DynamicVRAM and AIMDO allocator made pre-March --lowvram flags useless—introducing second-run non-OOM crashes, WSL Shared GPU memory locks, and HostBuffer errors. Here is the symptom-by-symptom CLI and BatchPipe fix.

Best Local LLM for Coding: Picks by 16GB, 24GB & 64GB

Autocomplete-only models crash inside Cline, Aider, and OpenCode. Filtering strictly for native Ollama tool calling and permissive open weights yields clear November 2026 picks across 16GB, 24GB/32GB, and 64GB+ workstations.

Follow your curiosity.

EXPLORE THE ARCHIVESOURCES & CONTEXT INCLUDED