# styayur/omniroute-ps architecture

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

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

## Overview

OmniRoute-PS is a local PowerShell OpenAI-compatible LLM router. CLI and IDE clients send requests to its HTTP server, which exposes OpenAI and Anthropic endpoints; the documented shared protocol IR supports cross-protocol routing to configured upstream providers. The README also describes configuration, health and metrics endpoints, worker queueing, circuit breaking, hot reload, and structured logging. Source excerpts were unavailable, so relationships below are limited to README-documented behavior; implementation ownership and finer call flows could not be verified.

Main entry points: [`src/Server.ps1`](https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1) (HTTP server), [`src/Config.ps1`](https://github.com/styayur/omniroute-ps/blob/main/src/Config.ps1) (Configuration), [`src/Router.ps1`](https://github.com/styayur/omniroute-ps/blob/main/src/Router.ps1) (Route selection), [`src/Protocol.ps1`](https://github.com/styayur/omniroute-ps/blob/main/src/Protocol.ps1) (Canonical protocol IR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and HTTP"]
  node_entrypoint["PowerShell CLI<br/>[omniroute.ps1]"]
  node_http_server["HTTP server<br/>[Server.ps1]"]
  node_openai_api["OpenAI endpoints<br/>[Server.ps1]"]
  node_anthropic_api["Anthropic endpoint<br/>[Server.ps1]"]
end

subgraph group_routing["Protocol and routing"]
  node_protocol_ir["Canonical protocol IR<br/>[Protocol.ps1]"]
  node_router["Route selection<br/>[Router.ps1]"]
  node_provider_adapters["Provider adapters<br/>[Adapters.ps1]"]
  node_transport["HTTP transport<br/>[Transport.ps1]"]
end

subgraph group_runtime["Runtime services"]
  node_worker_pool["Worker pool and queue<br/>[Server.ps1]"]
  node_circuit_breaker["Circuit breaker<br/>[Router.ps1]"]
  node_health["Health endpoints<br/>[Health.ps1]"]
  node_metrics["Prometheus metrics<br/>[Metrics.ps1]"]
end

subgraph group_operations["Configuration and operations"]
  node_configuration["Configuration<br/>[Config.ps1]"]
  node_hot_reload["Config hot reload<br/>[Config.ps1]"]
  node_logging["Redacted structured logs<br/>[Logging.ps1]"]
  node_schema["JSON Schema"]
end

node_clients(("CLI and IDE clients"))
node_upstreams{{"LLM providers"}}

node_clients -->|"send requests"| node_http_server
node_entrypoint -->|"start serving"| node_http_server
node_http_server -->|"exposes"| node_openai_api
node_http_server -->|"exposes"| node_anthropic_api
node_openai_api -->|"uses shared IR"| node_protocol_ir
node_anthropic_api -->|"uses shared IR"| node_protocol_ir
node_protocol_ir -->|"routes requests"| node_router
node_router -->|"selects provider"| node_provider_adapters
node_provider_adapters -->|"forwards requests"| node_transport
node_transport -->|"sends requests"| node_upstreams
node_configuration -->|"configures routes"| node_router
node_configuration -->|"configures providers"| node_provider_adapters
node_http_server -->|"queues work"| node_worker_pool
node_router -->|"uses breaker"| node_circuit_breaker
node_http_server -->|"serves health"| node_health
node_http_server -->|"serves metrics"| node_metrics
node_configuration -->|"supports reload"| node_hot_reload
node_configuration -->|"validated by"| node_schema
node_http_server -.->|"logs requests"| node_logging

click node_entrypoint "https://github.com/styayur/omniroute-ps/blob/main/omniroute.ps1"
click node_http_server "https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1"
click node_openai_api "https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1"
click node_anthropic_api "https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1"
click node_protocol_ir "https://github.com/styayur/omniroute-ps/blob/main/src/Protocol.ps1"
click node_router "https://github.com/styayur/omniroute-ps/blob/main/src/Router.ps1"
click node_provider_adapters "https://github.com/styayur/omniroute-ps/blob/main/src/Adapters.ps1"
click node_transport "https://github.com/styayur/omniroute-ps/blob/main/src/Transport.ps1"
click node_worker_pool "https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1"
click node_circuit_breaker "https://github.com/styayur/omniroute-ps/blob/main/src/Router.ps1"
click node_health "https://github.com/styayur/omniroute-ps/blob/main/src/Health.ps1"
click node_metrics "https://github.com/styayur/omniroute-ps/blob/main/src/Metrics.ps1"
click node_configuration "https://github.com/styayur/omniroute-ps/blob/main/src/Config.ps1"
click node_hot_reload "https://github.com/styayur/omniroute-ps/blob/main/src/Config.ps1"
click node_logging "https://github.com/styayur/omniroute-ps/blob/main/src/Logging.ps1"
click node_schema "https://github.com/styayur/omniroute-ps/blob/main/schemas/omniroute.schema.json"

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_entrypoint,node_http_server,node_openai_api,node_anthropic_api,node_clients toneBlue
class node_protocol_ir,node_router,node_provider_adapters,node_transport toneAmber
class node_worker_pool,node_circuit_breaker,node_health,node_metrics toneMint
class node_configuration,node_hot_reload,node_logging,node_schema toneRose
class node_upstreams toneIndigo
```

## Components

### Entry and HTTP

- [PowerShell CLI](https://github.com/styayur/omniroute-ps/blob/main/omniroute.ps1): `omniroute.ps1`
- [HTTP server](https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1): `src/Server.ps1`
- [OpenAI endpoints](https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1): `src/Server.ps1`
- [Anthropic endpoint](https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1): `src/Server.ps1`

### Protocol and routing

- [Canonical protocol IR](https://github.com/styayur/omniroute-ps/blob/main/src/Protocol.ps1): `src/Protocol.ps1`
- [Route selection](https://github.com/styayur/omniroute-ps/blob/main/src/Router.ps1): `src/Router.ps1`
- [Provider adapters](https://github.com/styayur/omniroute-ps/blob/main/src/Adapters.ps1): `src/Adapters.ps1`
- [HTTP transport](https://github.com/styayur/omniroute-ps/blob/main/src/Transport.ps1): `src/Transport.ps1`

### Runtime services

- [Worker pool and queue](https://github.com/styayur/omniroute-ps/blob/main/src/Server.ps1): `src/Server.ps1`
- [Circuit breaker](https://github.com/styayur/omniroute-ps/blob/main/src/Router.ps1): `src/Router.ps1`
- [Health endpoints](https://github.com/styayur/omniroute-ps/blob/main/src/Health.ps1): `src/Health.ps1`
- [Prometheus metrics](https://github.com/styayur/omniroute-ps/blob/main/src/Metrics.ps1): `src/Metrics.ps1`

### Configuration and operations

- [Configuration](https://github.com/styayur/omniroute-ps/blob/main/src/Config.ps1): `src/Config.ps1`
- [Config hot reload](https://github.com/styayur/omniroute-ps/blob/main/src/Config.ps1): `src/Config.ps1`
- [Redacted structured logs](https://github.com/styayur/omniroute-ps/blob/main/src/Logging.ps1): `src/Logging.ps1`
- [JSON Schema](https://github.com/styayur/omniroute-ps/blob/main/schemas/omniroute.schema.json): `schemas/omniroute.schema.json`

### Other components

- **CLI and IDE clients**
- **LLM providers**

## Connections

- CLI and IDE clients → HTTP server: send requests (evidence: `README.md`)
- PowerShell CLI → HTTP server: start serving (evidence: `README.md`)
- HTTP server → OpenAI endpoints: exposes (evidence: `README.md`)
- HTTP server → Anthropic endpoint: exposes (evidence: `README.md`)
- OpenAI endpoints → Canonical protocol IR: uses shared IR (evidence: `README.md`)
- Anthropic endpoint → Canonical protocol IR: uses shared IR (evidence: `README.md`)
- Canonical protocol IR → Route selection: routes requests (evidence: `README.md`)
- Route selection → Provider adapters: selects provider (evidence: `README.md`)
- Provider adapters → HTTP transport: forwards requests (evidence: `README.md`)
- HTTP transport → LLM providers: sends requests (evidence: `README.md`)
- Configuration → Route selection: configures routes (evidence: `README.md`)
- Configuration → Provider adapters: configures providers (evidence: `README.md`)
- HTTP server → Worker pool and queue: queues work (evidence: `README.md`)
- Route selection → Circuit breaker: uses breaker (evidence: `README.md`)
- HTTP server → Health endpoints: serves health (evidence: `README.md`)
- HTTP server → Prometheus metrics: serves metrics (evidence: `README.md`)
- Configuration → Config hot reload: supports reload (evidence: `README.md`)
- Configuration → JSON Schema: validated by (evidence: `README.md`)
- HTTP server → Redacted structured logs: logs requests
