trim-1 cuts agent context with a 1.2 MB model and no rewriting
trim-1 is a new 1.2 MB Apache-2.0 context filter that keeps the lines of a document a question actually needs and drops the rest, returning the kept lines unchanged, and the repository has 139 stars four days after it was opened.
Image: GitHub
Why it mattersShrinking context before it reaches a model is usually a job for another model call, and this is one that fits in a Go binary, runs on a CPU core in milliseconds, and leaves every kept line byte-identical to the source.
Shrinking context before it reaches a language model is usually another language model call, which has to be paid for by the token and takes long enough that it adds a round trip. trim-1, published on 14 October 2026 by the author who goes by caveman-ai, is a 1.2 MB binary that does the same job on a single CPU core in roughly 7 milliseconds per 5,000 tokens. The repository is at 139 stars four days later.
What the model is
trim-1 is not a neural network. The author states it is 712 gradient-boosted trees carrying probabilistic keep-scores for lines of text, with the model file packaged inside a Go binary that has no external dependencies. Output is deterministic, so the same input and query return the same lines every run, and every line that survives is returned byte-for-byte with no rewriting. Three cut-level presets ship: conservative keeps the most, balanced is the default, and aggressive cuts hardest. For inputs under 2,000 bytes or over 8 megabytes the tool returns the context unchanged rather than guessing.
What the author measured
The repository publishes an evidence-retention benchmark across four task families, each run on the balanced default. The author states 100 percent of labeled supporting facts survived on agent trace inputs with 1.9 percent of tokens cut, 100 percent at 1.7 percent cut on multi-hop question answering, and 90.7 percent at 21.8 percent cut on code context. The two long-document suites give the sharpest trade-offs the author reports: 75 percent evidence kept at 54.4 percent of tokens cut on a 10,000 to 50,000-token haystack, and 94.4 percent evidence kept at 88.9 percent of tokens cut on a long multi-hop variant. All of these are the author's own numbers from the model card, with no independent re-run.
Where it fits
The use the author points at for coding agents is tool-call outputs: short, dense blocks that already carry most of their text as evidence, and that would waste tokens if sent to a model whole. The balanced preset is the recommended one for that case, because aggressive lost information the agent needed in 8 percent of the sampled runs. For a long log, a question such as trim --query "why does the build fail" build.log returns the lines that touch the failure with short markers for the ones removed, and identifiers, paths and error text come back verbatim.
trim-1 is Apache-2.0, pure Go, trained on public and commercially licensed material only. For a team paying by the token to send context into a frontier model, a filter that fits in a Go binary and keeps the exact bytes it chose has a different shape to a smaller model doing the same work: no second provider, no round trip, and the output is auditable because nothing was paraphrased on the way through. The honesty of the benchmark deserves a note of its own, since the long-haystack row shows the trade-off that practice tends to hide: cut hard and you keep three quarters of the evidence, not all of it.
Source
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.