Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
31 changes: 22 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Unified AI proxy/router — route any LLM through one endpoint. Multi-provider s
with **160+ providers** (OpenAI, Anthropic, Gemini, DeepSeek, Groq, xAI, Mistral, Fireworks,
Cohere, NVIDIA, Cerebras, Pollinations, Puter, Cloudflare AI, HuggingFace, DeepInfra,
SambaNova, Meta Llama API, Moonshot AI, AI21 Labs, Databricks, Snowflake, and many more)
with **MCP Server** (29 tools), **A2A v0.3 Protocol**, and **Electron desktop app**.
with **MCP Server** (37 tools), **A2A v0.3 Protocol**, and **Electron desktop app**.

## Stack

Expand Down Expand Up @@ -292,17 +292,25 @@ compression pipeline), and more.

Modular prompt compression that runs proactively before the existing reactive context manager.

- **`strategySelector.ts`**: Selects compression mode based on config, combo overrides, auto-trigger
thresholds. Priority: combo override > auto-trigger > default mode > off.
- **`strategySelector.ts`**: Selects compression mode based on config, compression combo assignments,
combo overrides, auto-trigger thresholds, and defaults. Priority: assigned compression combo >
combo override > auto-trigger > default mode > off.
- **`lite.ts`**: 5 lite-mode techniques: `collapseWhitespace`, `dedupSystemPrompt`,
`compressToolResults`, `removeRedundantContent`, `replaceImageUrls`. Target: 10-15% savings at
<1ms latency.
- **`caveman.ts` / `cavemanRules.ts`**: Caveman-style semantic condensation backed by built-in
rules plus file-loaded language packs under `compression/rules/`.
- **`engines/rtk/`**: Rule-based terminal/tool-output compression inspired by RTK patterns. Detects
command output classes, applies JSON filter packs, deduplicates repeated lines, strips ANSI/code
noise, and preserves errors/actionable context.
- **`engines/registry.ts`**: Registers engines (`caveman`, `rtk`) and powers stacked pipelines.
- **`stats.ts`**: Per-request compression stats tracking (original tokens, compressed tokens,
savings %, techniques used).
- **`types.ts`**: `CompressionMode` (off/lite/standard/aggressive/ultra), `CompressionConfig`,
`CompressionStats`, `CompressionResult`.
- DB settings in `src/lib/db/compression.ts`, API route at `src/app/api/settings/compression/`.
- Phase 1 implements lite mode only; standard/aggressive/ultra are placeholders for Phase 2.
savings %, techniques used, engine breakdown, compression combo id).
- **`types.ts`**: `CompressionMode` (off/lite/standard/aggressive/ultra/rtk/stacked),
`CompressionConfig`, `CompressionStats`, `CompressionResult`.
- DB settings in `src/lib/db/compression.ts`, compression combos in
`src/lib/db/compressionCombos.ts`, API routes under `src/app/api/settings/compression/`,
`src/app/api/context/*`, and preview/language-pack routes under `src/app/api/compression/*`.

#### Combo Routing Engine (`combo.ts`)

Expand All @@ -323,7 +331,7 @@ Policy engine modules: `policyEngine.ts`, `comboResolver.ts`, `costRules.ts`,

### MCP Server (`open-sse/mcp-server/`)

29 tools, 3 transports (stdio / SSE / Streamable HTTP). Scoped auth (10 scopes), Zod schemas.
37 tools, 3 transports (stdio / SSE / Streamable HTTP). Scoped auth (10 scopes), Zod schemas.

**Core tools** (20): get_health, list_combos, get_combo_metrics, switch_combo, check_quota,
route_request, cost_report, list_models_catalog, web_search, simulate_route, set_budget_guard,
Expand All @@ -332,6 +340,11 @@ best_combo_for_task, explain_route, get_session_snapshot, db_health_check, sync_

**Cache tools** (2): cache_stats, cache_flush.

