Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,25 @@ claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp

</div>

> **Why use many token when few token do trick?** Every request passes through OmniRoute's compression pipeline **transparently** — no client changes. It stacks ideas from [RTK](https://github.com/rtk-ai/rtk), [Caveman](https://github.com/JuliusBrussee/caveman) (⭐ 51K+), and [Troglodita](https://github.com/leninejunior/troglodita) (PT-BR).
> **Why use many token when few token do trick?** Every request passes through OmniRoute's compression pipeline **transparently** — no client changes. It's now a **stack of 9 composable engines** that run in order and mix & match per routing combo — building on ideas from [RTK](https://github.com/rtk-ai/rtk), [Caveman](https://github.com/JuliusBrussee/caveman) (⭐ 51K+), [LLMLingua-2](https://github.com/microsoft/LLMLingua), and [Troglodita](https://github.com/leninejunior/troglodita) (PT-BR).

### 🧱 The 9-engine stack

Engines run in pipeline order; each is independently toggleable and configurable per combo:

| # | Engine | What it does |
| --- | ----------------- | ------------------------------------------------------------------------ |
| 1 | **Session-Dedup** | Drops content repeated across turns (content-addressed, cross-turn) |
| 2 | **CCR** | Archives large blocks behind retrieve markers, fetched on demand |
| 3 | **RTK** | Smart tool-result filtering, dedup & truncation (command-aware) |
| 4 | **Headroom** | Lossless tabular compaction of homogeneous JSON arrays (~30%+) |
| 5 | **Caveman** | Rule-based prose compression (~65–75% on output) |
| 6 | **LLMLingua-2** | ML semantic pruning via MobileBERT ONNX — code-safe, async |
| 7 | **Lite** | Whitespace + image-URL trimming (latency-light baseline) |
| 8 | **Aggressive** | Summarization + progressive aging of old turns |
| 9 | **Ultra** | Heuristic token pruning with an optional small-model (SLM) tier |
Comment on lines +448 to +458

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The table lists the engines in an order that does not match the actual execution order (pipeline order) defined in the codebase. According to ENGINE_STACK_PRIORITY in src/lib/db/compressionCombos.ts, the engines are sorted by ascending priority:

  • session-dedup (3)
  • ccr (4)
  • lite (5)
  • rtk (10)
  • headroom (15)
  • caveman (20)
  • aggressive (30)
  • llmlingua (35)
  • ultra (40)

To accurately reflect the pipeline order, Lite should be listed as #3, Aggressive as #7, and LLMLingua-2 as #8.

Suggested change
| # | Engine | What it does |
| --- | ----------------- | ------------------------------------------------------------------------ |
| 1 | **Session-Dedup** | Drops content repeated across turns (content-addressed, cross-turn) |
| 2 | **CCR** | Archives large blocks behind retrieve markers, fetched on demand |
| 3 | **RTK** | Smart tool-result filtering, dedup & truncation (command-aware) |
| 4 | **Headroom** | Lossless tabular compaction of homogeneous JSON arrays (~30%+) |
| 5 | **Caveman** | Rule-based prose compression (~65–75% on output) |
| 6 | **LLMLingua-2** | ML semantic pruning via MobileBERT ONNX — code-safe, async |
| 7 | **Lite** | Whitespace + image-URL trimming (latency-light baseline) |
| 8 | **Aggressive** | Summarization + progressive aging of old turns |
| 9 | **Ultra** | Heuristic token pruning with an optional small-model (SLM) tier |
| # | Engine | What it does |
| --- | ----------------- | ------------------------------------------------------------------------ |
| 1 | **Session-Dedup** | Drops content repeated across turns (content-addressed, cross-turn) |
| 2 | **CCR** | Archives large blocks behind retrieve markers, fetched on demand |
| 3 | **Lite** | Whitespace + image-URL trimming (latency-light baseline) |
| 4 | **RTK** | Smart tool-result filtering, dedup & truncation (command-aware) |
| 5 | **Headroom** | Lossless tabular compaction of homogeneous JSON arrays (~30%+) |
| 6 | **Caveman** | Rule-based prose compression (~65–75% on output) |
| 7 | **Aggressive** | Summarization + progressive aging of old turns |
| 8 | **LLMLingua-2** | ML semantic pruning via MobileBERT ONNX — code-safe, async |
| 9 | **Ultra** | Heuristic token pruning with an optional small-model (SLM) tier |


Code blocks, URLs and structured data are **always preserved** byte-perfect. **One-click presets** combine the engines:

| Mode | Savings | Best for |
| ------------------------------ | ---------- | --------------------------- |
Expand Down Expand Up @@ -471,7 +489,7 @@ claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp
### 📖 How it works — pipeline, architecture & savings math

```
Client (10,000 tok) ──▶ OmniRoute Compression (7 options) ──▶ Provider (~1,080 tok, up to 95% saved)
Client (10,000 tok) ──▶ OmniRoute Compression (9 engines) ──▶ Provider (~1,080 tok, up to 95% saved)
```

Default stacked combo runs `RTK → Caveman`. When both act on the same tool/context payload, savings compound:
Expand Down