Skip to page content
SAVRN
Search Plan a project

Open-weight model · Text classification

compressor-reflex

by Eric Maddox aialchemist-dev/compressor-reflex

compressor-reflex is an open-weight model for text classification from Eric Maddox, released under Apache License 2.0. Its published files total 152.1 MB.

compressor-reflex is a small (151M-parameter) extractive line-level compressor for tool output in agentic coding loops (IDEs such as Cursor and Antigravity).

Parameters—
Context—
Weights150.1 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Eric Maddox, published under apache-2.0, revision e9012fa1ad54.

compressor-reflex is a small (151M-parameter) extractive line-level compressor for tool output in agentic coding loops (IDEs such as Cursor and Antigravity). It scores every line of a tool result for keep/drop and runs post-tool, pre-context — cutting the tokens that reach the next model call while guaranteeing safety-critical lines are never dropped. The companion MCP server packages this model for IDE deployment (Cursor, Antigravity, Claude Desktop): install with pip install compressor-reflex-mcp (PyPI). It downloads these weights from this repo on first run and exposes compresstooloutput / compressfile tools plus a transparent proxy mode. Intended use: compressing tool outputs (build…

Read Eric Maddox's full model card

Author: Eric Maddox

Model Description

compressor-reflex is a small (151M-parameter) extractive line-level compressor for tool output in agentic coding loops (IDEs such as Cursor and Antigravity). It scores every line of a tool result for keep/drop and runs post-tool, pre-context — cutting the tokens that reach the next model call while guaranteeing safety-critical lines are never dropped.

  • Architecture: ModernBERT encoder (heman10x/rlcd-modernbert-151m) with a per-line keep/drop head.
  • Format: INT8 ONNX (model_int8.onnx, 150MB). CPU-only via ONNX Runtime. Zero API tokens to run.
  • Decision rule: keep line iff P(keep) ≥ τ*, with τ*=0.50 calibrated on a held-out must-keep anchor set.
  • Fail-open policy: outputs of ≤5 physical lines or ≤64 tokens bypass the compressor and pass through verbatim; if scoring ever yields zero kept lines, the first and last lines are kept. The model never silently drops everything.

MCP server

The companion MCP server packages this model for IDE deployment (Cursor, Antigravity, Claude Desktop): install with pip install compressor-reflex-mcp (PyPI). It downloads these weights from this repo on first run and exposes compress_tool_output / compress_file tools plus a transparent proxy mode.

Intended Uses & Limitations

Intended use: compressing tool outputs (build logs, test results, grep/file reads, command output) before they enter an LLM's context window, in agentic coding workflows. Designed as a local MCP-side layer.

Not intended for: anything where a dropped line is catastrophic and unverifiable — the fail-open policy mitigates this, but the 100% retention figure is measured on the eval distribution, not a formal guarantee. Not a general text summarizer: it is extractive (keep/drop), never generative.

Training and Evaluation Data

  • Train: 2,200 items (400 must-keep anchors at 3× emphasis) — tool outputs across 6 projects (build logs, pytest output, grep results, file reads, error traces).
  • Validation: 250 items.
  • Eval (held-out): 340 items, 611 must-keep anchor lines across 244 items, including 172 deep anchor lines at line index ≥50. 0% verbatim item, intent, and anchor overlap with train/val (independently re-verified). Eval and training sets are never mixed; the eval set is not distributed with this release.

Training Procedure

Single-epoch fine-tune of the 151M base (per delivered training_history.json: loss 0.5681). Training logs are thin (one epoch of metrics; the log covers data loading only) — disclosed here because the weights are judged on the held-out eval, not on training claims. No training data, eval data, or weights were modified after the independent validation.

Evaluation

Held-out eval results below were independently reproduced: the shipped replay_harness.py was re-run on Linux against the shipped INT8 weights and eval set, reproducing eval_report.json bit-exactly.

Metric Result
Must-keep retention @ τ*=0.50 611/611 = 100%
Downstream next-action fidelity 100% (50/50 replayed steps)
Tool-output compression ratio 86.73% (163,716 → 21,726 tokens)
CPU latency, INT8, per chunk p50 ~0.3–0.8s, p99 ~0.9–5.7s (hardware- and length-dependent)

Real coding sessions (builder-measured, n=12 across 4 repositories — methodology reviewed, not independently re-run):

Metric Result
Tool-output compression ~90%
Total session token savings ~48% median (range 28–61%; 5/12 sessions ≥50%)

The 50% session-savings bar was narrowly missed on the median (48.30%) due to invariant per-turn system-prefix dilution (~3.5K tokens/turn the compressor cannot touch). Reported as measured, not rounded up.

Limitations

  • Closest call: the lowest-scoring must-keep anchor in eval scores 0.5449 — retained at τ*=0.50 but dropped at τ≥0.55. The calibrated threshold carries a thin margin on this anchor; disclosed.
  • Latency: 150ms/chunk-class latency is not achievable with this model size on CPU (p99 ~0.9–5.7s). Very long outputs should be chunk-capped in deployment. Latency scales with output length — which is also where the token savings are largest.
  • Distribution: retention figures hold for the tool-output distribution it was trained and evaluated on. Unusual output formats may behave differently; the fail-open policy bounds the downside.

How to Get Started

import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
from serializer import CompressorSerializer  # shipped in this repo

tok = AutoTokenizer.from_pretrained("aialchemist-dev/compressor-reflex")
ser = CompressorSerializer(tok)
sess = ort.InferenceSession("model_int8.onnx", providers=["CPUExecutionProvider"])

TAU = 0.50  # calibrated keep threshold — do not raise without re-validating retention

def compress(intent: str, raw_text: str) -> list[str]:
    lines = raw_text.splitlines()
    if len(lines) <= 5 or len(tok.encode(raw_text, add_special_tokens=False)) <= 64:
        return lines  # fail-open bypass
    scores: list[float] = []
    for ch in ser.chunk_tool_output(intent, raw_text):
        ids = np.asarray(ch["input_ids"])
        mask = np.asarray(ch["attention_mask"])
        seq, nl = ids.shape[0], ch["num_lines"]
        lm = np.zeros((nl, seq), dtype=np.float32)
        for i, (s, e) in enumerate(ch["line_spans"]):
            s, e = min(s, seq - 1), min(max(e, s + 1), seq)
            if e > s:
                lm[i, s:e] = 1.0 / (e - s)
        probs = sess.run(None, {"input_ids": ids[None],
                                "attention_mask": mask[None],
                                "line_mask": lm})[0]
        scores.extend(np.asarray(probs).ravel().tolist())
    kept = [l for l, p in zip(lines, scores) if p >= TAU]
    return kept if kept else [lines[0], lines[-1]]  # fail-open: never return empty

See INSERTION.md for the full deployment spec and replay_harness.py for the reference evaluation.

Citation

@misc{maddox2026compressorreflex,
  author = {Eric Maddox},
  title = {compressor-reflex: a small local line-level compressor for tool output},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/aialchemist-dev/compressor-reflex}}
}

