Upload folder using huggingface_hub
Browse files24 unmodified lines25262728282930313233343536353637383920 unmodified lines6061626363646566133 unmodified lines20020120220320420320420520620720820921020620720820921021321121221521621321421521621721821922024 unmodified lines
- **1.2 MB.** 712 gradient-boosted trees, not a neural network.- **Milliseconds on one CPU core.** No GPU, no network call, no extra model request.- **Deterministic.** The same context and query give the same bytes on every machine.- **Deterministic.** No sampling and no randomness: the same context and query give the same output.- **Verbatim.** Every kept line is a line of the input.
It saves the most on long-document retrieval, where it removes most of theinput and keeps the evidence. On short coding-agent tool outputs it saveslittle by design. See [Which setting to use](#which-setting-to-use).
trim-1 is the model inside [Caveman](https://github.com/JuliusBrussee/caveman)Engine, where the package is named `keep`.trim-1 is the model inside [Caveman](https://github.com/JuliusBrussee/caveman).The code is at [caveman-ai/trim-1](https://github.com/caveman-ai/trim-1).
## How it works
20 unmodified lines| `aggressive` | 0.035 | cut most |
trim-1 fails closed. It returns the context unchanged when the query is blank,the context is under 2,000 characters, the context is over 8 MiB or 200,000the context is under 2,000 bytes, the context is over 8 MiB or 200,000lines, or the cut would remove less than 10% of the bytes.
## Results133 unmodified lines
## Use
trim-1 runs inside Caveman Engine. The feature code and the model are one Gopackage with no cgo, so it also builds for WebAssembly.The code is on GitHub: [caveman-ai/trim-1](https://github.com/caveman-ai/trim-1).It is pure Go with no dependencies, and the model is embedded.
```goimport "github.com/JuliusBrussee/caveman/engine/keep"
res := keep.Compress(context, query, keep.Options{Point: "balanced"})fmt.Println(res.Output)```bashgo install github.com/caveman-ai/trim-1/cmd/trim@latesttrim --query "why does the build fail" build.log```
From the command line:From Go:
```bashcaveman-engine compress --query "why does the build fail" < build.log```goimport trim "github.com/caveman-ai/trim-1"
res := trim.Compress(context, query, trim.Options{Point: "balanced"})fmt.Print(res.Output)```
## LicenseREADME.md+15-14