Observability

W&B compression tracking

Weights & Biases is the standard ML experiment tracker. Log SuperCompress metrics to W&B to visualize token savings over time.

By Arjun Shah - Creator of SuperCompress - Updated 2026-07-03

W&B integration

import wandb
from supercompress import Compressor

wandb.init(project="llm-cost-optimization")
comp = Compressor()

def tracked_compress(context, query):
    result = comp.compress(context, query)
    wandb.log({
        "original_tokens": result.original_tokens,
        "kept_tokens": result.kept_tokens,
        "savings_pct": round((1 - result.kept_tokens /
            max(result.original_tokens, 1)) * 100, 1),
        "tokens_removed": result.tokens_removed,
    })
    return result

Frequently asked questions

Can I track savings by model or use case?

Yes. Add model_name and use_case as additional wandb.log fields.

Does W&B support team dashboards for this?

Yes. Create a W&B report showing token savings over time for each team.

Build with less context

Put compression in front of your next LLM call.

Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.

Get an API keyRead the guide