s2ar/ starlens · certified image compression
s2ar.dev

Compress the image. Prove the model still reads it.

Vision-LLMs bill by dimensions, not bytes. starlens shrinks every image you send and seals a per-model certificate that the answer survived — or hands you a certified refusal for free. You pay 20% of the tokens it proves it saved.

s2ar is "star", compressed. We compress things; it's the whole idea.

−67%
tokens on a 2560×1440 screenshot — 1533 → 513, certified
0.96–0.97
answer retention at 12–22% savings, 175-item held-out split
12,123
sealed VLM calls behind the measurements — every number replays
$0
for a certified refusal — when it can't shrink safely, you don't pay
The lab · live · replayed from real calibration

Drag the compression. Watch each model break.

image at the current compression
x1.0 · full size−0%
full sizecrushed →
Three ways in

One line in your agent, one call on your image.

01 · in your agent

Claude Code, one line

Your agent gains compress-before-you-send: every screenshot comes back smaller with a sealed certificate that your model still reads it the same. Refusals cost nothing.

claude mcp add stardata \
  -e STARLENS_API_KEY=sk-… \
  -- uvx stardata-mcp

Works in Codex and any MCP client; pip install stardata-mcp for the CLI (starlens estimate is free + local).

02 · straight to the api

A key, a browser, a certificate

Sign in with a one-time email link — no password. Compress a few images right in the browser, hold the sealed certificate in your hand, then take the same key to the API.

It speaks OpenAI: point a base_url at api.s2ar.dev/v1 and call stardata/starlens like any model.

03 · why it works

The measurements

  • JPEG quality 25 saves 0.0% — providers bill dimensions, not bytes. The billing math →
  • Naive pixel-error silently loses 42–50% of answers on held-out content — while reporting the best savings number. The RMSE trap →
  • A band that holds 100% on Claude drops GPT to 71% — transfer is one-directional. Name the model →
The certificate

Don't trust the compressor — re-run the seed.

Every response carries a sealed record: the exact bytes in and out, the witness that measured them, the drift it saw, the tolerance it held, and the model the guarantee names. The seal is a hash of all of it. Anyone can re-verify — free, no account, deterministic down to the seed.

# re-check any seal, yours or ours
curl https://api.s2ar.dev/v1/verify/<record_sha256>
# → re-runs the witness, recomputes the hash, returns the verdict
inside a sealed certificate
  • source / compressed — bytes, dimensions, sha256 of each
  • tokens — before / after / saved, at your provider's billing shape
  • fidelity — witness, drift, tolerance, verdict: isomorphic | moved
  • target — the model this guarantee names (transfer is one-directional)
  • seed + harness — everything needed to replay the measurement
  • record_sha256 — the seal. GET /v1/verify/… re-checks it
Why a witness, not just JPEG

Pixel-error is blind to what the model reads.

Plain RMSE calls a 640×360 render "identical" at 32×18 — because the image is mostly smooth. But the signal a model needs is high-frequency: small text, 1-cell texture, thin edges. starlens compresses against a witness of the reader's content — RMSE for coarse images, OCR for text, gradient-energy for render detail — so the certified band ends where the answer would move, not where the average pixel does. Every band is measured per model and sealed per request; re-verify it from the hash.

  • Measured, not asserted. Calibrated on claude-sonnet-4.6, gpt-4o-mini and llama-3.2-11b across text, UI, render and game corpora — where each model's answer actually breaks.
  • RMSE over-certifies its blind spots ~5×. The gradient-energy witness never does — that gap is the whole reason the witness exists.
  • The band is model-relative. A frontier reader isn't always the most robust — on some images the 11B open model reads deeper. The certificate names its target.
  • The witnesses are cheap. Millisecond, deterministic, re-runnable — the guarantee costs almost nothing to make or to check.
witness · render corpus
safe?
over-certs
recon (RMSE)
0.18
14 / 14
phash / dhash
0.15
14 / 14
grad (hi-freq)
1.00
0 / 14
Where this sits in 2026

Token compression research needs the model. This works on yours.

model-side · the research frontier

Prune, merge, resample — inside the model

Visual-token pruning, merging and resamplers reach 4–16× fewer tokens in the lab — by changing the vision stack itself. Powerful, and out of reach unless you own the weights and the serving path. Against a closed API, none of it applies.

input-side · starlens

Compress the input, certify the answer

starlens never touches the model. It shrinks what you send — to Anthropic, OpenAI, Google, anyone's billing meter — and proves per request, per model, that the answer held. Model-agnostic, deployable today, honest when it can't help.

Per-model technique

The technique adapts — by content, and by model.

Two dials tune every certificate. The witness is chosen by content — RMSE for coarse images, OCR for text, gradient-energy for render detail (the bake-off above). The tolerance is measured per reader: how far recon's band must tighten so it never outruns that model. Below are the models we've measured — strictest tolerance first; the chips are where recon over-certifies each one, so the certificate pulls back.

Wire it in

It speaks OpenAI. Point a base URL at it.

starlens is a model, not a proxy into your conversation — it sees only the image. Call it, get a smaller image plus a sealed certificate back, then send the small image to your real model every turn. Or self-host the same audited engine.

# one call compresses; every later turn is certified-cheaper
client = OpenAI(base_url="https://api.s2ar.dev/v1")
r = client.chat.completions.create(
    model="stardata/starlens",
    messages=[{"role":"user","content":[
        {"type":"image_url","image_url":{"url":data_url}},
        {"type":"text","text":"target:claude-sonnet-4-6 probe:auto"}]}])
# → r.choices[0].message.images[0]  = the compressed image
# → r.choices[0].message.content     = the sealed certificate (verify by hash)
Shape A · privacy-first

utility model

Sits on any OpenAI-compatible base URL. Never holds your key or sees your prompt — only the image. Not in your critical path: if it's down you lose the savings, not availability.

Shape B · one-hop

compressing meta-model

Call starlens/claude-sonnet-4-6; it compresses, forwards, returns the real answer, and bills on the tokens it saved. Same certificate, no workflow change.

Pricing

You pay a slice of what we provably saved you.

No per-image fee, no subscription required. Every request returns a sealed certificate measuring the tokens saved at your model's own billing shape; the charge is 20% of that measured saving at the model's published input price — you keep the rest. A certified refusal costs $0. Savings on an expensive frontier reader are worth more than the same pixels on a small open model, automatically — the certificate is the price tag.

Settlement is prepaid credits: buy a pack, credits appear instantly, every request draws down by its certificate-priced charge, and your key plus live balance are always one call away (GET /v1/usage). First image is free — hold a sealed certificate in your hand before paying anything.

Get started free →   sign in (one-time email link, no password), compress a few images right in your browser, and grab your API key. Add it to Claude Code / Codex with the MCP, then add credits when you're ready.

Add credits: $5 · $25 · $100  ·  your key + balance appear right after checkout  ·  price table: GET /v1/models

The flagship demo

A deterministic world grades the models.

Our element simulation is seed-deterministic with an exact matter census — so every question about a frame has a machine-checkable answer, no human labels. We compressed the frames until the models broke: the certificate held 100% for its target model at the certified rung, the industry-standard RMSE witness said "isomorphic" all the way down to 32 pixels wide — where accuracy collapses to a coin flip. See the full ladder →

Per-model savings

What we can save, by model.

Typical vision-token savings. Measured where we've calibrated; estimated from robustness tiers elsewhere — the list grows every calibration.

$ starlens models --savings