# rajeshkumar9490/omniroute architecture

> Architecture diagram of the GitHub repository rajeshkumar9490/omniroute, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajeshkumar9490/omniroute
- Repository: https://github.com/rajeshkumar9490/omniroute

## Overview

OmniRoute is a local-first AI gateway that gives coding agents and other clients one API across many model providers. The principal workflow is request submission, routing through a selected provider/model (with combo strategies and fallback), and returning a compatible response; optional compression can reduce prompt tokens. The repository also exposes management through a dashboard and CLI, and documents MCP/A2A integrations. The tree and excerpts support the component map, but do not show the full server route wiring, so uncertain internal links are omitted.

Main entry points: [`open-sse`](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse) (Unified API), [`open-sse/services`](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse/services) (Combo Routing), [`open-sse/executors/index.ts`](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/executors/index.ts) (Provider Executors), [`src`](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/src) (Web Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["Gateway Runtime"]
  node_gateway["Unified API"]
  node_auth["Request Authorization<br/>[pipeline.ts]"]
end

subgraph group_routing["Routing And Providers"]
  node_providers["Provider Catalog"]
  node_executors["Provider Executors<br/>[index.ts]"]
  node_combos["Combo Routing"]
  node_pipeline["Sequential Pipeline<br/>[pipeline.ts]"]
  node_chaos["Parallel Chaos<br/>[chaosEngine.ts]"]
end

subgraph group_management["Management"]
  node_dashboard["Web Dashboard"]
  node_cli["CLI<br/>[program.mjs]"]
  node_mcp["MCP Server<br/>[mcp-server.mjs]"]
  node_state[("Application State<br/>[sqlite.mjs]")]
end

subgraph group_optimization["Optimization"]
  node_compression["Compression Engines<br/>[engineCatalog.ts]"]
  node_preview["Compression Preview"]
end

node_client(("AI Client"))
node_provider(("AI Providers"))
node_response["Model Response"]

node_client -->|"sends request"| node_gateway
node_gateway -->|"checks access"| node_auth
node_gateway -->|"selects strategy"| node_combos
node_combos -->|"dispatches model"| node_executors
node_providers -->|"defines providers"| node_executors
node_executors -->|"calls upstream"| node_provider
node_provider -->|"returns output"| node_response
node_executors -->|"normalizes output"| node_response
node_combos -->|"runs sequential"| node_pipeline
node_combos -->|"fans out"| node_chaos
node_preview -.->|"requests preview"| node_gateway
node_dashboard -->|"previews compression"| node_preview
node_dashboard -.->|"uses API"| node_gateway
node_cli -.->|"manages gateway"| node_gateway
node_mcp -.->|"exposes tools"| node_gateway
node_cli -.->|"reads and writes"| node_state

click node_gateway "https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse"
click node_auth "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/src/server/authz/pipeline.ts"
click node_providers "https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse/config/providers"
click node_executors "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/executors/index.ts"
click node_combos "https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse/services"
click node_pipeline "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/pipeline.ts"
click node_chaos "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/autoCombo/chaosEngine.ts"
click node_compression "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/compression/engineCatalog.ts"
click node_preview "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/src/hooks/usePreviewCompression.ts"
click node_dashboard "https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/src"
click node_cli "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/cli/program.mjs"
click node_mcp "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/mcp-server.mjs"
click node_state "https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/cli/sqlite.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gateway,node_auth,node_client toneBlue
class node_providers,node_executors,node_combos,node_pipeline,node_chaos toneAmber
class node_dashboard,node_cli,node_mcp,node_state toneMint
class node_compression,node_preview toneRose
class node_provider,node_response toneIndigo
```

## Components

### Gateway Runtime

- [Unified API](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse): `open-sse`
- [Request Authorization](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/src/server/authz/pipeline.ts): `src/server/authz/pipeline.ts`

### Routing And Providers

- [Provider Catalog](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse/config/providers): `open-sse/config/providers`
- [Provider Executors](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/executors/index.ts): `open-sse/executors/index.ts`
- [Combo Routing](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/open-sse/services): `open-sse/services`
- [Sequential Pipeline](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/pipeline.ts): `open-sse/services/pipeline.ts`
- [Parallel Chaos](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/autoCombo/chaosEngine.ts): `open-sse/services/autoCombo/chaosEngine.ts`

### Management

- [Web Dashboard](https://github.com/rajeshkumar9490/omniroute/tree/release/v3.8.49/src): `src`
- [CLI](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/cli/program.mjs): `bin/cli/program.mjs`
- [MCP Server](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/mcp-server.mjs): `bin/mcp-server.mjs`
- [Application State](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/bin/cli/sqlite.mjs): `bin/cli/sqlite.mjs`

### Optimization

- [Compression Engines](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/open-sse/services/compression/engineCatalog.ts): `open-sse/services/compression/engineCatalog.ts`
- [Compression Preview](https://github.com/rajeshkumar9490/omniroute/blob/release/v3.8.49/src/hooks/usePreviewCompression.ts): `src/hooks/usePreviewCompression.ts`

### Other components

- **AI Client**
- **AI Providers**
- **Model Response**

## Connections

- AI Client → Unified API: sends request
- Unified API → Request Authorization: checks access
- Unified API → Combo Routing: selects strategy
- Combo Routing → Provider Executors: dispatches model
- Provider Catalog → Provider Executors: defines providers
- Provider Executors → AI Providers: calls upstream
- AI Providers → Model Response: returns output
- Provider Executors → Model Response: normalizes output
- Combo Routing → Sequential Pipeline: runs sequential
- Combo Routing → Parallel Chaos: fans out
- Compression Preview → Unified API: requests preview
- Web Dashboard → Compression Preview: previews compression
- Web Dashboard → Unified API: uses API
- CLI → Unified API: manages gateway
- MCP Server → Unified API: exposes tools
- CLI → Application State: reads and writes
