# klp-tech/utility-load-forecast-pilot architecture

> Architecture diagram of the GitHub repository klp-tech/utility-load-forecast-pilot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/klp-tech/utility-load-forecast-pilot
- Repository: https://github.com/klp-tech/utility-load-forecast-pilot

## Overview

This is a local utility-load forecasting pilot: users normalize meter data, assemble observed and archived weather inputs, run zero-shot models and baselines under realistic forecast timing and data delays, then inspect accuracy and peak-risk reports. The graph preserves the synthetic-demo and multi-foundation-model branches as well as the main backtest workflow. Source excerpts show shared-helper use and model-adapter dispatch; README statements support the broader file-based workflow. Some internal backtest steps are omitted from the excerpts, so no additional internal call chain is inferred.

Main entry points: [`backtest.py`](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/backtest.py) (Chronos backtest), [`common.py`](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/common.py) (Shared config and features), [`weather.py`](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/weather.py) (Historical weather fetch), [`compare_models.py`](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/compare_models.py) (Model comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Data and features"]
  node_prep["Meter preparation<br/>[prep.py]"]
  node_common["Shared config and features<br/>[common.py]"]
  node_demo["Synthetic load generator<br/>[make_demo_data.py]"]
end

subgraph group_weather["Weather inputs"]
  node_actualweather["Historical weather fetch<br/>[weather.py]"]
  node_archivedweather["Archived forecast fetch"]
end

subgraph group_forecast["Forecasting"]
  node_backtest["Chronos backtest<br/>[backtest.py]"]
  node_foundation["Foundation model adapters"]
  node_compare["Model comparison<br/>[compare_models.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_analysis["Forecast analysis<br/>[analysis.py]"]
  node_reports["Tables and figures"]
end

node_operator(("Utility analyst"))
node_meter["Meter export"]
node_openmeteo["Open-Meteo"]

node_operator -->|"provides data"| node_prep
node_prep -->|"loads config"| node_common
node_prep -->|"writes hourly load"| node_backtest
node_operator -->|"configures site"| node_actualweather
node_actualweather -->|"uses helpers"| node_common
node_actualweather -->|"fetches history"| node_openmeteo
node_actualweather -->|"provides weather"| node_demo
node_demo -->|"uses helpers"| node_common
node_demo -->|"writes synthetic load"| node_backtest
node_operator -->|"configures site"| node_archivedweather
node_archivedweather -->|"uses helpers"| node_common
node_archivedweather -->|"fetches archived runs"| node_openmeteo
node_archivedweather -->|"supplies forecast weather"| node_backtest
node_actualweather -->|"supplies actual weather"| node_backtest
node_backtest -->|"uses helpers"| node_common
node_backtest -->|"writes forecast results"| node_analysis
node_analysis -->|"uses helpers"| node_common
node_analysis -->|"writes reports"| node_reports
node_operator -->|"starts evaluation"| node_backtest
node_compare -->|"reuses backtest logic"| node_backtest
node_compare -->|"uses helpers"| node_common
node_compare -->|"dispatches models"| node_foundation
node_operator -->|"starts comparison"| node_compare
node_compare -->|"writes summaries"| node_reports

click node_prep "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/prep.py"
click node_common "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/common.py"
click node_demo "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/make_demo_data.py"
click node_actualweather "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/weather.py"
click node_archivedweather "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/weather_forecast.py"
click node_backtest "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/backtest.py"
click node_foundation "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/foundation_models.py"
click node_compare "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/compare_models.py"
click node_analysis "https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/analysis.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_prep,node_common,node_demo toneBlue
class node_actualweather,node_archivedweather toneAmber
class node_backtest,node_foundation,node_compare toneMint
class node_analysis,node_reports toneRose
class node_operator,node_meter,node_openmeteo toneIndigo
```

## Components

### Data and features

- [Meter preparation](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/prep.py): `prep.py`
- [Shared config and features](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/common.py): `common.py`
- [Synthetic load generator](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/make_demo_data.py): `make_demo_data.py`

### Weather inputs

- [Historical weather fetch](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/weather.py): `weather.py`
- [Archived forecast fetch](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/weather_forecast.py): `weather_forecast.py`

### Forecasting

- [Chronos backtest](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/backtest.py): `backtest.py`
- [Foundation model adapters](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/foundation_models.py): `foundation_models.py`
- [Model comparison](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/compare_models.py): `compare_models.py`

### Evaluation

- [Forecast analysis](https://github.com/klp-tech/utility-load-forecast-pilot/blob/main/analysis.py): `analysis.py`
- **Tables and figures**

### Other components

- **Utility analyst**
- **Meter export**
- **Open-Meteo**

## Connections

- Utility analyst → Meter preparation: provides data (evidence: `README.md`)
- Meter preparation → Shared config and features: loads config (evidence: `prep.py`)
- Meter preparation → Chronos backtest: writes hourly load (evidence: `README.md`)
- Utility analyst → Historical weather fetch: configures site (evidence: `README.md`)
- Historical weather fetch → Shared config and features: uses helpers (evidence: `weather.py`)
- Historical weather fetch → Open-Meteo: fetches history (evidence: `weather.py`)
- Historical weather fetch → Synthetic load generator: provides weather (evidence: `README.md`)
- Synthetic load generator → Shared config and features: uses helpers (evidence: `make_demo_data.py`)
- Synthetic load generator → Chronos backtest: writes synthetic load (evidence: `README.md`)
- Utility analyst → Archived forecast fetch: configures site (evidence: `README.md`)
- Archived forecast fetch → Shared config and features: uses helpers (evidence: `weather_forecast.py`)
- Archived forecast fetch → Open-Meteo: fetches archived runs (evidence: `weather_forecast.py`)
- Archived forecast fetch → Chronos backtest: supplies forecast weather (evidence: `README.md`)
- Historical weather fetch → Chronos backtest: supplies actual weather (evidence: `README.md`)
- Chronos backtest → Shared config and features: uses helpers (evidence: `backtest.py`)
- Chronos backtest → Forecast analysis: writes forecast results (evidence: `README.md`)
- Forecast analysis → Shared config and features: uses helpers (evidence: `analysis.py`)
- Forecast analysis → Tables and figures: writes reports (evidence: `analysis.py`)
- Utility analyst → Chronos backtest: starts evaluation (evidence: `README.md`)
- Model comparison → Chronos backtest: reuses backtest logic (evidence: `compare_models.py`)
- Model comparison → Shared config and features: uses helpers (evidence: `compare_models.py`)
- Model comparison → Foundation model adapters: dispatches models (evidence: `compare_models.py`)
- Utility analyst → Model comparison: starts comparison (evidence: `README.md`)
- Model comparison → Tables and figures: writes summaries (evidence: `README.md`)
