# ebubekirylmaz/routeiq architecture

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

- Interactive diagram: https://gitdiagram.com/ebubekirylmaz/routeiq
- Repository: https://github.com/ebubekirylmaz/routeiq

## Overview

RouteIQ turns incoming text into a cost-aware decision: a fast classifier accepts confident predictions, uncertain ones escalate to an LLM, and unresolved requests enter human review before delivery to a configured target. The API also exposes operational history, delivery status, statistics, and offline evaluation to the dashboard. The graph includes the documented dashboard and integrations, but their unsampled implementation links are omitted or marked unverified; sampled API and dashboard calls anchor the relationships shown.

Main entry points: [`routeiq/api.py`](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/api.py) (HTTP API), [`dashboard/src/api/endpoints.ts`](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/api/endpoints.ts) (API endpoints), [`routeiq/models/registry.py`](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/registry.py) (Model registry), [`dashboard/src/pages/ReviewQueuePage.tsx`](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/pages/ReviewQueuePage.tsx) (Review queue UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Routing service"]
  node_api["HTTP API<br/>[api.py]"]
  node_config["Domain config<br/>[config.py]"]
  node_cascade["Confidence cascade<br/>[cascade.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_views["Response views<br/>[views.py]"]
  node_redact["Text redaction<br/>[redact.py]"]
end

subgraph group_models["Classification"]
  node_registry["Model registry<br/>[registry.py]"]
  node_baseline["Sklearn classifier"]
  node_openrouter["OpenRouter classifier<br/>[openrouter.py]"]
end

subgraph group_ops["Operations and evaluation"]
  node_review["Human review queue<br/>[api.py]"]
  node_store[("Metrics store<br/>[store.py]")]
  node_evaluation["Offline evaluation<br/>[evaluation.py]"]
  node_evaluator["Evaluation runner<br/>[evaluate.py]"]
end

subgraph group_integrations["Delivery adapters"]
  node_delivery["Delivery dispatcher<br/>[delivery.py]"]
  node_adapters["Target adapters"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Dashboard routes<br/>[App.tsx]"]
  node_review_page["Review queue UI"]
  node_review_hooks["Review data hooks<br/>[useReviewQueue.ts]"]
  node_resolve_hook["Decision mutation"]
  node_api_endpoints["API endpoints<br/>[endpoints.ts]"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_try_page["Try text UI<br/>[TryItPage.tsx]"]
  node_other_pages["Insights and history"]
end

node_client(("Request client"))

node_client -->|"submits text"| node_api
node_api -->|"loads settings"| node_config
node_api -->|"builds classifiers"| node_registry
node_registry -->|"constructs"| node_baseline
node_registry -->|"constructs"| node_openrouter
node_api -->|"routes request"| node_cascade
node_api -->|"records outcomes"| node_store
node_api -.->|"schedules delivery"| node_delivery
node_delivery -.->|"dispatches target"| node_adapters
node_api -->|"validates and returns"| node_schemas
node_api -->|"formats responses"| node_views
node_views -->|"redacts text"| node_redact
node_api -->|"serves decisions"| node_review
node_api -->|"serves metrics"| node_evaluation
node_evaluation -->|"uses measurements"| node_evaluator
node_dashboard_ui -->|"routes to"| node_review_page
node_review_page -->|"loads queue"| node_review_hooks
node_review_page -->|"submits decision"| node_resolve_hook
node_review_hooks -->|"requests queue"| node_api_endpoints
node_resolve_hook -->|"posts decision"| node_api_endpoints
node_api_endpoints -->|"sends HTTP"| node_api_client
node_try_page -->|"routes text"| node_api_endpoints
node_dashboard_ui -->|"routes insights"| node_other_pages
node_api -->|"reads operational data"| node_store
node_api_endpoints -->|"calls API"| node_api

click node_api "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/api.py"
click node_config "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/config.py"
click node_cascade "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/cascade.py"
click node_schemas "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/schemas.py"
click node_views "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/views.py"
click node_redact "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/redact.py"
click node_registry "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/registry.py"
click node_baseline "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/sklearn_baseline.py"
click node_openrouter "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/openrouter.py"
click node_review "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/api.py"
click node_store "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/store.py"
click node_delivery "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/delivery.py"
click node_adapters "https://github.com/ebubekirylmaz/routeiq/tree/main/routeiq/integrations"
click node_evaluation "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/evaluation.py"
click node_evaluator "https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/evaluate.py"
click node_dashboard_ui "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/App.tsx"
click node_review_page "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/pages/ReviewQueuePage.tsx"
click node_review_hooks "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/hooks/useReviewQueue.ts"
click node_resolve_hook "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/hooks/useResolveReview.ts"
click node_api_endpoints "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/api/endpoints.ts"
click node_api_client "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/api/client.ts"
click node_try_page "https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/pages/TryItPage.tsx"
click node_other_pages "https://github.com/ebubekirylmaz/routeiq/tree/main/dashboard/src/pages"

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_api,node_config,node_cascade,node_schemas,node_views,node_redact,node_client toneBlue
class node_registry,node_baseline,node_openrouter toneAmber
class node_review,node_store,node_evaluation,node_evaluator toneMint
class node_delivery,node_adapters toneRose
class node_dashboard_ui,node_review_page,node_review_hooks,node_resolve_hook,node_api_endpoints,node_api_client,node_try_page,node_other_pages toneIndigo
```

## Components

### Routing service

- [HTTP API](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/api.py): `routeiq/api.py`
- [Domain config](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/config.py): `routeiq/config.py`
- [Confidence cascade](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/cascade.py): `routeiq/cascade.py`
- [API schemas](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/schemas.py): `routeiq/schemas.py`
- [Response views](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/views.py): `routeiq/views.py`
- [Text redaction](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/redact.py): `routeiq/redact.py`

### Classification

- [Model registry](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/registry.py): `routeiq/models/registry.py`
- [Sklearn classifier](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/sklearn_baseline.py): `routeiq/models/sklearn_baseline.py`
- [OpenRouter classifier](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/models/openrouter.py): `routeiq/models/openrouter.py`

### Operations and evaluation

- [Human review queue](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/api.py): `routeiq/api.py`
- [Metrics store](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/store.py): `routeiq/store.py`
- [Offline evaluation](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/evaluation.py): `routeiq/evaluation.py`
- [Evaluation runner](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/evaluate.py): `routeiq/evaluate.py`

### Delivery adapters

- [Delivery dispatcher](https://github.com/ebubekirylmaz/routeiq/blob/main/routeiq/delivery.py): `routeiq/delivery.py`
- [Target adapters](https://github.com/ebubekirylmaz/routeiq/tree/main/routeiq/integrations): `routeiq/integrations`

### Dashboard

- [Dashboard routes](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/App.tsx): `dashboard/src/App.tsx`
- [Review queue UI](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/pages/ReviewQueuePage.tsx): `dashboard/src/pages/ReviewQueuePage.tsx`
- [Review data hooks](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/hooks/useReviewQueue.ts): `dashboard/src/hooks/useReviewQueue.ts`
- [Decision mutation](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/hooks/useResolveReview.ts): `dashboard/src/hooks/useResolveReview.ts`
- [API endpoints](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/api/endpoints.ts): `dashboard/src/api/endpoints.ts`
- [HTTP client](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/api/client.ts): `dashboard/src/api/client.ts`
- [Try text UI](https://github.com/ebubekirylmaz/routeiq/blob/main/dashboard/src/pages/TryItPage.tsx): `dashboard/src/pages/TryItPage.tsx`
- [Insights and history](https://github.com/ebubekirylmaz/routeiq/tree/main/dashboard/src/pages): `dashboard/src/pages`

### Other components

- **Request client**

## Connections

- Request client → HTTP API: submits text (evidence: `README.md`)
- HTTP API → Domain config: loads settings (evidence: `routeiq/api.py`)
- HTTP API → Model registry: builds classifiers (evidence: `routeiq/api.py`)
- Model registry → Sklearn classifier: constructs (evidence: `routeiq/models/registry.py`)
- Model registry → OpenRouter classifier: constructs (evidence: `routeiq/models/registry.py`)
- HTTP API → Confidence cascade: routes request (evidence: `routeiq/api.py`)
- HTTP API → Metrics store: records outcomes (evidence: `routeiq/api.py`)
- HTTP API → Delivery dispatcher: schedules delivery (evidence: `routeiq/api.py`)
- Delivery dispatcher → Target adapters: dispatches target
- HTTP API → API schemas: validates and returns (evidence: `routeiq/api.py`)
- HTTP API → Response views: formats responses (evidence: `routeiq/api.py`)
- Response views → Text redaction: redacts text (evidence: `routeiq/views.py`)
- HTTP API → Human review queue: serves decisions (evidence: `routeiq/api.py`)
- HTTP API → Offline evaluation: serves metrics (evidence: `routeiq/api.py`)
- Offline evaluation → Evaluation runner: uses measurements (evidence: `routeiq/evaluation.py`)
- Dashboard routes → Review queue UI: routes to (evidence: `dashboard/src/App.tsx`)
- Review queue UI → Review data hooks: loads queue (evidence: `dashboard/src/pages/ReviewQueuePage.tsx`)
- Review queue UI → Decision mutation: submits decision (evidence: `dashboard/src/pages/ReviewQueuePage.tsx`)
- Review data hooks → API endpoints: requests queue (evidence: `dashboard/src/hooks/useReviewQueue.ts`)
- Decision mutation → API endpoints: posts decision (evidence: `dashboard/src/hooks/useResolveReview.ts`)
- API endpoints → HTTP client: sends HTTP (evidence: `dashboard/src/api/endpoints.ts`)
- Try text UI → API endpoints: routes text (evidence: `dashboard/src/pages/TryItPage.tsx`)
- Dashboard routes → Insights and history: routes insights (evidence: `dashboard/src/App.tsx`)
- HTTP API → Metrics store: reads operational data (evidence: `routeiq/api.py`)
- API endpoints → HTTP API: calls API (evidence: `README.md`)
