summaryrefslogtreecommitdiff
path: root/libpanto/src/config.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-12 13:57:26 -0600
committert <t@tjp.lol>2026-06-12 14:27:18 -0600
commitecadcfa7a1e549d6ddb8611bdf44cac852064cea (patch)
tree45b11c9bff35f49bdf1f7e14c89cd244453ace0c /libpanto/src/config.zig
parent25ddca9ef0de807e45be1f432f841336e4be29d2 (diff)
anthropic prompt caching
Diffstat (limited to 'libpanto/src/config.zig')
-rw-r--r--libpanto/src/config.zig12
1 files changed, 12 insertions, 0 deletions
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`.