Tool Compression

Keep large tool outputs useful without flooding the model context.

Large tool outputs — a long file, a big command result, a web page — can flood a model's context and drive up cost. BudgetAI projects them into compact, provider-visible previews while keeping the full raw result available out-of-band.

How it works

  1. A tool runs and produces output.
  2. BudgetAI stores the full result on disk and assigns it a handle.
  3. The model sees a compact preview plus the handle.
  4. If the model needs more, it requests the handle to read further.

Why it matters

  • Lower cost — you do not pay to stream a 5,000-line log into every turn.
  • Focused context — the model reasons over a summary, not noise.
  • Nothing lost — the complete output is still on disk for inspection or replay.

Compression is automatic. Full results remain available through session replay and the Web UI.