**Compression tools** (5): compression_status, compression_configure, set_compression_engine,
list_compression_combos, compression_combo_stats.

**1proxy tools** (3): oneproxy_fetch, oneproxy_rotate, oneproxy_stats.

**Memory tools** (3): memory_search, memory_add, memory_clear.

**Skill tools** (4): skills_list, skills_enable, skills_execute, skills_executions.
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### ✨ New Features

- **feat(compression):** add RTK tool-output compression, stacked Caveman + RTK pipelines,
compression combo assignments, dashboard context pages, MCP management tools, and
language-aware Caveman rule packs.

---

## [3.7.9] — 2026-05-02
Expand Down
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Never stop coding. Save 15-75% tokens with prompt compression + auto-fallback to **FREE & low-cost AI models**.

_The most complete open-source AI proxy — **one endpoint**, **160+ providers**, **13 routing strategies**, zero downtime. Multi-platform: **Web**, **Desktop (Electron)**, **Mobile (PWA + Termux)**. Fully extensible via **MCP Server (29 tools)**, **A2A Protocol**, and **Memory/Skills** systems. Available in **40+ languages**._
_The most complete open-source AI proxy — **one endpoint**, **160+ providers**, **13 routing strategies**, zero downtime. Multi-platform: **Web**, **Desktop (Electron)**, **Mobile (PWA + Termux)**. Fully extensible via **MCP Server (37 tools)**, **A2A Protocol**, and **Memory/Skills** systems. Available in **40+ languages**._

**Chat Completions • Responses API • Embeddings • Image Generation • Video • Music • Audio Speech/Transcription • Reranking • Moderations • Web Search • MCP Server • A2A Protocol • 4,600+ Tests • 100% TypeScript**

Expand Down Expand Up @@ -440,7 +440,7 @@ Every request passes through the compression pipeline **transparently** — no c
```
┌──────────────────┐ ┌─────────────────────────────┐ ┌──────────────┐
│ Client sends │────▶│ OmniRoute Compression │────▶│ Provider │
│ full prompt │ │ Pipeline (5 modes) │ │ receives │
│ full prompt │ │ Pipeline (7 options) │ │ receives │
│ (10,000 tok) │ │ │ │ compressed │
│ │ │ 🪶 Lite ........... ~15% │ │ (2,500 tok) │
│ │ │ 🪨 Standard ....... ~30% │ │ │
Expand All @@ -449,7 +449,7 @@ Every request passes through the compression pipeline **transparently** — no c
└──────────────────┘ └─────────────────────────────┘ └──────────────┘
```

### 5 Compression Modes
### 7 Compression Options

| Mode | Savings | Technique | Best For |
| ------------------------- | ------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- |
Expand All @@ -458,6 +458,8 @@ Every request passes through the compression pipeline **transparently** — no c
| **🪨 Standard (Caveman)** | ~30% | 30+ regex rules: filler removal, context condensation, structural compression, multi-turn dedup | Daily coding with Claude/Codex |
| **⚡ Aggressive** | ~50% | All standard + progressive message aging + tool result summarization + LLM-based compression | Long sessions with many tool calls |
| **🔥 Ultra** | ~75% | All aggressive + heuristic token pruning + stopword removal + score-based filtering | Maximum savings when tokens are scarce |
| **🧰 RTK** | 20-70% | Command-aware tool-output filters, deduplication, smart truncation, noise stripping | Shell/test/build/git output in agents |
| **🔗 Stacked** | 30-80% | Ordered engine pipeline, usually RTK first then Caveman | Mixed prompts with tool logs + prose |

### Before & After (Standard/Caveman Mode)

