From ecadcfa7a1e549d6ddb8611bdf44cac852064cea Mon Sep 17 00:00:00 2001 From: t Date: Fri, 12 Jun 2026 13:57:26 -0600 Subject: anthropic prompt caching --- libpanto/src/config.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpanto/src/config.zig') diff --git a/libpanto/src/config.zig b/libpanto/src/config.zig index 4aae81f..7e1e8e1 100644 --- a/libpanto/src/config.zig +++ b/libpanto/src/config.zig @@ -101,6 +101,18 @@ pub const AnthropicMessagesConfig = struct { /// between tool calls. Ignored when `thinking == .adaptive` (interleaving /// is automatic there) or `.disabled`. thinking_interleaved: bool = false, + /// Place one `cache_control` breakpoint on the last cacheable block of + /// each request, replicating Anthropic's "automatic caching" (a single + /// advancing breakpoint) via the broadly-supported per-block marker + /// rather than the top-level field. + /// + /// Defaults on: for a normal append-only multi-turn session it's a + /// near-pure win (reads 0.1x base input vs. a one-time 1.25x write). + /// Set false when the workload makes that write premium unrecoverable + /// — e.g. one-shot requests, or an embedder that aggressively rewrites + /// history so prefixes are never reused. There the 1.25x write is pure + /// overhead with no read to amortize it. + prompt_cache: bool = true, }; /// Per-provider transport/auth/model configuration. Tagged by `APIStyle`. -- cgit v1.3