How kazmallar/omniroute works
OmniRoute is a local-first AI gateway that presents a unified API across many model providers, with routing, fallback, and request/response features. The main user workflow is an AI client sending a request to the gateway, which routes it to a provider and returns a normalized or streamed response. Separate capabilities include combo pipelines, compression, MCP tools, dashboard management, and CLI/desktop access. Some subsystem links are documented in the README; unsampled implementation details are represented at supported directory paths, and their internal call relationships are not assumed.
Main entry points: index.ts Unified API · executors Provider executors · streamingPipeline.ts Chat handling · server.ts MCP server
Components 20
Gateway and routing
- Unified API
open-sse/index.ts - Request authorization
src/server/authz/pipeline.ts - Chat handling
open-sse/handlers/chatCore/streamingPipeline.ts - Stream transforms
open-sse/handlers/chatCore/streamingPipeline.ts
Provider integrations
- Provider registry
open-sse/config/providerRegistry.ts - Provider executors
open-sse/executors - AI providers
Routing features
- Combo routing
src/lib/combos/steps.ts - Pipeline engine
src/domain/pipeline.ts - Sequential combo
open-sse/services/pipeline.ts - Compression services
open-sse/services/compression - Format translation
open-sse/translator
User interfaces
- Web dashboard
src/app/(dashboard) - CLI
bin/cli - Desktop app
electron/main.js
Operations and access
- MCP server
open-sse/mcp-server/server.ts - MCP advanced tools
open-sse/mcp-server/tools/advancedTools.ts - Tool-call audit
open-sse/mcp-server/audit.ts - Application database
src/lib/db
Other components
- AI client
Connections 18
- AI client → Unified API: sends requests
README.md - Unified API → Request authorization: authorizes requests
- Request authorization → Chat handling: routes requests
- Chat handling → Provider executors: dispatches models
- Provider executors → AI providers: calls providers
README.md - Chat handling → Stream transforms: transforms streams
open-sse/handlers/chatCore/streamingPipeline.ts - Provider registry → Provider executors: configures providers
- Combo routing → Sequential combo: supports combo routing
README.md - Sequential combo → Provider executors: runs model steps
- Pipeline engine → Provider executors: delegates stages
- AI client → Compression services: uses compression
README.md - AI client → Format translation: uses translation
README.md - Web dashboard → Unified API: manages gateway
README.md - CLI → Unified API: manages gateway
README.md - Desktop app → Unified API: hosts gateway
- MCP server → MCP advanced tools: registers tools
open-sse/mcp-server/server.ts - MCP server → Tool-call audit: logs tool calls
open-sse/mcp-server/server.ts - Tool-call audit → Application database: reads and writes
open-sse/mcp-server/audit.ts