---
title: "trim-1: keep the lines that answer the question"
description: "trim-1 reads a payload (a log, a file, a page of search results) against the"
canonical: https://caveman.so/models/trim-1
last-updated: 2026-10-18
---

# trim-1: keep the lines that answer the question

trim-1 reads a payload (a log, a file, a page of search results) against the
question an agent is asking and keeps only the lines that answer it. Every
kept line comes back byte for byte, in order, with a marker where lines were
cut. It never rewrites a line. This is compression of one payload; compaction
of a whole history is [compact-1](https://caveman.so/models/compact-1).

- 1.2 MB: 712 gradient-boosted trees, pure Go, no dependencies, deterministic.
- 7.2 ms p50 for 5,000 tokens on one CPU core (63 ms for 60,000). No GPU.
- Open source, Apache-2.0: https://github.com/caveman-ai/trim-1 and
  https://huggingface.co/caveman-so/trim-1
- Hands the payload back untouched on a blank query, a short payload, or a
  cut under 10%.

## Measured

One run on 2026-10-11, frozen holdout splits of public suites, `balanced`
level. Token counts are local `cl100k_base`, labelled inferred, not provider
billing. The long-document suite is the validation split of a dataset whose
train split is in the training data.

| Context | Tokens cut | Evidence kept |
|---|---:|---:|
| Long documents, 8k to 32k tokens (n=90) | 88.9% | 94.4% |
| Retrieved code, lines the fix edits (n=150) | 21.8% | 90.7% |
| Coding-agent tool output, what the agent used next (n=200) | 1.9% | 100% |

Answers from the trimmed output (Claude Haiku reads, Claude Sonnet judges):

| Suite | Full context | trim-1 | SuperCompress v2 |
|---|---:|---:|---:|
| Long documents (n=90) | 88.9% | 85.6% | 63.3% |
| Public agent traces (n=100) | 100% | 99% | 84% |
| Logs, JSON, code and prose (n=60) | 91.7% | 70.0% | 43.3% |

p50 latency at 5,000 tokens: trim-1 7.2 ms on one core; SuperCompress v1
984 ms; SuperCompress v2 (ModernBERT-large, about 400M parameters, 4 CPU
threads) 24.8 s on a busy machine, 1.9 to 3.3 s for 400 to 1,200 tokens when
lightly loaded.

## API

```sh
curl https://gateway.caveman.so/v1/trim \
  -H "Authorization: Bearer $CAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "<tool output>", "query": "why did the job fail?"}'
```

Body `{input, query, level?}`; levels `conservative`, `balanced` (default),
`aggressive`. Returns `{output, tokens_before, tokens_after,
recovery_handle?, model}`. Up to 2 MB a call. `x-cave-retention: zdr` trims in
memory and stores nothing. On trim-1's golden-test log: 10,061 tokens in,
228 out (o200k).

50M tokens free each month per organisation, on every plan, then $0.02 per
1M tokens in. Free during the preview; billing starts in 2027 at the
earliest. In your own binary it is free. Published prices, October 2026:
SuperCompress $0.10 per 1M after 5M free; Morph Compact $0.20 in and $0.50
out per 1M. On a long document headed for Opus 5.5 ($4 per 1M input), an
88.9% cut removes $3.56 of input per 1M tokens read.

Get an API key: https://app.caveman.so/signup
