# OmniRoute Compression Modes: Differences Between Lite, Standard, Aggressive, Ultra, and RTK

> Discover the OmniRoute compression modes: Lite Standard Aggressive Ultra and RTK. Understand each phase's unique engines for optimized data processing and enhanced performance.

- Repository: [Diego Rodrigues de Sa e Souza/OmniRoute](https://github.com/diegosouzapw/OmniRoute)
- Tags: deep-dive
- Published: 2026-07-27

---

**OmniRoute's compression pipeline uses five sequential phases—lite, standard, aggressive, ultra, and RTK—where each phase activates progressively heavier engines ranging from simple regex cleanup to heuristic token pruning and structured tool-output filtering.**

If you are evaluating the **differences between lite, standard, aggressive, and ultra compression modes** in the `diegosouzapw/OmniRoute` project, this guide breaks down how each phase behaves according to the source code. The routing layer implements a configurable, multi-phase stack defined in [`open-sse/services/compression/types.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/types.ts), where the `CompressionMode` union and configuration structures such as `CavemanConfig`, `AggressiveConfig`, `UltraConfig`, and `RtkConfig` enumerate the available knobs.

## How the Five Compression Phases Differ

The following sections describe the engine, core behavior, and execution trigger for each mode as implemented in the OmniRoute repository.

### Lite Mode (Phase 1)

The **lite** engine in [`open-sse/services/compression/lite.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/lite.ts) performs very cheap, rule-based clean-ups. It collapses whitespace, deduplicates system prompts, compresses tool results, drops redundant text, and replaces image URLs. This mode auto-triggers by default on small requests when you need quick token savings without any summarization.

### Standard Mode (Phase 2)

The **standard** mode runs the `caveman` engine from [`open-sse/services/compression/caveman.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/caveman.ts). It applies deterministic, rule-based text transformations using a rich set of regex rules for deduplication, structural trimming, and language-aware patterns. Choose this phase when you want stronger reduction than *lite* without invoking an LLM summarizer.

### Aggressive Mode (Phase 3)

The **aggressive** phase combines the `caveman` engine with the `aggressive` engine, implemented in [`open-sse/services/compression/aggressive.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/aggressive.ts). It runs a summarizer over the conversation, compresses tool-result payloads—including file content, grep output, shell output, JSON, and error messages—and applies **aging**. Aging progressively trims older messages from full-summary down to moderate, light, and finally verbatim retention. Use this mode when you need a larger token budget and can tolerate LLM-driven summarization.

### Ultra Mode (Phase 4)

The **ultra** engine, found in [`open-sse/services/compression/ultra.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/ultra.ts), executes heuristic token-pruning based on per-token scores, keeping a configurable fraction such as 50%. If you configure `ultraEngine: "slm"`, it loads an ONNX SLM model to run a second-tier LLMLingua-2 compressor; otherwise, it falls back to the heuristic pruner. This is the most demanding token-budget scenario in the OmniRoute compression pipeline.

### RTK Mode (Phase 5)

The **RTK** engine in [`open-sse/services/compression/engines/rtk/index.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/engines/rtk/index.ts) filters tool output line-by-line, deduplicates entries, strips comments, groups similar lines, and renders specialized formats like Terraform plans or git diffs. It supports custom filter enable/disable lists, raw-output retention settings, and can be stacked with other engines—for example, chaining `rtk` into `caveman`. It is designed for heavy, structured tool-output streams that require fine-grained control.

## Configuring Compression Modes in OmniRoute Requests

You can activate any mode by setting `defaultMode` in the request payload. The following examples show the exact JSON shapes accepted by the routing layer.

### Enable Aggressive Mode

```json
{
  "model": "gpt-4o",
  "messages": [{ "role": "user", "content": "...large prompt..." }],
  "compression": {
    "enabled": true,
    "defaultMode": "aggressive"
  }
}

```

This tells the routing layer to run the **aggressive** pipeline, which includes the summarizer, tool compression, and aging logic.

### Switch to Ultra with the SLM Tier

```json
{
  "compression": {
    "enabled": true,
    "defaultMode": "ultra",
    "ultraEngine": "slm",
    "ultraSlmPrewarm": true,
    "ultra": { "compressionRate": 0.4 }
  }
}

```

Setting `ultraEngine: "slm"` selects the optional LLMLingua-2 model. If the ONNX model cannot be loaded, the system falls back to the heuristic tier.

### Use RTK with Custom Filters

```json
{
  "compression": {
    "enabled": true,
    "defaultMode": "rtk",
    "rtkConfig": {
      "enabled": true,
      "intensity": "aggressive",
      "enabledFilters": ["remove-ansi", "strip-json-comments"],
      "disableGrouping": false,
      "rawOutputRetention": "always"
    }
  }
}

```

The `rtkConfig` toggles fine-grained filters, while `rawOutputRetention: "always"` preserves the original tool output for debugging.

### Programmatic Toggling via Node Client

```typescript
import { setCompressionSettings } from '@omniroute/client';

await setCompressionSettings({
  enabled: true,
  defaultMode: 'standard',
  cavemanConfig: { intensity: 'full', enabled: true }
});

```

The client API mirrors the JSON payload and directly updates the server-side `CompressionConfig`.

## Core Source Files Behind the Compression Stack

These files define the architectural progression from low-cost *lite* cleanup to fine-grained *RTK* filtering:

- [`open-sse/services/compression/types.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/types.ts) — Core type definitions, `CompressionMode` union, and default configs
- [`open-sse/services/compression/lite.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/lite.ts) — Phase 1 lite implementation
- [`open-sse/services/compression/caveman.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/caveman.ts) — Phase 2 standard engine
- [`open-sse/services/compression/aggressive.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/aggressive.ts) — Phase 3 aggressive summarizer and aging logic
- [`open-sse/services/compression/ultra.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/ultra.ts) — Phase 4 heuristic token pruner and optional SLM tier
- [`open-sse/services/compression/engines/rtk/index.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/engines/rtk/index.ts) — Phase 5 RTK rule-based tool-output filter
- [`open-sse/services/compression/strategySelector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/strategySelector.ts) — Runtime mode selection logic

## Summary

- **Lite** provides cheap, rule-based whitespace and prompt cleanup for small requests.
- **Standard** runs deterministic regex transforms via the `caveman` engine without LLM summarization.
- **Aggressive** adds a summarizer, tool-result compression, and progressive message aging for larger token savings.
- **Ultra** applies heuristic token pruning and optionally loads an ONNX SLM model for maximum compression.
- **RTK** targets structured tool output with line-by-line filtering and supports engine stacking for advanced control.

## Frequently Asked Questions

### What is the default compression mode in OmniRoute?

If no mode is specified, the system relies on the **lite** phase as its default auto-trigger for small requests, as implemented in [`open-sse/services/compression/lite.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/lite.ts). This provides immediate, deterministic token savings without LLM overhead.

### Can I stack multiple OmniRoute compression engines?

Yes. The RTK engine explicitly supports stacking with other modes, such as chaining `rtk` into `caveman`, as seen in [`open-sse/services/compression/engines/rtk/index.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/engines/rtk/index.ts). Additionally, the [`strategySelector.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/strategySelector.ts) orchestrator can combine or sequence engines depending on configuration.

### Does ultra mode always require an ONNX SLM model?

No. The **ultra** engine in [`open-sse/services/compression/ultra.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/open-sse/services/compression/ultra.ts) first performs heuristic token pruning. It only attempts to load the LLMLingua-2 ONNX SLM compressor when `ultraEngine` is set to `"slm"`, and it falls back to the heuristic tier automatically if the model is unavailable.

### Which OmniRoute compression mode should I use for tool output?

Use **RTK** for heavy, structured tool-output streams such as Terraform plans, git diffs, or JSON logs, because it filters line-by-line and offers fine-grained retention controls. For general conversation context reduction, **aggressive** or **ultra** are more appropriate.