Appinventiv Call Button
CASE STUDY / FOOD DELIVERY & QSR / ENTERPRISE

Built an in-store ETA prediction engine 'Promise
Time' for Americana

We built Promise Time for Americana, a per-store machine learning system that predicts how long every order spends in the kitchen, so the arrival window a customer sees stays honest.

11 UAE stores covered
52+ Features engineered per store
6 Feature families behind each prediction
<50ms P99 prediction latency
Overview

The hardest part of a delivery promise happens in the kitchen.

Americana runs KFC and other quick-service brands across the UAE, and every delivery order carries a promise: an arrival window the customer can count on. The hardest variable in that window is not the road or the driver. It is the kitchen.

Across 11 UAE stores, there was no reliable way to predict how long an order would spend inside a store, from the moment it was placed to the moment it was ready for pickup. Without that number, dispatch fell back on static averages.

We built Promise Time, a per-store machine learning system that turns the kitchen from a blind spot into a number dispatch can trust.

The Challenge

Dispatch was guessing the kitchen with a single average.

A static average was a blunt instrument. It broke down at exactly the moments that mattered the most: peak hours, public holidays, and bad weather. Four problems stood in the way of anything better.

Churn stayed invisible until the cancellation landed

Preparation time
refused to sit still

In-store time used to swing from four minutes off-peak to twenty-five minutes or more during the weekend rush. One average could not describe a kitchen that changed by the hour.

Churn stayed invisible until the cancellation landed

Eleven kitchens, eleven
personalities

Each store carried its own capacity, staffing, and menu mix. A single global model trained across the network would have flattened those differences and generalized to none of them.

Churn stayed invisible until the cancellation landed

Getting it wrong was not
symmetrical

A driver who arrived before the food waited idle, and the order ran late on the screen. A driver who arrived after cost nothing. Under-prediction hurt far more than over-prediction, and the model had to know that.

Churn stayed invisible until the cancellation landed

The signals that explained
demand were missing

Weather, public holidays, and time-of-day patterns drove order volume, yet none of them fed any model. Historical orders sat in per-store CSV files with no live pipeline to read them.

The Solution

A model per kitchen, tuned for the cost of being wrong.

We built Promise Time as a fleet of per-store models, each learning the rhythm of its own kitchen. Every prediction reads time, weather, holidays, live workload, and recent kitchen velocity, then gets corrected against the orders that have just finished. The output feeds the arrival window that the customer sees in the app.

Promise Time trains an independent XGBoost regressor for each of the 11 stores. One store's lunch rush never contaminates another's, and any location can be retrained on its own as its menu, staffing, or footfall shifts. The model estimates in-store time the instant an order is placed, and that estimate is what powers the arrival window on the customer's screen.

The result is the honest arrival window a customer can plan around, set the moment they order and held all the way to the doorstep.

The business cost of error was lopsided, as was the training objective. Promise Time uses an asymmetric mean-squared-error loss that penalizes under-predictions three times harder than over-predictions, with weights set at 3.0 against 1.0.

That single design choice baked the priority into every training run. It is better to have a driver wait two minutes for food than to have food sit five minutes waiting for a driver, and the model now leans that way on its own. When timing does slip, the system surfaces it honestly rather than letting the food go cold on a false promise.

Each prediction reads 52 engineered features grouped into six families. Time features capture peak and off-peak rhythm with cyclic sine and cosine encoding. Holiday features track the days around public holidays when demand spikes. Weather features pull temperature, rain, wind, and humidity, because bad weather means more delivery orders.

Now, workload counts the orders already in progress when a new one lands. Lag features roll the mean in-store time across seven windows, from ten minutes to two hours, to read recent kitchen velocity. Source dummies flag whether the order came from the app, the web, or an aggregator.

Models learn patterns, but they cannot see a fryer that went down ten minutes ago or a no-show on the line. So every prediction passes through a recency adjustment: an inverse-distance-weighted correction over the last 60 minutes of completed orders.

Orders that finished moments ago count for far more than orders from the top of the hour. When a store suddenly slows, Promise Time feels it before the next prediction goes out.

Promise Time ships as a FastAPI service behind a single Uvicorn worker, a deliberate choice. XGBoost already saturates every CPU core, so extra workers would only double the memory each pod holds. Models load on first request and stay cached, keeping P99 prediction latency under 50 milliseconds while roughly 4 GB of per-store models sit in memory.

The whole system runs on Azure, containerized through ACR into AKS with autoscaling on CPU and memory, with weather and holiday lookups, secrets, and monitoring wired in around it.

Tech Stack

Development Framework that Fuels ETA Prediction Engine

Python 3.12
Python 3.12
Tavily
Tavily
FastAPI
FastAPI
LangChain
LangChain
LangGraph
LangGraph
GPT 4o
GPT 4o
GPT 4.1
GPT 4.1
MongoDB
MongoDB
Redis
Redis
Docker
Docker
Kubernetes (AWS EKS)
Kubernetes (AWS EKS)
AWS ECR
AWS ECR
GitLab CI
GitLab CI
GPT 4o Mini
GPT 4o Mini
Pydantic
Pydantic
AWS Secrets Manager
AWS Secrets Manager
GPT 4.1 Nano
GPT 4.1 Nano
The Result

From a static average to a number that dispatch can trust.

Promise Time replaced a one-size-fits-all approach with a per-store prediction tuned for the real cost of error, corrected by the minute, and served fast enough to sit inside live dispatch. It is engineered to a tight accuracy bar.

±10%
Compliance target, prediction vs actual
3x
Penalty weight on under-predictions
7
Rolling velocity windows per order
~4 GB
Per-store models held in memory

Promise Time turns the kitchen, the least predictable link in the delivery chain, into a signal dispatch can plan around. Across 11 UAE stores, the arrival window a customer sees is no longer a hopeful average. It is a live, per-store prediction built to stay within ±10% of what actually happens.

Put a number where the guesswork is

We design and ship per-store prediction, predictive ETA, and production ML on Azure for delivery and QSR teams. Bring us the blind spot in your operation and we will model it.