Expand All @@ -481,6 +483,8 @@ Request Body
├─ lite.ts ─────────────── Whitespace, dedup, image URLs, redundant content
├─ caveman.ts ──────────── 30+ regex rules via cavemanRules.ts
│ └─ preservation.ts ─── Protects code blocks, URLs, JSON from compression
├─ engines/rtk/ ────────── Command detection + JSON filter packs for tool output
├─ engines/registry.ts ─── Shared engine registry for caveman, RTK, and stacked
├─ aggressive.ts ───────── Summarizer + tool result compressor + progressive aging
│ ├─ summarizer.ts ───── Rule-based message summarization
│ ├─ toolResultCompressor.ts ── file/grep/shell/JSON/error compression
Expand All @@ -492,7 +496,7 @@ Request Body
### Configuration

```
Dashboard → Settings → Compression → Pick your mode
Dashboard → Context & Cache → Caveman / RTK / Compression Combos
```

Or per-combo override:
Expand All @@ -508,9 +512,11 @@ Or per-combo override:

Auto-trigger: set `autoTriggerTokens` to automatically enable compression when a request exceeds a token threshold.

> 🪨 **Fun fact:** The standard/caveman mode is inspired by [Caveman](https://github.com/JuliusBrussee/caveman) — the viral project that proved "caveman speak" cuts 65% of tokens while keeping 100% technical accuracy. OmniRoute takes this further with a **5-mode pipeline** that goes from gentle whitespace cleanup all the way to aggressive heuristic pruning.
Compression combos can also assign a named compression pipeline to routing combos, so a coding combo can use RTK + Caveman while a paid subscription combo stays on lite mode.

📖 **Full compression documentation:** [`docs/COMPRESSION_GUIDE.md`](docs/COMPRESSION_GUIDE.md)
> 🪨 **Fun fact:** The standard/caveman mode is inspired by [Caveman](https://github.com/JuliusBrussee/caveman) — the viral project that proved "caveman speak" cuts 65% of tokens while keeping 100% technical accuracy. OmniRoute takes this further with a **7-option pipeline** that goes from gentle whitespace cleanup through RTK tool-output filters and stacked multi-engine compression.

📖 **Full compression documentation:** [`docs/COMPRESSION_GUIDE.md`](docs/COMPRESSION_GUIDE.md) • [`docs/compression-engines.md`](docs/compression-engines.md) • [`docs/compression-rules-format.md`](docs/compression-rules-format.md) • [`docs/compression-language-packs.md`](docs/compression-language-packs.md)

---

Expand Down Expand Up @@ -933,8 +939,8 @@ Then in `/dashboard/media` → **Transcription** tab: upload any audio or video
| ---------------------------------------------------------------------------------------------------- | -------------------------------- |
| 🧠 **Smart 4-Tier Fallback** — Subscription → API → Cheap → Free | Never stop coding, zero downtime |
| 🔄 **Format Translation** — OpenAI ↔ Claude ↔ Gemini ↔ Responses API | Works with ANY CLI tool |
| 🗜️ **Prompt Compression** — 5-mode pipeline (off → lite → standard → aggressive → ultra) | Save 15-75% tokens automatically |
| 🤖 **MCP Server** — 29 tools, 3 transports (stdio/SSE/HTTP), 10 scopes | IDE/agent tool integration |
| 🗜️ **Prompt Compression** — 7 options including Caveman, RTK, and stacked pipelines | Save 15-75% tokens automatically |
| 🤖 **MCP Server** — 37 tools, 3 transports (stdio/SSE/HTTP), 10 scopes | IDE/agent tool integration |
| 🛡️ **Resilience Engine** — circuit breakers, cooldowns, TLS spoofing, anti-thundering herd | Auto-recovery from any failure |
| 🎵 **10 Multi-Modal APIs** — chat, embed, images, video, music, TTS, STT, moderation, rerank, search | One endpoint for everything |
| 🌍 **3-Level Proxy** — global, per-provider, per-key + 1proxy free marketplace | Access AI from any country |
Expand Down Expand Up @@ -1142,7 +1148,7 @@ curl http://localhost:20128/.well-known/agent.json

- [User Guide](docs/USER_GUIDE.md) — Providers, combos, CLI integration
- [API Reference](docs/API_REFERENCE.md) — All endpoints with examples
- [MCP Server](open-sse/mcp-server/README.md) — 29 tools, IDE configs
- [MCP Server](open-sse/mcp-server/README.md) — 37 tools, IDE configs
- [A2A Server](src/lib/a2a/README.md) — JSON-RPC, skills, streaming
- [Environment Config](docs/ENVIRONMENT.md) — Complete `.env` reference
- [VM Deployment](docs/VM_DEPLOYMENT_GUIDE.md) — VM + nginx + Cloudflare
Expand Down Expand Up @@ -1325,16 +1331,19 @@ See the [Proxy Guide](docs/PROXY_GUIDE.md) for setup instructions.

### 🧠 Features & Architecture

| Document | Description |
| -------------------------------------------------------- | ---------------------------------------------------------------------- |
| [Architecture](docs/ARCHITECTURE.md) | System architecture, data flow, and internals |
| [Compression Guide](docs/COMPRESSION_GUIDE.md) | 5-mode pipeline: off / lite / standard / aggressive / ultra |
| [Resilience Guide](docs/RESILIENCE_GUIDE.md) | Circuit breakers, cooldowns, queue, anti-thundering herd, TLS spoofing |
| [Auto-Combo Engine](docs/AUTO-COMBO.md) | 6-factor scoring, mode packs, self-healing |
| [Proxy Guide](docs/PROXY_GUIDE.md) | 3-level proxy system, 1proxy marketplace, registry CRUD |
| [Free Tiers](docs/FREE_TIERS.md) | 25+ free API providers consolidated directory |
| [Features Gallery](docs/FEATURES.md) | Visual dashboard tour with screenshots |
| [Codebase Documentation](docs/CODEBASE_DOCUMENTATION.md) | Beginner-friendly codebase walkthrough |
| Document | Description |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Architecture](docs/ARCHITECTURE.md) | System architecture, data flow, and internals |
| [Compression Guide](docs/COMPRESSION_GUIDE.md) | 7-option pipeline: off / lite / standard / aggressive / ultra / RTK / stacked |
| [Compression Engines](docs/compression-engines.md) | Caveman, RTK, stacked pipelines, dashboard/API/MCP surfaces |
| [Compression Rules Format](docs/compression-rules-format.md) | JSON rule-pack schemas for Caveman and RTK filters |
| [Compression Language Packs](docs/compression-language-packs.md) | Language detection and Caveman rule-pack authoring |
| [Resilience Guide](docs/RESILIENCE_GUIDE.md) | Circuit breakers, cooldowns, queue, anti-thundering herd, TLS spoofing |
| [Auto-Combo Engine](docs/AUTO-COMBO.md) | 6-factor scoring, mode packs, self-healing |
| [Proxy Guide](docs/PROXY_GUIDE.md) | 3-level proxy system, 1proxy marketplace, registry CRUD |
| [Free Tiers](docs/FREE_TIERS.md) | 25+ free API providers consolidated directory |
| [Features Gallery](docs/FEATURES.md) | Visual dashboard tour with screenshots |
| [Codebase Documentation](docs/CODEBASE_DOCUMENTATION.md) | Beginner-friendly codebase walkthrough |

### 🤖 Protocols & APIs

Expand Down
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Core capabilities:
- Compliance audit logging with opt-out per API key
- Eval framework for LLM quality assurance
- Health dashboard with real-time provider circuit breaker status
- MCP Server (29 tools) with 3 transports (stdio/SSE/Streamable HTTP)
- MCP Server (37 tools) with 3 transports (stdio/SSE/Streamable HTTP)
- A2A Server (JSON-RPC 2.0 + SSE) with skills and task lifecycle
- Memory system (extraction, injection, retrieval, summarization)
- Skills system (registry, executor, sandbox, built-in skills)
Expand Down
Loading