How Devox Software helped an online retailer launch production demand forecasting, plug it into purchasing workflows, and bring operations in-house.
About the client
An established US-based online retailer manages a broad assortment with different sales patterns, promotional schedules, and replenishment lead times
Technology Stack
ML vs. AI engineering: a quick note on terms. This project is machine learning in the strict sense: a model trained on the client’s own sales history. That’s different from AI engineering, RAG systems, agents, chatbots, where you wire up a pre-trained LLM and nothing trains. Structured transaction data like this doesn’t need an LLM; it needs a model that learns from four years of the client’s own numbers.
Overview
The retailer had several years of transaction history, but purchasing teams still relied on historical reports and spreadsheet calculations to estimate future demand. Sales history covered about four years, which captured yearly seasonality for most established products. Newer items had less history and followed a separate fallback.
The Head of Demand Planning was responsible for keeping purchasing decisions consistent across the growing assortment. Each week the team patched together spreadsheets from different categories before reviewing replenishment needs. Crunching the numbers ate up time the team could’ve spent digging into unusual demand spikes and pressure-testing their buy decisions.
Things came to a head during a seasonal promo. Several promoted products sold out way earlier than expected, while other items just sat overstocked. The planning team had reviewed the available reports, but its spreadsheet process could not consistently account for promotions, stock availability, and changing sales patterns across thousands of products.
“These projects always come top-down. Management knows the data is there, years of sales history, and they’ve seen what others are doing with it. Then they go looking for people who can turn it into decisions.” — Mykhailo Dubovyi, ML Engineer at Devox
Before the next big campaign, the Head of Demand Planning wanted a forecast process the team could actually count on. The client also wanted its own engineers to maintain the system after launch.
Devox Software delivered the project through a Build-Operate-Transfer engagement. The initial release covered 25,000 active SKUs across selected categories and produced weekly forecasts for a rolling four-week horizon. Before the first production cycle, the engagement spelled out who owned what: which decisions stayed with the Head of Demand Planning, which data-source owners supplied inputs during Build, and which internal engineers would own scheduled runs, retraining, and failed-job recovery after the supervised handoff. Writing it all down meant both sides could see exactly how much work would land on the client’s plate after the handover.
The system forecast demand at the SKU × week level for total online demand, with no split by warehouse, so each run published about 100,000 values. Breaking that demand down by warehouse was handled later in the replenishment process.
Seven Months, Turnkey
The project lasted seven months: three months to build and launch, three months of production operations managed by Devox, and one month of supervised handoff.
Devox’s team included a full-time ML engineer acting as technical lead, a data engineer who was full-time during Build and part-time during Operate, a half-time data scientist during modeling and evaluation, and part-time DevOps and project management. On the client side, the Head of Demand Planning and data-source owners joined in the first week, two data engineers and a DevOps engineer joined part-time in the first month, and a data science specialist joined in the third month. The client engineers took part in DAG reviews, model-registry promotions, and incident walkthroughs during Operate, and their hours were tracked, so the handoff plan reflected the capacity that would actually remain once Devox stepped back.
The Head of Demand Planning remained responsible for business requirements and final acceptance. Devox worked with purchasing managers and internal engineers to build the system around their existing planning cycle.
The engagement was turnkey on purpose. The client didn’t hand over prepped datasets or ready-made pipelines, just raw sources. Devox designed the storage, the transformations, the features, the evaluation, the training loop, and the monitoring, and advised on what was worth doing at each step.
Build
The project began with a review of how purchasing decisions were made: which products managers reviewed, what information they used, and when forecasts had to be available.
Together, the teams agreed on a weekly forecast covering the next four weeks. The first release focused on established products with sufficient history, giving managers a consistent assortment to evaluate before expanding coverage.
Architecture
The system ran entirely in the client’s AWS account, defined in Terraform:
All infrastructure modules, container images, and secrets stayed in the client’s account and repositories from the first environment. Devox held temporary roles that were removed at the end of the supervised handoff; the internal DevOps engineer could still plan, apply, and roll back the same Terraform modules.
When the Sales HistorWhen the Sales History Liesy Lies
Scheduled pipelines combined order history, stock availability, prices, promotions, and product attributes. Data preparation included rules for returns, canceled orders, duplicate records, and product identifier changes.
All sources were loaded daily:
| Source | Method |
| Orders, cancellations, returns | Incremental SQL queries from a read replica of the commerce platform |
| Available stock | Compressed CSV files from the warehouse system over SFTP |
| Prices and catalog | Full SQL extracts |
| Promotion calendar | Approved CSV export from the commercial team |
Airflow kept the original extracts in S3 and converted them to Parquet after validation. Every load carried its source date, load time, and batch ID. Incremental queries re-read the last seven days to catch late-arriving changes, and reloads never created duplicates. Canceled orders were excluded, returns were netted against the original sale week, and a mapping table linked old and new identifiers for relabeled or replaced products. Planners could still see the original sales figures next to the adjusted series used for training, so the distinction stayed visible in the weekly review.
Availability was the tricky part. Periods when products were unavailable were flagged and handled separately during training-data preparation. That way the model wouldn’t read a stockout as ‘nobody wants this thing.’
Because the forecast covered total online demand, availability was based on stock sellable online across the whole network. A day with zero available stock was marked unavailable, while a missing snapshot was marked unknown rather than zero. Weeks with fewer than four available days were excluded from training targets, and weeks with four to six available days received an adjusted sales estimate and a lower training weight.
Availability was a feature only for completed periods, the previous week and the last four weeks, never for the week being forecast. Accuracy evaluation used only fully available weeks with known availability.
From the start of the project, every source was stored as an immutable daily snapshot with its receipt date and, where possible, the record’s validity period. Features for a historical forecast were computed only from data available before that date.
Past promotions were rebuilt from archived calendars and change logs, historical prices from transactions and available price history, and the catalog from its change history where one existed. Overwritten states with no remaining source were not guessed: the related features were left out of retrospective experiments. Evaluation reports stated which date ranges used captured history and which relied on reconstruction.
Model development compared seasonal baseline forecasts with a LightGBM model using historical sales, rolling statistics, calendar features, pricing, and promotional indicators. Evaluation used successive historical forecast dates, with results reviewed by category and sales volume.
The production model was a single global LightGBM model for the initial assortment, using the one-to-four-week forecast horizon as a feature. Each horizon was predicted directly, without feeding earlier predictions into later ones. Features included:
The objective was Tweedie, suited to non-negative volumes with many zeros, chosen over Poisson and standard regression on time-based validation. Hyperparameters were tuned with Optuna in about 40 trials on separate development folds, never on the final test year.
The baseline was a seasonal naive forecast with a 52-week lag, scaled for recent changes in sales level using only information available before the forecast date. Products without a year of history used a simple fallback baseline. Final evaluation used 12 rolling origins across the last year. At each origin, the model was retrained on the history available then and forecast the next four weeks, with the same targets, stockout filters, and assortment as the baseline.
Products with less than 13 weeks of usable history went to a fallback based on available sales and category patterns. For products with sales history, the team calculated an average daily sales rate, converted it to weekly volume, and adjusted it using the category’s historical seasonal profile. Products without sales were estimated from an agreed set of comparable products and flagged as low confidence for planner review. Every fallback row carried its method (category_seasonal or cold_start), and category managers saw it in the review view, where they could accept or override the value before the purchasing deadline.
Monday at 04:00
The production workflow ran through scheduled Airflow jobs. MLflow tracked training runs and model artifacts. Each published forecast included its generation date, forecast period, and model version.
The weekly DAG started on Monday at 04:00 Eastern Time, after Sunday’s data closed, and ran ingestion, validation, feature preparation, scoring, and publication. Scoring was due by 06:30, and publication with the Power BI refresh by 08:00, ahead of the 10:00 purchasing review. Forecasts were written to PostgreSQL under a new run ID, and the run became current only after all checks passed. Airflow then triggered the Power BI refresh through the REST API, and a separate daily morning refresh loaded actuals and monitoring results.
Purchasing managers accessed the results in Power BI, alongside recent sales and current stock levels. Acceptance criteria for each weekly run included on-time publication, completeness against the active assortment, and a short list of SKUs the Head of Demand Planning marked for manual review. Those criteria were agreed in the first two weeks and used to decide when a run was ready for the purchasing meeting.
Getting Planners to Actually Trust the Numbers
During the pilot, better numbers on paper didn’t automatically buy planner trust. Category managers pushed back on forecasts that didn’t match their gut, especially for promoted products and items coming back in stock.
The Head of Demand Planning worked with Devox to review those disagreements against actual sales. Some came down to business context the model didn’t have; others showed that spreadsheet-based judgment no longer held up.
The forecast view was expanded to show recent sales, stock availability, and promotion indicators together. Managers could investigate a forecast without stitching the supporting data together themselves. The report also showed the forecasting method used for each product and highlighted items where the forecast differed sharply from the last four weeks of sales.
From there, the forecast rolled out one category at a time; managers signed off on each batch before it joined the weekly routine.
Operate
For three months after launch, Devox supported the system through live purchasing cycles.
Because the planning team needed results before its weekly review, monitoring covered source-data arrival, pipeline completion, forecast coverage, and publication timing. ECS task logs and Airflow task results went to Amazon CloudWatch. CloudWatch alarms sent notifications through Amazon SNS to a shared support email for failed DAGs or tasks, stale sources, blocked or late publication, and missing results. During Operate, a Devox ML engineer was on call as the primary responder, with the data engineer as backup and infrastructure issues escalated to DevOps. Coverage ran during working hours, with a dedicated check of the Monday morning run.
As actual sales came in, the team reviewed forecast error and bias across categories and sales-volume segments. That surfaced systematic under- and over-forecasting that one overall accuracy number would’ve hidden. A weekly evaluation job calculated WAPE and signed bias for the model, the fallback, and the seasonal baseline, excluding weeks affected by stockouts, and wrote the results to a Power BI monitoring page.
One real production issue was an incomplete source-data load: the processing job would have continued and built a forecast on partial inputs.
To keep incomplete data out of purchasing reviews, the team introduced a publication gate checking source freshness, record volumes, and expected product coverage. Failed checks blocked the new forecast and triggered an alert. The previous forecast stayed available with its original generation date.
Before publication, the gate checked that:
Volume and coverage deviations could be approved manually after the cause was reviewed, and the approver went on record. Structural errors and invalid values always blocked publication. Uncovered SKUs went to an exception list rather than being silently skipped.
Retraining followed the same discipline. A candidate model had to go up against the current production model and the seasonal baseline before anything shipped; a retrain by itself never replaced the production version.
Each month, a candidate was trained and scored on the same recent rolling-origin folds. To replace the production model, the candidate had to:
Otherwise, the current model stayed in production. Technical approval came from the Devox ML tech lead and, after transfer, from the client’s data science specialist; the Head of Demand Planning approved the business impact of significant changes. Promotion used MLflow model versions, approval tags, and a champion alias. Each run resolved the alias to a specific version and recorded it with the results. Rollback restored the previous version; fixing an already-released forecast meant a new run and publication.
Internal engineers participated in these reviews and incident investigations. As real incidents cropped up, each one produced a short written review and, where needed, a new check or runbook step.
Transfer
The handover moved work to the client’s data engineers, an internal data science specialist, and DevOps a step at a time.
Data engineers took over ingestion, transformations, and data validation. The data science specialist picked up model evaluation and retraining. DevOps handled environments, deployment, access, and infrastructure monitoring.
The Head of Demand Planning and purchasing managers still owned business requirements
The transfer included:
Most of the docs were written as the project went along and tightened during joint operation.
CI/CD was handed over in working form. GitHub Actions ran:
GitHub Actions accessed AWS through OIDC rather than stored keys. Full backtests ran in the candidate evaluation process.
During the final month, the client’s engineers led operations while Devox watched and reviewed execution.
To close out the handover, the team independently ran four consecutive weekly forecasting cycles, evaluated a retrained model, and recovered from a simulated pipeline failure in the test environment. The drill removed the latest expected stock snapshot. The team had to receive the alert, identify the missing source, confirm the gate blocked the new forecast and the previous one stayed available with the right date, load the snapshot, rerun the affected tasks without duplicating data, and verify the new result, its publication, and the Power BI refresh. Runbook gaps found along the way were fixed before the handover closed.
Results
For the Head of Demand Planning, the change showed up in the weekly routine. Less time reconciling spreadsheets, more time reviewing purchasing decisions, and a clear internal team keeping forecasts available.
One lesson from the handover: internal ownership has to be practiced. Running live forecasting cycles while Devox was still around gave the client’s engineers time to find gaps, settle open questions, and prove they could run the thing.
Planning a production ML system your team will eventually own? Talk to Devox Software about building it, running it, and handing it over.
Having trouble booking? Open the booking page.
Tell us where your system needs help — we’ll show you how to move forward with clarity and speed. From architecture to launch — we’re your engineering partner.
Book your free consultation. We’ll help you move faster, and smarter.
Share the details of your project – like scope or business challenges. Our team will carefully study them and then we’ll figure out the next move together.
We appreciate you reaching out. Your message has been received, and a member of our team will get back to you within 24 hours.
In the meantime, feel free to follow our social.
Welcome to the Devox Software community! We're excited to have you on board. You'll now receive the latest industry insights, company news, and exclusive updates straight to your inbox.