Repository navigation
v0.1.0 — initial public release
cache-assembler rewrites Anthropic Messages API requests to maximize prompt-cache reuse — a small, dependency-free library and standalone HTTP proxy. MIT licensed.
Headline result: an identical 100-turn conversation sent to the real Anthropic API twice — once directly, once through the proxy — cost $1.33 direct vs $0.16 proxied (Claude Haiku 4.5, real API, zero errors in either arm). An 8.2x cost reduction, evidenced with raw data and a reproduction script anyone can run against their own Claude subscription.
Full validation report, mechanism study, and known limitations: docs/validation-report.md
Features (each individually toggleable)
- F1 Canonicalization — deterministic key ordering for tool definitions
- F2 Breakpoint placement — places up to 4
cache_controlbreakpoints at the highest-value boundaries - F3 Volatile-byte deferral (opt-in, off by default) — relocates session-unique spans out of the stable prefix
- F4 Write barrier — coordinates concurrent requests so only one pays the cache-write cost
- F5 Telemetry — tracks cache reads/writes/tokens and estimates dollars saved
Install
npm i cache-assembler
# or run as a standalone proxy:
npx cache-assembler --upstream https://api.anthropic.comSee README for the three ways to use it (library, proxy-manager chain hop, standalone binary).