Public beta Sharding enclave attested on Intel TDX. Real models answer through the API. Relay exits are planned. See what is live

Gateway · · 3 min read

Long requests are now cut to the sentences that answer them.

A long document with one question at the end used to reach the model whole. Now the gateway keeps the sentences that answer the question and drops the rest before any model, or the enclave, sees the request. On long documents that is 63% fewer prompt tokens and 63% less cost, and on 100 measured questions the answers did not change.

What changed

Every message over 1,500 estimated tokens is now compressed before it is routed. The compressor splits the message into sentences, scores each one against the instruction in the message with BM25, keeps the best in their original order under a cap of half the tokens, and keeps a heading whenever anything under it is kept. There is no model in the loop: it is about 200 lines of code, it runs in milliseconds, and nothing leaves the gateway. The same code runs inside the enclave for sealed requests, which the gateway cannot read.

It is on by default. X-Wispr-Compress: off sends a request as typed, a number from 0.1 to 0.9 forces that cap, and the dashboard has the switch under Settings. When it ran, the receipt says so.

receipt
"wispr": {
  "compression": { "tokens_before": 9123, "tokens_after": 3181, "saved": 0.651, "cap": 0.5, "messages": 1 },
  "tokens": { "in": 2916, "out": 18 },
  "cost_usd": 0.000601
}

How we measured it

100 questions from SQuAD, each asked over the whole Wikipedia article it comes from (7,000 to 11,000 prompt tokens), through three models: dolphin-mistral-24b on Venice, gemma-4-26b-uncensored in a Phala TDX enclave and claude through OpenRouter. Every question went once per arm at temperature 0 and was scored with the standard exact match and F1 against the gold answers. 1,500 calls, zero errors, $6.98. Prompt tokens and cost are what the providers billed.

CapPrompt tokens savedCost savedF1 change (95% CI)Worse / same / better
50% (the default)62.8%62.5%+1.0 [-0.9, +3.0]9 / 272 / 16
30%74.3%73.9%-0.4 [-2.4, +1.8]14 / 269 / 14
15%85.2%84.7%-0.5 [-2.5, +1.5]15 / 264 / 18

At the default cap every model's interval covers zero, in both runs. The pooled estimate is slightly positive: a shorter prompt with the right sentences in it is an easier prompt. The full tables, per model and per run, are in the repository.

How to check it

terminal
npm i wispr-compress                 # the library, MIT, no dependencies
node bench/run.mjs --dry              # your documents, no model call, no cost
node bench/run.mjs --key key.txt      # the full run against any OpenAI compatible endpoint

The code, the benchmark script and both result sets are at github.com/wisprxyz/wispr-compress. The benchmark data is public and downloaded at run time, the sample is seeded, so a run can be repeated.

What it does not do

It does not touch short requests, code, or a request whose instruction asks for the whole text: summarise, translate, rewrite, review and their kind go through as typed. It finds sentences by the words they share with the question, so a question phrased with none of the document's words keeps the wrong sentences; off is one header away. The figures above are one task family, span answers over long articles. Run the dry benchmark on your own documents before you rely on it elsewhere, because a saving that costs the answer is not a saving.