OsparLabs TokenShrinker

v1.0.0 — Windows, macOS, Linux

Your agent just retried the same failing call forty times.

TokenShrinker is a local proxy that catches runaway loops before they reach a provider, compresses the dynamic context that prompt caching cannot touch, and scans for secrets on the way out. It runs on 127.0.0.1 — your prompts never reach us.

Local models via Ollama work offline, free, with no subscription.

What it actually does

Every figure below is measurable on your own prompts inside the app.

Agent loop breaker

A retry loop can burn a month of budget in ten minutes. Near-identical calls are detected locally and blocked before they reach a provider. Blocks expire on their own, so a false positive never strands you.

Costs nothing when it is wrong

Structural compression

JSON, logs and stack traces are the context that prompt caching cannot help with, because it changes every request. Measured on real payloads: 69% on JSON row dumps, 88% on log streams, 61% on stack traces.

JSON verified by round trip

Secret pre-flight

Prompts are scanned locally for API keys, private keys, database URLs and card numbers before anything leaves your machine. You choose: redact, send anyway, or cancel. Detection is pattern-based and says so.

Warns, never silently scrubs

Shadow Mode

Measure what compression would save while your original prompts are forwarded untouched. Zero risk, real numbers, on your own traffic. Turn it off when the diffs convince you.

Prove it before you trust it

Cache alignment

Providers discount cached input by 50–90%, and dynamic tool ordering silently destroys those hits. Tool arrays are sorted deterministically and cache breakpoints placed automatically.

No SDK changes

Runs on your machine

A proxy bound to 127.0.0.1 that refuses non-loopback callers. Your prompts are processed in memory and never reach us. We could not read them if we wanted to.

Not a cloud gateway

One line changes

Point your SDK, agent framework or editor at the local proxy. Everything else stays as it is — your keys, your models, your code. Anything the proxy does not handle is forwarded untouched.

  • Works with Cursor, Claude Code, Aider, LangChain, CrewAI and anything speaking the OpenAI or Anthropic API
  • Streaming passes through chunk by chunk, with no buffering step added
  • Bypass any single call with the header x-tokenshrink: off
.env
# Point any OpenAI-compatible client here
OPENAI_BASE_URL="http://127.0.0.1:1337/v1"

# Anthropic SDKs append /v1 themselves
ANTHROPIC_BASE_URL="http://127.0.0.1:1337"

Download

Version 1.0.0. Free to try with local Ollama models.

Windows

10 or 11, 64-bit
Download for Windows

Installer (.exe)

Portable

macOS

Apple silicon and Intel
Download for macOS

Disk image (.dmg)

Intel (.dmg)

Before you install

These builds are not yet code-signed. Windows SmartScreen will warn on first run — choose More info → Run anyway. macOS will ask you to right-click the app and choose Open the first time. We are working through signing for both platforms.