2025Hybrid ML + LLM forecasting system
TCG Demand Forecasting
SKU-level demand forecasting that pairs gradient boosting with LLM reasoning over external signals, then answers the question a planner actually has: how much do I order, and what breaks if I don't.
Status · Built as a hybrid ML + LLM forecasting system. The simulator on this site runs a real model in your browser on clearly-labelled example data.
The problem
Inventory decisions are made per SKU, weekly, under uncertainty — and spreadsheets answer them with a single number and no sense of risk. The cost of being wrong is asymmetric: a stockout loses the sale and the customer, overstock only loses cash. A point forecast cannot express that.
The approach
- 01Model demand at SKU level with gradient boosting over engineered calendar, trend, lag and promotion features.
- 02Produce distributions rather than points, so stockout risk and safety stock fall out of the forecast instead of being guessed.
- 03Fold external signals into features where they measurably help, and let an LLM reason over them for context a table cannot carry.
- 04Output the decision, not the chart: reorder quantity, safety stock, stockout risk per SKU.
What I did
- Built the feature engineering pipeline and the LightGBM forecasting models.
- Implemented probabilistic output and the inventory logic on top of it — safety stock, reorder point, stockout risk.
- Designed the hybrid layer where LLM reasoning over external signals supplements the statistical model.
- Exposed it as a service planners could query per SKU.
Architecture
Tap any component to see what it does and what it runs on.
Ingestion
Processing
Models
Orchestration
Interfaces
Select any component to inspect it. Architecture as implemented.
Trade-offs I would defend
Gradient boosting, not deep learning
On tabular retail demand with limited history per SKU, LightGBM with good features beat heavier sequence models and stayed debuggable. Choosing the fashionable model here would have cost accuracy and explainability at once.
LLM as an input, never as the forecaster
The language model contributes context and explanation. The number comes from the statistical model, because a forecast that cannot be back-tested is not a forecast.
Stack & evidence
- LightGBM
- Python
- Feature engineering
- LLM reasoning
- FastAPI
- Role
- Modelling and system design
- Stack
- LightGBM, Python, feature engineering, FastAPI
- Interactive here
- Browser simulator on example data
Next case study
Chandler OS
Agentic operations for ship chandlers