compression with a quality contract

Frequently Asked Questions

Honest answers to the questions that matter most — including the things Distil won't pretend.


"Is 100% decision-equivalence real, or is it marketing?"

It is real, in a specific and honest sense. 100% decision-equivalence means 100% of turns in the default corpus trajectories produced the same decision (tool call name + arguments, or final answer) when using the distil strategy versus the uncompressed baseline, as measured by the deterministic offline runner.

Three caveats the numbers depend on:

What makes this different from other "100% accuracy" claims: accuracy and compression are measured on the same trajectories in the same run. No separate "quality benchmark at low compression" and "compression benchmark at high compression." You see both numbers for the same corpus, or you see nothing.

"Is the compression lossless?"

Depends on the tier — and the answer is precise:

TierLossless?How
Tier 0 — JSON minify, RLE Provably lossless Reconstructable by inversion — no side state needed. The original can always be recovered from the transform output alone.
Tier 1 — Digest + handles Reversible The original is stored in a local RestoreStore keyed by an 8-hex SHA-256 handle embedded in the compressed text. Recovery requires the RestoreStore, which is kept locally and never sent to the model.
Certified — Pruning Not lossless — but causally certified Pruned blocks are causally inert: ablation confirmed they never changed any decision. The bytes are dropped but the agent behaviour is preserved within the non-inferiority margin.

The byte-fidelity gate (distil verify) confirms that every Tier-0 and Tier-1 operation across the corpus is byte-reversible and that frozen history never mutates between turns.


"How accurate is the tokenizer?"

The default tokenizer is an offline heuristic — it estimates tokens by a character-based approximation without calling any API. This means:

To get billing-grade token counts:

pip install 'distil-llm[live]'
export ANTHROPIC_API_KEY=sk-ant-…
distil savings --tokenizer anthropic
distil bench   --tokenizer anthropic

This calls the Anthropic count_tokens API — accurate billing-grade counts, but requires network access and consumes a small amount of API quota.


"What is not done yet?"

From the roadmap — implemented items that are real and wired, and items that are planned seams:

ItemStatus
Real tokenizer + live runner (billing-grade)Done--tokenizer anthropic / --runner anthropic
Multi-domain trajectory corpus + CI gateDonedistil bench
Runtime adapter (no-code-change compression)Donewrap(client)
Auth-mode gatingDonedistil/policy.py
Holdout A/B with confidence intervalsDonedistil holdout
Byte-fidelity invariantsDonedistil verify
BM25 partial retrieval · delta context · keep-model codec · gist cachingDone — all wired, real implementations
Learned per-content-type keep-model weightsIn progress — the logistic classifier is implemented; neural/soft-prompt variant is a planned seam
Provider proxy CLI subcommandIn progress — module works (python -m distil.proxy), CLI flag wrapper being added
--runner anthropic verified against live modelImplemented — UNVERIFIED without a key; the deterministic runner covers all corpus measurements

"Does it work with models other than Claude?"

The core techniques — cache-aware compression, causal pruning, TOST certification, byte-fidelity invariants — are model-agnostic and apply to any LLM with prompt caching. The corpus trajectories and the adapter are built around the Anthropic Messages API format, but:


"What is the license?"

Apache-2.0. See LICENSE in the repository.

The short version: you can use it commercially, modify it, distribute it, and sublicense it. The only requirements are attribution and preservation of the license notice. There are no patent traps beyond the standard Apache-2.0 patent grant.


"Can I contribute a new compression strategy?"

Yes — PRs are welcome. The rule is simple: a new strategy must pass make gate (non-inferior on every corpus domain, byte-reversible on Tier-0/1 operations). No green gate, no merge. See CONTRIBUTING.md for details.

The gate is the philosophy in one sentence. If a strategy can't pass non-inferiority on the bundled corpus with the default tokenizer and runner, it is not safe to ship — regardless of how impressive the savings look.