Inspiration

Feeding a 200,000-token CI build log to an LLM works — and it's expensive. Compression tools promise to cut that cost, but every one of them ships a single marketing number and no way to check it on your workload. Practitioners are left to adopt compression blind or refuse it blind. We wanted a tool that answers the only question that matters: is the cheaper answer still correct?

What it does

TokenAudit (ships as the paritok-bench CLI) replays a real workload twice — once straight to the provider, once through the Paritok proxy — and reports cost and quality side by side. Then it turns that into a CI gate, so a prompt change that quietly makes your agent more expensive fails the pull request instead of shipping.

Our demo workload is a CI-failure triage agent that reads an entire failed build log and tells you what broke, which test failed, and where the fix goes.

What we built

  • A paired A/B harness where the two arms differ only in whether the request traverses the Paritok proxy — same fixture, same model, same pinned settings, so the comparison is causally valid.
  • Token counts read from the provider's own usage field, never a local estimate. A response without usage is excluded, never defaulted to zero.
  • A structural grader, a regression gate, and an HTML report that pins git SHA, model, and Paritok version so every number is reproducible.
  • A keyless demo: pytest runs Against a real failing GitLab-runner CI log with a 40-tool coding-agent catalogue attached, the provider's own usage reported 40.9% fewer input tokens through Paritok's tool-discovery pipeline — 10,299 → 6,083 tokens, 4,216 saved on a single turn. It reproduced three independent ways and both repeats were byte-identical.

We deliberately do not publish this as a headline: at 1 fixture × 2 repeats the harness stamps it PRELIMINARY and refuses to publish — the exact discipline the tool enforces on everyone else.

What we learned

The hardest bug was in our own storefront: a fact-check found the marketing site telling visitors to run commands and flags that didn't exist. For a tool whose entire purpose is failing a PR that ships an unverified claim, that was the precise failure mode it exists to catch. New rule: a command in documentation is a claim, and gets executed before it ships.

Challenges

  • GitHub Actions logs require auth (403 unauthenticated), so harvesting real fixtures needed a token.
  • The 4B content-compressor has a ~4k-token input ceiling and silently echoes above it — so end-to-end content compression needs proxy-side chunking, which we documented honestly rather than papered over.

Built with

Paritok, Python 3.11+, Apache-2.0.

Built With

Share this project:

Updates

posted an update

This is feedback from side, lack of time form my side i could'nt upload it

What worked:

  1. Tool-discovery on CPU - The embedding strategy (bge-small-en-v1.5) delivered 40.9% real savings with zero GPU. This is the killer feature: developers can adopt compression without infrastructure changes.
  2. The /api/test health endpoint - GET /api/test returning {gpu_available, message} was essential during the outage. Made it trivial to confirm when the server was back vs. local config issues.
  3. Graceful degradation - When the 4B server echoed inputs above the ceiling, it returned valid content (the original) rather than erroring. The system stayed usable.

What broke:

  1. Undocumented input ceiling - The 4B compressor has a ~4k-token (~8k-char) ceiling and silently echoes above it. This is fine behavior but needs to be in the docs, ideally with a response header (X-Paritok-Skipped: input_too_large) so the proxy can log/chunk intelligently.
  2. Proxy doesn't pre-chunk - It hands whole tool-result segments to the server. For real CI logs (15k+ tokens), this guarantees echo → 0% end-to-end. A max_chunk_size config with smart sentence-boundary splitting would fix it.

What's missing:

  • Compression metadata in the response - Return {original_tokens, compressed_tokens, model_version, skipped, skip_reason} in the /compress response body. Right now the only signal that compression happened is comparing lengths. Telemetry/debugging need the actual numbers.

Log in or sign up for Devpost to join the conversation.