# sifoukhemira/mlops-tp architecture

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

- Interactive diagram: https://gitdiagram.com/sifoukhemira/mlops-tp
- Repository: https://github.com/sifoukhemira/mlops-tp

## Overview

This is a small fraud-classification service with a model-training workflow and a FastAPI prediction API. Training reads a fraud dataset, prepares features, fits and evaluates a classifier, and saves model/schema artifacts while logging the run to MLflow. The API loads those artifacts, accepts schema-validated requests, and returns predictions and probabilities. The README is empty; the graph reflects the shown source excerpts, so it does not infer behavior for the empty inference or config modules.

Main entry points: [`src/mlops_tp/api.py`](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/api.py) (FastAPI service), [`src/mlops_tp/train.py`](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/train.py) (Train workflow), [`src/mlops_tp/artifacts`](https://github.com/sifoukhemira/mlops-tp/tree/main/src/mlops_tp/artifacts) (Model artifacts), [`src/mlops_tp/schemas.py`](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/schemas.py) (Prediction request)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_trainer["Train workflow<br/>[train.py]"]
end

subgraph group_serving["Prediction API"]
  node_api["FastAPI service<br/>[api.py]"]
  node_request_schema["Prediction request<br/>[schemas.py]"]
end

subgraph group_artifacts["Model artifacts"]
  node_artifact_store["Model artifacts"]
end

node_dataset["Fraud dataset"]
node_mlflow["MLflow tracking"]
node_client(("API client"))

node_trainer -->|"reads"| node_dataset
node_trainer -->|"writes"| node_artifact_store
node_trainer -->|"logs run"| node_mlflow
node_client -.->|"requests prediction"| node_api
node_api -->|"validates with"| node_request_schema
node_api -->|"loads"| node_artifact_store
node_api -->|"returns prediction"| node_client

click node_trainer "https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/train.py"
click node_artifact_store "https://github.com/sifoukhemira/mlops-tp/tree/main/src/mlops_tp/artifacts"
click node_api "https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/api.py"
click node_request_schema "https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/schemas.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_trainer,node_client toneBlue
class node_api,node_request_schema toneAmber
class node_artifact_store toneMint
class node_dataset,node_mlflow toneIndigo
```

## Components

### Model training

- [Train workflow](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/train.py): `src/mlops_tp/train.py`

### Prediction API

- [FastAPI service](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/api.py): `src/mlops_tp/api.py`
- [Prediction request](https://github.com/sifoukhemira/mlops-tp/blob/main/src/mlops_tp/schemas.py): `src/mlops_tp/schemas.py`

### Model artifacts

- [Model artifacts](https://github.com/sifoukhemira/mlops-tp/tree/main/src/mlops_tp/artifacts): `src/mlops_tp/artifacts`

### Other components

- **Fraud dataset**
- **MLflow tracking**
- **API client**

## Connections

- Train workflow → Fraud dataset: reads (evidence: `src/mlops_tp/train.py`)
- Train workflow → Model artifacts: writes (evidence: `src/mlops_tp/train.py`)
- Train workflow → MLflow tracking: logs run (evidence: `src/mlops_tp/train.py`)
- API client → FastAPI service: requests prediction
- FastAPI service → Prediction request: validates with (evidence: `src/mlops_tp/api.py`)
- FastAPI service → Model artifacts: loads (evidence: `src/mlops_tp/api.py`)
- FastAPI service → API client: returns prediction (evidence: `src/mlops_tp/api.py`)
