Every token in your prompt is a recurring bill.

Cut the ones that don't change the answer — measured on your data, not guessed.

Shrink the prompt. Keep the accuracy. Ship it.

Shrink

An optimizer searches rewrites of your prompt and scores each one on your labeled examples. A 97-token extraction prompt came back as 6 tokens. How it works →

Keep

You set the accuracy floor. Every candidate is judged on a held-out set the optimizer never saw, and you read the whole tokens-vs-accuracy front, not one number. The findings →

Ship

Every node in the tree shows each step's prompt diffed against its parent. The root is what you typed, the best node is what you ship: a plain shorter prompt, nothing extra at inference. The example →

What is prompt compression?

Finding the shortest prompt that still does the job — measured, not guessed. You give it your prompt, a labeled dataset and an accuracy floor; an optimizer searches rewrites and hands back the tokens-vs-accuracy trade-off. The result is a plain shorter prompt: nothing extra at inference time, no model in the request path.

Before · 97 tokens · held-out F1 0.984
You are an information extraction system. Read the passage below carefully and extract the full names of every person who is mentioned. Include each person only once, preserve the order in which they first appear, and do not include organisations, places, or pronouns. Titles such as Dr. or Professor are not part of the name. If no people are mentioned, return an empty list.

Passage:
{text}
After · 6 tokens · held-out F1 0.965
Extract human names from: {text}
97
6

Compression v2 experiment, 12 seeds × 2,000 rollouts, Amazon Nova Micro, total cost $0.41 — full tables and front plots.

Why it pays

Prompt tokens are the part of the bill you pay on every call, forever, and agentic systems multiply the calls.

$2–4k
per month saved by trimming ~80 prompt tokens from a system that makes 10M calls a month at $2.50–$5 per million input tokens.
80 tokens × 10M calls = 800M tokens/month. Do it with your numbers →
35%
average increase in cloud spend attributed to unmonitored token usage at enterprises using generative AI.
3–6
prompts in a typical agent loop, each run several times per task. The summarizer runs once per tool call, so its tokens compound fastest.

Two ways to run it

The same optimizer, as a library and as a studio.

Open source

bpto — the engine

A Python library. Define a task (root prompt, dataset, scorer, objective), compose search operators, run with a budget and checkpoints. Every number on this site was measured with it. There is a Claude Code skill that runs it for you.

github.com/sign-of-fourier/bpto

Studio

Impromptune

Every step without writing code. Draw the program, attach your labeled data, run a pilot for the cost, watch the tree grow, and read the compressed prompt off each step.

Open Impromptune

Frequently asked questions

How is this different from LLMLingua-style compression?

LLMLingua compresses the input of each request at inference time by dropping low-information tokens, and needs a small model in the request path. promptcompression.ai compresses the prompt template once, at optimization time, by searching over rewrites and scoring them on your data. The result is a plain shorter prompt with nothing extra at inference. The two compose: a compressed template with compressed inputs.

Does compression hurt accuracy?

It's a trade-off you control. You set the accuracy floor; the optimizer minimizes tokens subject to it and reports the whole Pareto front, so you choose the operating point. Always read the held-out number, not the training number.

How much data do I need?

Enough to detect the differences you care about. 100 training examples plus a held-out set was enough to separate search strategies in our compression runs; 30 was not. If you have production traces, you already have the data.

Which models does it work with?

Any: Amazon Bedrock and Anthropic models directly, and anything with an OpenAI-compatible endpoint (OpenAI, vLLM, Ollama, OpenRouter). The optimizer only needs a client that returns completions.

Is compression all it does?

No — it's one objective of a general prompt optimizer that also climbs accuracy, format compliance and latency, for single prompts and for multi-step agents. That larger story is on quantecarlo.com.

Is it open source?

The engine, bpto, is open source on GitHub. Impromptune, the studio, is a hosted product built on it.