# aakash1552005/telco-churn-mlops architecture

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

- Interactive diagram: https://gitdiagram.com/aakash1552005/telco-churn-mlops
- Repository: https://github.com/aakash1552005/telco-churn-mlops

## Overview

This is a Telco customer-churn MLOps platform: it ingests and validates data, engineers features, trains and evaluates models, applies promotion governance, then serves predictions through a secured API. Its operational loop adds drift detection, monitoring, and automated retraining. The graph includes the documented MLflow, Prometheus/Grafana, Kubernetes, and Jenkins capabilities; their specific runtime wiring is not fully shown in the excerpts, so those links are documented rather than inferred from co-location.

Main entry points: [`src/api/routes.py`](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/routes.py) (API routes), [`src/api/app.py`](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/app.py) (FastAPI application), [`src/monitoring/drift.py`](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/drift.py) (Drift detection), [`src/api/metrics.py`](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/metrics.py) (Metrics instrumentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_ingestion["Data ingestion<br/>[ingestion.py]"]
  node_validation["Schema validation<br/>[validation.py]"]
  node_features["Feature engineering<br/>[features.py]"]
end

subgraph group_ml["Model lifecycle"]
  node_training["Model training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_promotion["Promotion policy<br/>[promotion.py]"]
  node_registry[("MLflow registry")]
end

subgraph group_serving["Prediction service"]
  node_api["FastAPI application<br/>[app.py]"]
  node_routes["API routes<br/>[routes.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
  node_security["API security<br/>[security.py]"]
  node_inference["Prediction service<br/>[service.py]"]
end

subgraph group_ops["Monitoring and retraining"]
  node_metrics["Metrics instrumentation<br/>[metrics.py]"]
  node_drift["Drift detection<br/>[drift.py]"]
  node_state[("Drift state<br/>[state.py]")]
  node_jenkins["Retraining trigger<br/>[jenkins_trigger.py]"]
end

subgraph group_platform["Runtime platform"]
  node_config["Configuration<br/>[config.py]"]
  node_logging["Structured logging<br/>[logging.py]"]
  node_prometheus["Prometheus"]
  node_grafana["Grafana"]
  node_kubernetes["Kubernetes runtime<br/>[deployment.yaml]"]
  node_jenkins_service["Jenkins"]
end

node_source(("Dataset source"))
node_customer(("API client"))

node_source -->|"supplies data"| node_ingestion
node_ingestion -.->|"validates dataset"| node_validation
node_validation -.->|"checks schema"| node_features
node_features -.->|"prepares features"| node_training
node_training -.->|"evaluates model"| node_evaluation
node_evaluation -.->|"informs promotion"| node_promotion
node_promotion -->|"registers model"| node_registry
node_registry -->|"loads production model"| node_inference
node_customer -.->|"sends requests"| node_api
node_api -->|"includes routes"| node_routes
node_routes -->|"requests prediction"| node_inference
node_routes -->|"validates payloads"| node_schemas
node_routes -->|"applies security"| node_security
node_routes -->|"records telemetry"| node_metrics
node_drift -->|"tracks windows"| node_state
node_drift -->|"triggers retraining"| node_jenkins
node_drift -->|"updates drift metrics"| node_metrics
node_api -->|"sets model info"| node_metrics
node_prometheus -->|"scrapes metrics"| node_api
node_grafana -->|"visualizes telemetry"| node_prometheus
node_kubernetes -.->|"orchestrates serving"| node_api
node_jenkins_service -.->|"runs trigger"| node_jenkins

click node_ingestion "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/ingestion.py"
click node_validation "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/validation.py"
click node_features "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/features.py"
click node_training "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/train.py"
click node_evaluation "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/evaluate.py"
click node_promotion "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/promotion.py"
click node_api "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/app.py"
click node_routes "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/routes.py"
click node_schemas "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/schemas.py"
click node_security "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/security.py"
click node_inference "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/inference/service.py"
click node_metrics "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/metrics.py"
click node_drift "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/drift.py"
click node_state "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/state.py"
click node_jenkins "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/jenkins_trigger.py"
click node_config "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/core/config.py"
click node_logging "https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/core/logging.py"
click node_kubernetes "https://github.com/aakash1552005/telco-churn-mlops/blob/main/infra/k8s/deployment.yaml"

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_ingestion,node_validation,node_features,node_customer toneBlue
class node_training,node_evaluation,node_promotion,node_registry toneAmber
class node_api,node_routes,node_schemas,node_security,node_inference toneMint
class node_metrics,node_drift,node_state,node_jenkins toneRose
class node_config,node_logging,node_prometheus,node_grafana,node_kubernetes,node_jenkins_service,node_source toneIndigo
```

## Components

### Data preparation

- [Data ingestion](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/ingestion.py): `src/data/ingestion.py`
- [Schema validation](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/validation.py): `src/data/validation.py`
- [Feature engineering](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/data/features.py): `src/data/features.py`

### Model lifecycle

- [Model training](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/train.py): `src/training/train.py`
- [Model evaluation](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/evaluate.py): `src/training/evaluate.py`
- [Promotion policy](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/training/promotion.py): `src/training/promotion.py`
- **MLflow registry**

### Prediction service

- [FastAPI application](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/app.py): `src/api/app.py`
- [API routes](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/routes.py): `src/api/routes.py`
- [Request schemas](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/schemas.py): `src/api/schemas.py`
- [API security](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/security.py): `src/api/security.py`
- [Prediction service](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/inference/service.py): `src/inference/service.py`

### Monitoring and retraining

- [Metrics instrumentation](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/api/metrics.py): `src/api/metrics.py`
- [Drift detection](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/drift.py): `src/monitoring/drift.py`
- [Drift state](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/state.py): `src/monitoring/state.py`
- [Retraining trigger](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/monitoring/jenkins_trigger.py): `src/monitoring/jenkins_trigger.py`

### Runtime platform

- [Configuration](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/core/config.py): `src/core/config.py`
- [Structured logging](https://github.com/aakash1552005/telco-churn-mlops/blob/main/src/core/logging.py): `src/core/logging.py`
- **Prometheus**
- **Grafana**
- [Kubernetes runtime](https://github.com/aakash1552005/telco-churn-mlops/blob/main/infra/k8s/deployment.yaml): `infra/k8s/deployment.yaml`
- **Jenkins**

### Other components

- **Dataset source**
- **API client**

## Connections

- Dataset source → Data ingestion: supplies data (evidence: `src/data/ingestion.py`)
- Data ingestion → Schema validation: validates dataset
- Schema validation → Feature engineering: checks schema
- Feature engineering → Model training: prepares features
- Model training → Model evaluation: evaluates model (evidence: `src/training/evaluate.py`)
- Model evaluation → Promotion policy: informs promotion
- Promotion policy → MLflow registry: registers model (evidence: `src/training/promotion.py`)
- MLflow registry → Prediction service: loads production model (evidence: `src/inference/service.py`)
- API client → FastAPI application: sends requests
- FastAPI application → API routes: includes routes (evidence: `src/api/app.py`)
- API routes → Prediction service: requests prediction (evidence: `src/api/routes.py`)
- API routes → Request schemas: validates payloads (evidence: `src/api/routes.py`)
- API routes → API security: applies security (evidence: `src/api/routes.py`)
- API routes → Metrics instrumentation: records telemetry (evidence: `src/api/routes.py`)
- Drift detection → Drift state: tracks windows (evidence: `src/monitoring/drift.py`)
- Drift detection → Retraining trigger: triggers retraining (evidence: `src/monitoring/drift.py`)
- Drift detection → Metrics instrumentation: updates drift metrics (evidence: `src/monitoring/drift.py`)
- FastAPI application → Metrics instrumentation: sets model info (evidence: `src/api/app.py`)
- Prometheus → FastAPI application: scrapes metrics (evidence: `README.md`)
- Grafana → Prometheus: visualizes telemetry (evidence: `README.md`)
- Kubernetes runtime → FastAPI application: orchestrates serving
- Jenkins → Retraining trigger: runs trigger
