Open Source / Developer Tool

Stop Overpaying
for LLM Calls.

A printerly, monochrome caching layer for Anthropic, OpenAI, and Gemini. Wraps your SDK client. Injects cache breakpoints. Tracks savings. 60–90% off your API bill.

CACHE HIT RATE
0%
COST REDUCTION
0%
DEPENDENCIES
0
GZIPPED
0KB
The Problem
WITHOUT CACHELLM
call 1 → system_prompt (2000tk) → FULL PRICE
call 2 → system_prompt (2000tk) → FULL PRICE
call 3 → system_prompt (2000tk) → FULL PRICE
$300/mo
WITH CACHELLM
call 1 → system_prompt (2000tk) → CACHE WRITE
call 2 → system_prompt (2000tk) → 90% OFF ✓
call 3 → system_prompt (2000tk) → 90% OFF ✓
$40/mo
How It Works
01
ANALYZE

Scans your prompt structure — system instructions, tool schemas, conversation history.

02
SCORE

Rates each segment by stability using djb2 content hashing across requests.

03
INJECT

Places cache_control breakpoints at optimal positions. Up to 4 per request.

04
TRACK

Monitors cache hit rates and calculates real dollar savings per request.

// one line change
import Anthropic from '@anthropic-ai/sdk'
import { optimizeAnthropic } from 'cachellm'
const client = optimizeAnthropic(new Anthropic())
const res = await client.messages.create({
model: 'claude-sonnet-4-20250514',
system: 'You are a helpful assistant...',
messages: [{ role: 'user', content: 'Hello' }],
})
client.printStats() // see savings
Supported Providers
Anthropic
Claude
SAVINGSup to 90%
METHODcache_control injection
TTL5min / 1hr
OpenAI
GPT
SAVINGSup to 50%
METHODPrefix reordering
TTL5–10min auto
Google
Gemini
SAVINGSup to 90%
METHODCachedContent API
TTLConfigurable
Cost Projection
SCALEBEFOREAFTERSAVED/DAY
100 req/day$9$1.35$7.65
500 req/day$45$6.75$38.25
1,000 req/day$90$13.50$76.50
10,000 req/day$900$135$765

Based on Claude Sonnet, 3K token system prompt, 90% cache hit rate.

Cost Calculator
100 req/day
3,000 tokens
WITHOUT CACHELLM
$40.50/mo
WITH CACHELLM
$36.45/mo
MONTHLY SAVINGS
$4.05
10%
Design Principles
Zero dependenciesNo tiktoken (3MB), no Redis, no external services. Token estimation uses a fast heuristic.
Zero infrastructureEverything runs in-process. No proxy, no database, no config files.
Zero code changesWraps your existing client via Proxy. All methods, props, and types pass through.
Under 15KB gzippedSmaller than most favicons. Ships as ESM and CJS with full type definitions.