◈ Token Compression Engine
Your prompts are verbose. Your models don't need them to be.
TokenShrink compresses prompts — measure savings before use. Works with Claude, GPT, Gemini, Ollama — any LLM. Open source ↗
Savings vary by prompt and tokenizer ·
Works with 8 AI providers ·
Open-source regression suite
Works with every LLM provider
2026-07-31 – 2026-08-29
How It Works
Paste your prompt
System messages, user prompts, documents — anything you send to an LLM.
We compress it
Our engine replaces verbose phrases with short codes and prepends a tiny decoder header.
Use fewer tokens
Use the compressed version in your API calls. Review the output and measure savings with your model tokenizer.
Real-World Savings
Cut API costs 20-35%
Try verbose system instructions with your own evaluation set. Compare token counts and answer quality before adoption.
Faster Claude Code sessions
Compress your CLAUDE.md and project context. Smaller prompts = faster responses. The session vocabulary feature pays for itself in 3 messages.
Production prompt pipelines
Running the same system prompt 10,000x/day? TokenShrink SDK compresses once, reuses everywhere. Drop-in npm package, zero config.
Drop-in SDK
Two lines of code. Automatic compression on every API call.
import { compress } from 'tokenshrink';
import OpenAI from 'openai';
// Compress your system prompt
const { compressed, stats } = compress(longPrompt);
console.log(`Saved ${stats.tokensSaved} tokens`);
// Use with any LLM — OpenAI, Anthropic, local models
const openai = new OpenAI();
const res = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'system', content: compressed }],
});npm install tokenshrinkWorks with your stack
Start saving tokens
in 30 seconds
No account required. No credit card. Open source. Paste your prompt and see the savings instantly.