License

Apache-2.0

Identity and Version

Repository
aialchemist-dev/compressor-reflex
Publisher
Eric Maddox
Task
Text classification
Modality
Text
Library
onnx
Parameters
Not stated by the source
Languages
en
Revision
e9012fa1ad54f0e4159b27a3b11bec1991936f97
First published
2026-10-02
Last updated
2026-10-03

Files and Weights

11 files, 152.1 MB in total. The weights are 1 file totalling 150.1 MB in onnx.

Weights1 file · 150.1 MB
Configuration3 files · 18.6 KB
Tokenizer2 files · 1.9 MB
Documentation4 files · 33.2 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model_int8.onnxWeights150.1 MB 98af8b8106c9
eval_report.jsonConfiguration451 B —
replay_harness.pyConfiguration13.2 KB —
serializer.pyConfiguration5.0 KB —
INSERTION.mdDocumentation2.3 KB —
README.mdDocumentation7.2 KB —
REPORT.mdDocumentation10.4 KB —
VALIDATION_COMPRESSOR_V2.mdDocumentation13.3 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer1.9 MB —
tokenizer_config.jsonTokenizer318 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
150.1 MB
Download from Eric Maddox

Released by Eric Maddox through its official repository on Hugging Face. Read the license.

Evaluations

Each result is shown as reported, with the conditions its reporter stated. None is a SAVRN measurement. A comparison lines two results up only when their configuration, unit and setup are all stated and identical.

