caveman-ai/trim-1

★ 136⑂ 14

trim-1: a 1.2 MB model that keeps the lines of a context an AI agent needs

About caveman-ai/trim-1

caveman-ai/trim-1 is an open-source project on GitHub, mainly written in Go. trim-1: a 1.2 MB model that keeps the lines of a context an AI agent needs It currently holds 136 stars and 14 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board, currently at rank #90 with 0 new stars today.

GitHub Repository Details

Repository caveman-ai/trim-1 · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

https://github.com/caveman-ai/trim-1/blob/HEAD/Caveman / trim-1. The word TRIM-1 in solid pixel letters with a double-line shadow. Why read many line when few do trick. Agent read whole log to find one error. trim-1 keep the lines the ask need and drop the rest. Every kept line exact, nothing rewritten. Say this to shell: trim --query "why fail" build.log. How big is rock: 1.2 MB model, 7 ms for 5k tokens on one core, 0 GPUs

trim-1

trim-1 is a small model that decides which lines of a context an AI agent needs for its current ask, and drops the rest.

Give it a context (a tool result, a file, a log, a long chat) and the current query. It returns the context's own lines, in their original order, with a short marker wherever lines were removed. It never rewrites or summarizes a line, so identifiers, paths and error text come through exactly as they were.

give the same output. The model card, with benchmark results and limits, is on Hugging Face: caveman-so/trim-1.

Install

Needs Go 1.23 or newer.

go install github.com/caveman-ai/trim-1/cmd/trim@latest

Use

From the command line:

trim --query "why does the build fail" build.log > build.trimmed.log
cat long-document.md | trim --query "what is the refund policy" --point balanced

The trimmed context goes to stdout. A one-line summary goes to stderr:

trim: kept 246 lines, removed 189, 47831 -> 36344 bytes

From Go:

import trim "github.com/caveman-ai/trim-1"

res := trim.Compress(context, query, trim.Options{Point: "balanced"}) fmt.Print(res.Output)

trim.Score(context, query) returns every line with its keep probability, if you want to make the selection yourself.

Which setting to use

--point decides how hard trim-1 cuts: conservative, balanced (the default) or aggressive. Cutting harder costs quality, because every removed line is one the model can no longer read.

conservative and expect small savings.

The model card has the numbers behind this.

When it does nothing

trim-1 fails closed. It returns the context unchanged, and says why on stderr, when:

The trim command exits with status 2 on a missing --query or an unknown --point. Flags go before the file name.

Test

go test ./...

TestPredictionParity checks the Go tree evaluation against the training library's own predictions, bit for bit. TestGolden pins the full output on a sample log.

License

Apache-2.0. model.go includes a copy of Go's math.Exp, under the BSD license in LICENSE-go. trim-1 is the model inside Caveman.

GitHub Stars & Activity

136Stars
14Forks
0Open issues
GoLanguage

GitHub Popularity

GitHub stars136
Forks14
Open issues0
Primary languageGo
License-
Stars gained today0
Created-
Last pushed-

Trending History

Daily boardrank #90 · ▲ 0 stars

Related AI Projects

1

ollama / ollama

Go★ 183,617⑂ 18,358▲ 166 stars
→
2

JuliusBrussee / caveman

Go★ 113,255⑂ 6,552▲ 209 stars
→
3

Wei-Shaw / sub2api

Go★ 44,260⑂ 9,497▲ 57 stars
→
4

gastownhall / beads

Go★ 27,964⑂ 1,894▲ 29 stars
→
5

google / ax

Go★ 13,883⑂ 714▲ 154 stars
→
6

Gentleman-Programming / engram

Go★ 7,393⑂ 771▲ 67 stars
→
7

kubernetes-sigs / agent-sandbox

Go★ 4,291⑂ 567▲ 13 stars
→
8

vshulcz / deja-vu

Go★ 1,231⑂ 125▲ 9 stars
→

More AI Rankings