How mrbinjy/omniroute works
OmniRoute is a unified AI gateway: clients send compatible requests to its local API, which routes requests across provider connections and returns streamed or translated responses. The README also highlights provider cataloging, fallback and routing strategies, token compression, quota-aware scheduling, multimodal bridges, and operational interfaces. The graph preserves these documented capabilities; several links are dashed because their runtime wiring was not shown in the sampled source.
Main entry points: index.ts Gateway API · providerExecutionPipeline.ts Chat Execution · providers.ts Provider Connections · streamHandler.ts Stream Handling
Components 19
Gateway Runtime
- Gateway API
open-sse/index.ts - Request Authorization
src/server/authz/pipeline.ts - Chat Execution
open-sse/handlers/chatCore/providerExecutionPipeline.ts - Stream Handling
open-sse/utils/streamHandler.ts - Error Mapping
open-sse/utils/error.ts
Routing And Providers
- Provider Connections
src/lib/db/providers.ts - Provider Catalog
open-sse/config/providers/index.ts - Fallback Routing
open-sse/services - Quota Scheduling
open-sse/services/usage/volcenginePlan.ts
Request Capabilities
- Format Translation
open-sse/translator/index.ts - Token Compression
open-sse/services/compression/engineCatalog.ts - Modality Bridges
src/lib/guardrails/videoBridgePipeline.ts - Model Combos
open-sse/services/autoCombo/chaosEngine.ts
Management Interfaces
- Web Dashboard
src/app - CLI
bin/cli - MCP Interface
open-sse/mcp-server/server.ts - Desktop App
electron/main.js - Traffic Interception
src/mitm/manager.ts
Other components
- AI Client
Connections 18
- AI Client → Gateway API: sends requests
README.md - Gateway API → Request Authorization: authorizes requests
- Gateway API → Chat Execution: dispatches requests
README.md - Chat Execution → Provider Connections: reads connections
open-sse/handlers/chatCore/providerExecutionPipeline.ts - Chat Execution → Fallback Routing: supports fallback
README.md - Chat Execution → Quota Scheduling: uses quota scheduling
README.md - Chat Execution → Stream Handling: streams responses
README.md - Stream Handling → Error Mapping: builds error responses
open-sse/utils/streamHandler.ts - Provider Catalog → Provider Connections: catalogs providers
README.md - Gateway API → Format Translation: supports compatible formats
README.md - Gateway API → Token Compression: offers compression
README.md - Gateway API → Modality Bridges: offers modality bridges
README.md - Gateway API → Model Combos: offers model combos
README.md - Web Dashboard → Gateway API: manages gateway
README.md - CLI → Gateway API: operates gateway
README.md - MCP Interface → Gateway API: exposes tools
README.md - Desktop App → Gateway API: hosts server
electron/main.js - Traffic Interception → Provider Connections: uses provider state
src/mitm/manager.ts