# dhanuk8778-netizen/mlops-production-system architecture

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

- Interactive diagram: https://gitdiagram.com/dhanuk8778-netizen/mlops-production-system
- Repository: https://github.com/dhanuk8778-netizen/mlops-production-system

## Overview

This repository ships a satellite-segmentation model as an ONNX inference service, with quantization, drift monitoring, latency measurement, and health-gated blue/green deployment. The main workflow is model artifact → calibrated INT8 export and validation → serving predictions → class-distribution monitoring; a separate deployment path starts candidate servers and gates proxy cutover on health and smoke tests. Edges reflect README statements or shown source references/calls; unsampled serving integrations and infrastructure wiring are not expanded beyond documented behavior.

Main entry points: [`src/serving/app.py`](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/app.py) (Inference API), [`models/segmentation_unet_int8.onnx`](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/models/segmentation_unet_int8.onnx) (ONNX model artifact), [`src/monitoring/psi.py`](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/psi.py) (PSI monitor), [`src/model/synthetic_data.py`](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/synthetic_data.py) (Synthetic tiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Model and data"]
  node_training_data["Synthetic tiles<br/>[synthetic_data.py]"]
  node_unet["Segmentation U-Net<br/>[unet.py]"]
  node_train["Quick training<br/>[train_quick.py]"]
end

subgraph group_export["Export and validation"]
  node_export_onnx["ONNX export<br/>[export_onnx.py]"]
  node_quantize["INT8 quantization<br/>[quantize.py]"]
  node_validate["Quantization validation"]
end

subgraph group_runtime["Inference and monitoring"]
  node_baseline["Baseline computation"]
  node_psi["PSI monitor<br/>[psi.py]"]
  node_drift_sim["Drift simulation<br/>[simulate_drift.py]"]
  node_api["Inference API<br/>[app.py]"]
  node_benchmark["Latency benchmark"]
  node_load_test["API load test<br/>[load_test.py]"]
end

subgraph group_deployment["Deployment"]
  node_proxy["Traffic proxy<br/>[proxy_app.py]"]
  node_deploy["Blue-green orchestrator"]
  node_remote_deploy["Remote deployment"]
end

node_user(("Inference client"))
node_artifact["ONNX model artifact"]
node_baseline_file["Drift baseline"]
node_proxy_client(("Traffic generator"))
node_aws[("AWS EC2 / SSM")]

node_train -->|"trains on"| node_training_data
node_train -->|"trains"| node_unet
node_export_onnx -->|"exports"| node_unet
node_quantize -->|"calibrates with"| node_training_data
node_quantize -->|"writes INT8"| node_artifact
node_validate -->|"evaluates samples"| node_training_data
node_validate -->|"compares models"| node_artifact
node_baseline -->|"samples"| node_training_data
node_baseline -->|"saves baseline via"| node_psi
node_baseline -->|"runs inference on"| node_artifact
node_psi -->|"loads and saves"| node_baseline_file
node_drift_sim -->|"simulates observations"| node_psi
node_api -->|"loads and runs"| node_artifact
node_api -->|"records predictions"| node_psi
node_user -->|"sends requests"| node_api
node_api -->|"returns predictions"| node_user
node_benchmark -->|"benchmarks"| node_artifact
node_load_test -->|"sends load"| node_api
node_deploy -->|"switches target"| node_proxy
node_deploy -->|"starts and health-checks"| node_api
node_proxy_client -->|"sends traffic"| node_proxy
node_deploy -.->|"counterpart documented"| node_remote_deploy
node_remote_deploy -.->|"deploys via SSM"| node_aws

click node_training_data "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/synthetic_data.py"
click node_unet "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/unet.py"
click node_train "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/train_quick.py"
click node_export_onnx "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/export_onnx.py"
click node_quantize "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/quantize.py"
click node_validate "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/validate_quantization.py"
click node_baseline "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/compute_baseline.py"
click node_psi "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/psi.py"
click node_drift_sim "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/simulate_drift.py"
click node_api "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/app.py"
click node_benchmark "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/benchmark_latency.py"
click node_load_test "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/load_test.py"
click node_proxy "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/deploy/proxy_app.py"
click node_deploy "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/deploy/blue_green_deploy.py"
click node_remote_deploy "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/scripts/ec2_blue_green_remote.sh"
click node_artifact "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/models/segmentation_unet_int8.onnx"
click node_baseline_file "https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/models/drift_baseline.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_training_data,node_unet,node_train,node_user toneBlue
class node_export_onnx,node_quantize,node_validate,node_aws toneAmber
class node_baseline,node_psi,node_drift_sim,node_api,node_benchmark,node_load_test toneMint
class node_proxy,node_deploy,node_remote_deploy toneRose
class node_artifact,node_proxy_client toneIndigo
class node_baseline_file toneTeal
```

## Components

### Model and data

- [Synthetic tiles](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/synthetic_data.py): `src/model/synthetic_data.py`
- [Segmentation U-Net](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/unet.py): `src/model/unet.py`
- [Quick training](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/model/train_quick.py): `src/model/train_quick.py`

### Export and validation

- [ONNX export](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/export_onnx.py): `src/export/export_onnx.py`
- [INT8 quantization](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/quantize.py): `src/export/quantize.py`
- [Quantization validation](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/export/validate_quantization.py): `src/export/validate_quantization.py`

### Inference and monitoring

- [Baseline computation](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/compute_baseline.py): `src/monitoring/compute_baseline.py`
- [PSI monitor](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/psi.py): `src/monitoring/psi.py`
- [Drift simulation](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/monitoring/simulate_drift.py): `src/monitoring/simulate_drift.py`
- [Inference API](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/app.py): `src/serving/app.py`
- [Latency benchmark](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/benchmark_latency.py): `src/serving/benchmark_latency.py`
- [API load test](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/serving/load_test.py): `src/serving/load_test.py`

### Deployment

- [Traffic proxy](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/deploy/proxy_app.py): `src/deploy/proxy_app.py`
- [Blue-green orchestrator](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/src/deploy/blue_green_deploy.py): `src/deploy/blue_green_deploy.py`
- [Remote deployment](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/scripts/ec2_blue_green_remote.sh): `scripts/ec2_blue_green_remote.sh`

### Other components

- **Inference client**
- [ONNX model artifact](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/models/segmentation_unet_int8.onnx): `models/segmentation_unet_int8.onnx`
- [Drift baseline](https://github.com/dhanuk8778-netizen/mlops-production-system/blob/main/models/drift_baseline.json): `models/drift_baseline.json`
- **Traffic generator**
- **AWS EC2 / SSM**

## Connections

- Quick training → Synthetic tiles: trains on (evidence: `src/model/train_quick.py`)
- Quick training → Segmentation U-Net: trains (evidence: `src/model/train_quick.py`)
- ONNX export → Segmentation U-Net: exports (evidence: `src/export/export_onnx.py`)
- INT8 quantization → Synthetic tiles: calibrates with (evidence: `src/export/quantize.py`)
- INT8 quantization → ONNX model artifact: writes INT8 (evidence: `src/export/quantize.py`)
- Quantization validation → Synthetic tiles: evaluates samples (evidence: `src/export/validate_quantization.py`)
- Quantization validation → ONNX model artifact: compares models (evidence: `src/export/validate_quantization.py`)
- Baseline computation → Synthetic tiles: samples (evidence: `src/monitoring/compute_baseline.py`)
- Baseline computation → PSI monitor: saves baseline via (evidence: `src/monitoring/compute_baseline.py`)
- Baseline computation → ONNX model artifact: runs inference on (evidence: `src/monitoring/compute_baseline.py`)
- PSI monitor → Drift baseline: loads and saves (evidence: `src/monitoring/psi.py`)
- Drift simulation → PSI monitor: simulates observations (evidence: `src/monitoring/simulate_drift.py`)
- Inference API → ONNX model artifact: loads and runs (evidence: `src/serving/app.py`)
- Inference API → PSI monitor: records predictions (evidence: `src/serving/app.py`)
- Inference client → Inference API: sends requests (evidence: `README.md`)
- Inference API → Inference client: returns predictions (evidence: `README.md`)
- Latency benchmark → ONNX model artifact: benchmarks (evidence: `src/serving/benchmark_latency.py`)
- API load test → Inference API: sends load (evidence: `README.md`)
- Blue-green orchestrator → Traffic proxy: switches target (evidence: `src/deploy/blue_green_deploy.py`)
- Blue-green orchestrator → Inference API: starts and health-checks (evidence: `src/deploy/blue_green_deploy.py`)
- Traffic generator → Traffic proxy: sends traffic (evidence: `README.md`)
- Blue-green orchestrator → Remote deployment: counterpart documented (evidence: `README.md`)
- Remote deployment → AWS EC2 / SSM: deploys via SSM (evidence: `README.md`)
