Choose where the request runs.
Routers such as OpenRouter select among models and providers using signals such as task, price, latency, throughput, and availability.
Source: OpenRouter routing ↗UsageTap context intelligence · Engineering field notes
Public source + evidence ledgerThat early result came from profiling two context-heavy workloads—not a universal benchmark. It led us to build a safer optimization loop: measure every call, protect what must survive, prove each change, and send the right context for the right prompt to the right model.
Observed request shape
At 20–30M input tokens per day, input efficiency is not a cleanup task. It is part of application architecture.
A different optimization layer
These products solve different jobs and can work together. UsageTap sits at the application layer, where prompts, context, models, responses, costs, latency, and outcomes can be evaluated as one system.
Routers such as OpenRouter select among models and providers using signals such as task, price, latency, throughput, and availability.
Source: OpenRouter routing ↗Compressors such as The Token Company use specialized models to remove low-signal tokens from documents, websites, transcripts, and other text.
Source: The Token Company compression ↗Turn real prompts, responses, latency, cost, and application outcomes into evidence for what to compact, protect, cache, retrieve, compress, or omit—and which model should receive it.
More representative traffic creates better workload evidence—not permission to remove context blindly.
The UsageTap learning loop
Usage tracking is not only a billing record. It is the evidence layer for workload-specific context optimization: what changed, what was saved, and whether the answer still did its job.
Track input, output, latency, cost, model, and application outcome—not just an aggregate token bill.
Split context into meaningful pieces and build evidence about which instructions, records, structures, and roles affect the response.
Remove, rewrite, or compact one piece at a time and compare downstream quality before turning a finding into a rule.
Send the right context for the prompt and model, then use the resulting traffic to improve the workload profile again.
Today, UsageTap measures calls and applies deterministic, protected, and selective compression. This is an evidence loop, not automatic retraining: context-removal rules remain research work and require workload-specific quality evidence before production use.
What changed our approach
A benchmark on plain text did not predict performance on production prompts. Profiling the actual mix of prose and structured context did.
Read the LLMLingua-2 paper ↗The 5–10% and 30–40% figures on this page are early observations from two context-heavy workloads. They are not production guarantees; results vary by prompt mix, tokenizer, model, and quality threshold.
01 · Our starting point
We began with Microsoft’s 2024 LLMLingua-2 model. It was effective at removing low-value words from plain text, but protecting important context kept us at a conservative 0.15–0.20 aggressiveness setting.
02 · The workload mismatch
Real application prompts contained large JSON and HTML blocks. A word-level model produced marginal gains and could damage the structures the downstream model depended on.
03 · The production lesson
The runtime now applies structured transforms only when parsing, equivalence, round-trip, and tokenizer-savings gates pass. LLMLingua-2 sees eligible prose—not the whole prompt—and its output is rejected if protected content or integrity checks fail.
The production pipeline
Only about 20% of prompts in our early two-tenant profile warranted LLMLingua-2 compression. Fast skip guards avoided unnecessary model calls and improved compression throughput by as much as 20× in that profile. The current runtime also gates on exact-output instructions, eligible prose, structured and protected density, expected savings, and latency budget.
On role-aware requests, keep stable system and developer instructions byte-stable; operate on eligible user text.
Find prose, JSON, HTML, code, UI contracts, critical clauses, and explicit no-compress spans.
Transform eligible JSON or full-page HTML only after the configured safety, equivalence, and savings gates pass.
Skip exact-output, highly structured, low-opportunity, or latency-constrained requests.
Run LLMLingua-2 only on eligible prose, with protected regions represented by required placeholders.
Restore placeholders and check protected literals, code, JSON, constraints, required terms, and relationships.
Reject unsafe output, return the deterministic or unchanged text, and count zero model savings.
The promotion contract
We do not promote a transform because one benchmark arm produced a smaller prompt. It must save real tokenizer tokens, preserve hard constraints, pass downstream checks, repeat cleanly, and hold up on data that was not used to discover it.
Compare the same prompt across unchanged, deterministic-only, model-only, and combined conditions.
Promote a transform only when the target tokenizer records a real absolute and relative saving.
Protected literals, code, JSON, constraints, and required terms must survive every accepted output.
Test negation, obligations, permissions, scope, formats, and entity-value relationships—not similarity alone.
Require stable output hashes, skip reasons, and rollback reasons across repeated runs.
Keep discovery data separate from evaluation data and report zero-application cohorts, too.
Current public posture: safety shielding and rollback are permanent defaults; experimental savings transforms remain unpromoted until held-out evidence clears the contract.
See every decision and cohort ↗Before runtime
Many system instructions were verbose, contradictory, or arranged in ways that reduced cache reuse. Rewriting the source prompt produced a 30% reduction in system-instruction size in our work so far.
Input-token caching also improved, but we have not measured that gain rigorously enough to publish a number.
An upfront rewriter removes repetition, weak phrasing, and unnecessary instruction scaffolding before a prompt reaches production.
Open the prompt rewriter →A linter flags prompt quality issues and ordering choices that work against input-token caching and repeatability.
Open the prompt linter →Current research problem
In progressSystem instructions and application context often contain pieces the model does not use—but removing the wrong piece can change the answer. Our profiler now splits a completed call into meaningful units and classifies each unit’s purpose and likely need.
The next entropy experiments remove those pieces one at a time, rerun the prompt, and measure response sensitivity. The open question is whether those results can become a real-time rules engine that drops irrelevant context without reducing response quality.
Follow the live Compress research →Profiler → assessment → rules
Break the system instructions, context, prompt, and response into meaningful pieces.
Label each piece by purpose, dependency, and likely need.
Run controlled experiments with one piece omitted or transformed.
Measure how the response changes, not only whether tokens were saved.
Turn repeatable findings into real-time rules for future prompts.
The working thesis
The future is not “compress every prompt.” It is “send the right context for the right prompt to the right model.”
A measured starting point
Bring representative prompts. Measure structure, savings, latency, risky removals, and downstream behavior before changing production traffic.