# dpr23/eta architecture

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

- Interactive diagram: https://gitdiagram.com/dpr23/eta
- Repository: https://github.com/dpr23/eta

## Overview

This repository trains a LightGBM delivery-ETA model and provides an interactive Gradio predictor. The runtime flow is user input through the interface to feature assembly and model prediction, then a formatted ETA. Separately, `train.py` generates synthetic logistics data, trains and evaluates a model, and saves the artifact loaded by the app. The README mentions a POST API, but the shown runtime source defines a Gradio interface; no API handler is evidenced.

Main entry points: [`app.py`](https://github.com/dpr23/eta/blob/main/app.py) (ETA predictor), [`train.py`](https://github.com/dpr23/eta/blob/main/train.py) (Training pipeline), [`lgbm_eta_model.pkl`](https://github.com/dpr23/eta/blob/main/lgbm_eta_model.pkl) (Trained model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["ETA prediction"]
  node_interface["Gradio interface<br/>[app.py]"]
  node_predictor["ETA predictor<br/>[app.py]"]
  node_model["Trained model<br/>[lgbm_eta_model.pkl]"]
end

subgraph group_training["Model training"]
  node_trainer["Training pipeline<br/>[train.py]"]
  node_synthetic["Synthetic data<br/>[train.py]"]
end

node_user(("User"))

node_user -->|"submits inputs"| node_interface
node_interface -->|"calls"| node_predictor
node_predictor -->|"predicts with"| node_model
node_predictor -->|"returns ETA"| node_interface
node_trainer -->|"generates"| node_synthetic
node_trainer -->|"saves model"| node_model

click node_interface "https://github.com/dpr23/eta/blob/main/app.py"
click node_predictor "https://github.com/dpr23/eta/blob/main/app.py"
click node_model "https://github.com/dpr23/eta/blob/main/lgbm_eta_model.pkl"
click node_trainer "https://github.com/dpr23/eta/blob/main/train.py"
click node_synthetic "https://github.com/dpr23/eta/blob/main/train.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_interface,node_predictor,node_model,node_user toneBlue
class node_trainer,node_synthetic toneAmber
```

## Components

### ETA prediction

- [Gradio interface](https://github.com/dpr23/eta/blob/main/app.py): `app.py`
- [ETA predictor](https://github.com/dpr23/eta/blob/main/app.py): `app.py`
- [Trained model](https://github.com/dpr23/eta/blob/main/lgbm_eta_model.pkl): `lgbm_eta_model.pkl`

### Model training

- [Training pipeline](https://github.com/dpr23/eta/blob/main/train.py): `train.py`
- [Synthetic data](https://github.com/dpr23/eta/blob/main/train.py): `train.py`

### Other components

- **User**

## Connections

- User → Gradio interface: submits inputs (evidence: `app.py`)
- Gradio interface → ETA predictor: calls (evidence: `app.py`)
- ETA predictor → Trained model: predicts with (evidence: `app.py`)
- ETA predictor → Gradio interface: returns ETA (evidence: `app.py`)
- Training pipeline → Synthetic data: generates (evidence: `train.py`)
- Training pipeline → Trained model: saves model (evidence: `train.py`)
