# yash12212/sentinel-route architecture

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

- Interactive diagram: https://gitdiagram.com/yash12212/sentinel-route
- Repository: https://github.com/yash12212/sentinel-route

## Overview

SentinelRoute is an AIOps platform whose main user-facing workflow accepts telemetry, routes uncertain predictions to a larger model, and returns a result while logging each request. Its operational loops separately monitor a simulated target for sustained anomalies and detect drift in logged traffic; drift can trigger retraining, model promotion, and API reload. The graph preserves training evaluation, model registry, healing, and drift capabilities described in the README. Connections for unsampled training stages follow README documentation rather than inspected implementation details.

Main entry points: [`src/api.py`](https://github.com/yash12212/sentinel-route/blob/main/src/api.py) (FastAPI Service), [`src/train.py`](https://github.com/yash12212/sentinel-route/blob/main/src/train.py) (Model Training), [`src/ops.py`](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py) (Drift Detection), [`src/config.py`](https://github.com/yash12212/sentinel-route/blob/main/src/config.py) (Runtime Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Prediction Service"]
  node_api["FastAPI Service<br/>[api.py]"]
  node_cascade["Cascade Inference<br/>[api.py]"]
  node_prediction_log[("Prediction Log<br/>[api.py]")]
  node_stats["Request Stats<br/>[api.py]"]
end

subgraph group_lifecycle["Model Lifecycle"]
  node_mlflow[("MLflow Registry")]
  node_dataset["Telemetry Dataset"]
  node_training["Model Training<br/>[train.py]"]
  node_evaluation["Model Evaluation<br/>[train.py]"]
  node_promotion["Champion Promotion<br/>[train.py]"]
  node_reference["Drift Baselines<br/>[train.py]"]
end

subgraph group_operations["Operations Loops"]
  node_ops["Operations CLI<br/>[ops.py]"]
  node_target["Simulated Target<br/>[ops.py]"]
  node_watchdog["Healing Watchdog<br/>[ops.py]"]
  node_drift["Drift Detection<br/>[ops.py]"]
  node_simulator["Drift Simulator<br/>[ops.py]"]
end

subgraph group_shared["Shared Configuration"]
  node_config["Runtime Configuration<br/>[config.py]"]
end

node_client(("Telemetry Client"))

node_client -->|"sends telemetry"| node_api
node_api -->|"dispatches prediction"| node_cascade
node_cascade -->|"loads champion models"| node_mlflow
node_cascade -->|"writes predictions"| node_prediction_log
node_api -->|"reads aggregates"| node_prediction_log
node_dataset -->|"provides training data"| node_training
node_training -->|"evaluates candidates"| node_evaluation
node_training -->|"tracks and registers"| node_mlflow
node_promotion -->|"sets champion alias"| node_mlflow
node_training -->|"writes baselines"| node_reference
node_watchdog -->|"polls telemetry"| node_target
node_watchdog -->|"requests prediction"| node_api
node_watchdog -->|"restarts on anomaly"| node_target
node_simulator -->|"submits shifted traffic"| node_api
node_drift -->|"reads live rows"| node_prediction_log
node_drift -->|"compares distributions"| node_reference
node_drift -->|"triggers retraining"| node_training
node_drift -->|"requests model reload"| node_api
node_api -->|"uses settings"| node_config
node_training -->|"uses settings"| node_config
node_ops -->|"uses settings"| node_config

click node_api "https://github.com/yash12212/sentinel-route/blob/main/src/api.py"
click node_cascade "https://github.com/yash12212/sentinel-route/blob/main/src/api.py"
click node_prediction_log "https://github.com/yash12212/sentinel-route/blob/main/src/api.py"
click node_stats "https://github.com/yash12212/sentinel-route/blob/main/src/api.py"
click node_dataset "https://github.com/yash12212/sentinel-route/blob/main/data/raw/Big_data_dataset.csv"
click node_training "https://github.com/yash12212/sentinel-route/blob/main/src/train.py"
click node_evaluation "https://github.com/yash12212/sentinel-route/blob/main/src/train.py"
click node_promotion "https://github.com/yash12212/sentinel-route/blob/main/src/train.py"
click node_reference "https://github.com/yash12212/sentinel-route/blob/main/src/train.py"
click node_ops "https://github.com/yash12212/sentinel-route/blob/main/src/ops.py"
click node_target "https://github.com/yash12212/sentinel-route/blob/main/src/ops.py"
click node_watchdog "https://github.com/yash12212/sentinel-route/blob/main/src/ops.py"
click node_drift "https://github.com/yash12212/sentinel-route/blob/main/src/ops.py"
click node_simulator "https://github.com/yash12212/sentinel-route/blob/main/src/ops.py"
click node_config "https://github.com/yash12212/sentinel-route/blob/main/src/config.py"

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_cascade,node_prediction_log,node_stats,node_client toneBlue
class node_mlflow,node_dataset,node_training,node_evaluation,node_promotion,node_reference toneAmber
class node_ops,node_target,node_watchdog,node_drift,node_simulator toneMint
class node_config toneRose
```

## Components

### Prediction Service

- [FastAPI Service](https://github.com/yash12212/sentinel-route/blob/main/src/api.py): `src/api.py`
- [Cascade Inference](https://github.com/yash12212/sentinel-route/blob/main/src/api.py): `src/api.py`
- [Prediction Log](https://github.com/yash12212/sentinel-route/blob/main/src/api.py): `src/api.py`
- [Request Stats](https://github.com/yash12212/sentinel-route/blob/main/src/api.py): `src/api.py`

### Model Lifecycle

- **MLflow Registry**
- [Telemetry Dataset](https://github.com/yash12212/sentinel-route/blob/main/data/raw/Big_data_dataset.csv): `data/raw/Big_data_dataset.csv`
- [Model Training](https://github.com/yash12212/sentinel-route/blob/main/src/train.py): `src/train.py`
- [Model Evaluation](https://github.com/yash12212/sentinel-route/blob/main/src/train.py): `src/train.py`
- [Champion Promotion](https://github.com/yash12212/sentinel-route/blob/main/src/train.py): `src/train.py`
- [Drift Baselines](https://github.com/yash12212/sentinel-route/blob/main/src/train.py): `src/train.py`

### Operations Loops

- [Operations CLI](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py): `src/ops.py`
- [Simulated Target](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py): `src/ops.py`
- [Healing Watchdog](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py): `src/ops.py`
- [Drift Detection](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py): `src/ops.py`
- [Drift Simulator](https://github.com/yash12212/sentinel-route/blob/main/src/ops.py): `src/ops.py`

### Shared Configuration

- [Runtime Configuration](https://github.com/yash12212/sentinel-route/blob/main/src/config.py): `src/config.py`

### Other components

- **Telemetry Client**

## Connections

- Telemetry Client → FastAPI Service: sends telemetry (evidence: `README.md`)
- FastAPI Service → Cascade Inference: dispatches prediction (evidence: `src/api.py`)
- Cascade Inference → MLflow Registry: loads champion models (evidence: `src/api.py`)
- Cascade Inference → Prediction Log: writes predictions (evidence: `src/api.py`)
- FastAPI Service → Prediction Log: reads aggregates (evidence: `src/api.py`)
- Telemetry Dataset → Model Training: provides training data (evidence: `README.md`)
- Model Training → Model Evaluation: evaluates candidates (evidence: `README.md`)
- Model Training → MLflow Registry: tracks and registers (evidence: `src/train.py`)
- Champion Promotion → MLflow Registry: sets champion alias (evidence: `src/train.py`)
- Model Training → Drift Baselines: writes baselines (evidence: `src/train.py`)
- Healing Watchdog → Simulated Target: polls telemetry (evidence: `src/ops.py`)
- Healing Watchdog → FastAPI Service: requests prediction (evidence: `src/ops.py`)
- Healing Watchdog → Simulated Target: restarts on anomaly (evidence: `README.md`)
- Drift Simulator → FastAPI Service: submits shifted traffic (evidence: `src/ops.py`)
- Drift Detection → Prediction Log: reads live rows (evidence: `src/ops.py`)
- Drift Detection → Drift Baselines: compares distributions (evidence: `src/ops.py`)
- Drift Detection → Model Training: triggers retraining (evidence: `src/ops.py`)
- Drift Detection → FastAPI Service: requests model reload (evidence: `src/ops.py`)
- FastAPI Service → Runtime Configuration: uses settings (evidence: `src/api.py`)
- Model Training → Runtime Configuration: uses settings (evidence: `src/train.py`)
- Operations CLI → Runtime Configuration: uses settings (evidence: `src/ops.py`)
