Prompts are code.
Optimize them like code.

Most teams tune prompts by hand and hope they hold. We call the alternative prompt learning: treat a prompt like a model parameter — data in, objective set, optimizer runs, held-out set decides. promptcompression.ai applies it to manage prompts for stability, quality, efficiency and performance.

What is prompt compression?

Prompt compression is 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. It is one objective of a general prompt optimizer: the same loop also improves accuracy, format compliance and latency.

What is prompt learning?

Machine learning applied to prompts. A trained model has a dataset, a loss, an optimizer and a validation set. Prompt learning gives a prompt the same four things: labeled examples, an objective (accuracy, tokens, format, latency, or a combination), a search algorithm that proposes and selects rewrites, and a held-out set that decides. Prompt optimization is the search step; prompt compression is one objective. Why the search is hard →

Four things prompt learning delivers

Each one is measurable. Each one is optimizable. None of them survive a model upgrade on their own.

Stability

Prompts drift every time a model changes. A scored dataset turns "it seems fine" into a regression test you can re-run in minutes.

Quality

Accuracy, format compliance, judge scores — pick the metric that matters and let the optimizer climb it instead of guessing.

Efficiency

Shorter prompts, fewer tokens, lower latency. Compression is an objective, not an afterthought.

Performance

Trade accuracy against cost on a Pareto front and choose the operating point your product actually needs.

The numbers

Agentic systems multiply the number of prompts you run, and the number of times you run each one.

97 → 6
tokens: a name-extraction prompt compressed by bpto; held-out F1 0.984 → 0.965. Across 12 seeds: 6–29 tokens, mean 12–16.
Compression v2 experiment, Sept 2026 — see findings
40%
of enterprise applications will include task-specific AI agents by the end of 2026 — up from under 5% in 2025.
62%
of organizations are experimenting with or scaling agentic AI; 23% have a system in production.
35%
average increase in cloud spend attributed to unmonitored token usage at enterprises using generative AI.
$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.
Worked example: 80 tokens × 10M calls = 800M tokens/month. Your numbers will differ.
3–6
prompts in a typical agent loop (system, planner, tool formatter, summarizer, answer). Each one is a separate optimization target.

Two ways to run it

The same optimizer, as a library today and as a point-and-click studio next.

Available now

bpto — the open-source engine

A Python library. Define a task (root prompt, dataset, scorer, objective), compose search operators, run with a budget and checkpoints. Everything on this site was measured with it.

github.com/sign-of-fourier/bpto

Coming

promptcompression.ai Studio

Every step of bpto without writing code. Upload your labeled data, paste your starter prompt, pick an objective, watch the tree grow, and read the result off the Pareto front. No notebooks, no config files.

Get notified

Why prompts belong in your AI strategy

Agents multiply the prompt surface. A single chat assistant has one prompt. A ReAct-style agent has a system prompt, a planning prompt, a tool-call formatter, an observation summarizer and a final-answer prompt — and it runs each of them several times per task. Small inefficiencies compound per call, per step, per user.

Every model upgrade silently re-tunes every prompt. Prompts written for one model are not optimal for the next. Without a scored dataset and an optimizer, "upgrading the model" means re-doing the prompt work by hand, or not at all.

A measurable prompt strategy is the difference between a pilot and a product. Teams that treat prompts as versioned, evaluated, optimized artifacts ship faster and spend less. Teams that treat them as text in a config file discover regressions from customers.

The optimizer is abstract: it takes a starter prompt, a dataset and an objective, and searches. Compression, accuracy, format compliance, latency — same loop, different objective.

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.

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: Anthropic models directly, and anything with an OpenAI-compatible endpoint (OpenAI, vLLM, Ollama, OpenRouter, Bedrock via a proxy). The optimizer only needs a client that returns completions.

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.

Can I use it from Claude Code or another coding agent?

Yes — there is a step-by-step page written for agents and an installable skill file.

Is it open source?

The engine, bpto, is open source on GitHub. The point-and-click Studio is in development.