# vighneshmane07/end-to-end-mlops-pipeline architecture

> Architecture diagram of the GitHub repository vighneshmane07/end-to-end-mlops-pipeline, 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/vighneshmane07/end-to-end-mlops-pipeline
- Repository: https://github.com/vighneshmane07/end-to-end-mlops-pipeline

## Overview

This repository is an Iris-classification MLOps demo. Its main user workflow accepts four flower measurements through FastAPI, validates them, runs inference using a saved model or fallback rule, optionally logs the prediction, and returns a labeled result. A separate training workflow loads Iris data, trains and evaluates a Random Forest, saves a local artifact, and logs the run to MLflow. The code excerpts show the API orchestration, training steps, and optional Elasticsearch logging; deployment details are documented but not mapped as runtime components.

Main entry points: [`app/main.py`](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/main.py) (FastAPI routes), [`training/train.py`](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/training/train.py) (Training pipeline), [`app/predict.py`](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/predict.py) (Iris predictor), [`app/monitoring.py`](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/monitoring.py) (Prediction logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_artifact[("Local model artifact")]
  node_iris_data["Iris dataset"]
  node_trainer["Training pipeline<br/>[train.py]"]
  node_mlflow["MLflow tracking"]
end

subgraph group_inference["Prediction service"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_schemas["Request and response<br/>[schemas.py]"]
  node_predictor["Iris predictor<br/>[predict.py]"]
end

subgraph group_observability["Prediction monitoring"]
  node_logger["Prediction logger<br/>[monitoring.py]"]
  node_elasticsearch[("Elasticsearch")]
end

node_user(("API client"))

node_user -->|"sends request"| node_api
node_api -->|"validates and formats"| node_schemas
node_api -->|"requests prediction"| node_predictor
node_api -->|"logs prediction"| node_logger
node_api -->|"returns response"| node_user
node_predictor -->|"loads model"| node_artifact
node_trainer -->|"loads dataset"| node_iris_data
node_trainer -->|"saves model"| node_artifact
node_trainer -->|"logs run"| node_mlflow
node_logger -.->|"indexes document"| node_elasticsearch

click node_api "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/main.py"
click node_schemas "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/schemas.py"
click node_predictor "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/predict.py"
click node_artifact "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/tree/main/models"
click node_trainer "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/training/train.py"
click node_logger "https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/monitoring.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_artifact,node_iris_data,node_trainer,node_mlflow,node_user toneBlue
class node_api,node_schemas,node_predictor toneAmber
class node_logger,node_elasticsearch toneMint
```

## Components

### Model training

- [Local model artifact](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/tree/main/models): `models`
- **Iris dataset**
- [Training pipeline](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/training/train.py): `training/train.py`
- **MLflow tracking**

### Prediction service

- [FastAPI routes](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/main.py): `app/main.py`
- [Request and response](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/schemas.py): `app/schemas.py`
- [Iris predictor](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/predict.py): `app/predict.py`

### Prediction monitoring

- [Prediction logger](https://github.com/vighneshmane07/end-to-end-mlops-pipeline/blob/main/app/monitoring.py): `app/monitoring.py`
- **Elasticsearch**

### Other components

- **API client**

## Connections

- API client → FastAPI routes: sends request (evidence: `README.md`)
- FastAPI routes → Request and response: validates and formats (evidence: `app/main.py`)
- FastAPI routes → Iris predictor: requests prediction (evidence: `app/main.py`)
- FastAPI routes → Prediction logger: logs prediction (evidence: `app/main.py`)
- FastAPI routes → API client: returns response (evidence: `app/main.py`)
- Iris predictor → Local model artifact: loads model (evidence: `app/predict.py`)
- Training pipeline → Iris dataset: loads dataset (evidence: `training/train.py`)
- Training pipeline → Local model artifact: saves model (evidence: `training/train.py`)
- Training pipeline → MLflow tracking: logs run (evidence: `training/train.py`)
- Prediction logger → Elasticsearch: indexes document (evidence: `app/monitoring.py`)