BenchmarkConditionsResultReported byRevisionDate
compressor-reflex held-out eval Task Line-level keep/dropMetric Downstream next-action fidelityComparison conditions not established 100 aialchemist-dev
Publisher reported
Evaluated revision not stated —
compressor-reflex held-out eval Task Line-level keep/dropMetric Must-keep retention @ τ*=0.50Comparison conditions not established 100 aialchemist-dev
Publisher reported
Evaluated revision not stated —
compressor-reflex held-out eval Task Line-level keep/dropMetric Tool-output compression ratioComparison conditions not established 86.73 aialchemist-dev
Publisher reported
Evaluated revision not stated —

Memory Requirements

PrecisionWeights in memory
As published150.1 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About compressor-reflex

Can I use compressor-reflex commercially?

Yes. compressor-reflex is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Text classification

twitter-roberta-base-sentiment-latest

Cardiff NLP

This is a RoBERTa-base model trained on ~124M tweets from January 2018 to December 2021, and finetuned for sentiment analysis with the TweetEval benchmark. The original Twitter-based RoBERTa model can be found here and the original reference paper is TweetEval. This model is suitable for English. 0 -> Negative; 1 -> Neutral; 2 -> Positive This sentiment analysis model has been integrated into TweetNLP. You can access the demo here.

Open weights cc-by-4.0 514 tokens transformers

Model · Text classification

finbert-tone

Yi

FinBERT is a BERT model pre-trained on financial communication text. The purpose is to enhance financial NLP research and practice. It is trained on the following three financial communication corpus. The total corpora size is 4.9B tokens. More technical details on FinBERT: Click Link This released finbert-tone model is the FinBERT model fine-tuned on 10,000 manually annotated (positive, negative, neutral) sentences from analyst reports. This model achieves superior performance on financial tone analysis task. If you are simply interested in using FinBERT for financial tone analysis, give it a try. If you use the model in your academic work, please cite the following paper: Huang, Allen H.…

Open weights 512 tokens transformers

Model · Text classification

ms-marco-MiniLM-L-6-v2

Joshua

https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights 512 tokens transformers.js

Model · Text classification

twitter-xlm-roberta-base-sentiment

Cardiff NLP

This is a multilingual XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis. The sentiment fine-tuning was done on 8 languages (Ar, En, Fr, De, Hi, It, Sp, Pt) but it can be used for more languages (see paper for details). This model has been integrated into the TweetNLP library.

Open weights 514 tokens transformers

Model · Text classification

unbiased-toxic-roberta

Unitary

The huggingface models currently give different results to the detoxify library (see issue here). For the most up to date models we recommend using the models from https://github.com/unitaryai/detoxify Trained models & code to predict toxic comments on 3 Jigsaw challenges: Toxic comment classification, Unintended Bias in Toxic comments, Multilingual toxic comment classification. Built by Laura Hanu at Unitary, where we are working to stop harmful content online by interpreting visual content in context. Score not directly comparable since it is obtained on the validation set provided and not on the test set. To update when the test labels are made available. It is also noteworthy to mention…

Open weights apache-2.0 514 tokens transformers

Model · Text classification

emotion-english-distilroberta-base

Hartmann

With this model, you can classify emotions in English text data. The model was trained on 6 diverse datasets (see Appendix below) and predicts Ekman's 6 basic emotions, plus a neutral class: 1) anger 2) disgust 3) fear 4) joy 5) neutral 6) sadness 7) surprise The model is a fine-tuned checkpoint of DistilRoBERTa-base. For a 'non-distilled' emotion model, please refer to the model card of the RoBERTa-large version. a) Run emotion model with 3 lines of code on single text example using Hugging Face's pipeline command on Google Colab: b) Run emotion model on multiple examples and full datasets (e.g.,.csv files) on Google Colab: Please reach out to [email protected] if you have any…

Open weights 514 tokens transformers