Software+AI Start a conversation

Portfolio · Production machine learning

Decision systems built for the hot path.

We build and run the machine learning that decides inside a product: which driver gets the ride, what a pricing change really did, which model version goes live this week.

Ride-hailing marketplaceEmbedded ML & platform teamJan 2022 to Aug 202417 cities, 2 datacenters

One ride, six candidates, six probabilities. Scores are the sample response documented for the inference service.

17cities with their own model in production
51tagged model releases in 24 months
32model versions served side by side
1%→100%per-city traffic ramp on every rollout
Marketplace Dispatch ML full showcase: 17-city driver acceptance prediction, Go inference gateway, and 51 immutable OpenShift releases
Case study 03. Per-city driver acceptance, a Go scoring path, and 51 tagged releases across 17 cities.

Capabilities

Six things we are hired to do

Real-time inference services

Go services that score a full candidate list in one call and run live experiments between model versions.

GoRedisTensorFlow ServingPrometheus

Streaming feature pipelines

Event consumers that turn a live ride stream into behavioural features, with idempotent writes and bounded concurrency.

NATS JetStreamKafkaPostgreSQL

Model training and release

Weekly retraining, GPU jobs on Kubernetes, experiment tracking, and immutable model images with one-click rollback.

TensorFlowAirflowMLflowHelm

Causal measurement

Counterfactual forecasting from donor cities, switchback experiments, and leakage guards that fail the build.

scikit-learnstatsmodelsClickHouse

Platform engineering

Self-hosted MLOps on OpenShift: object storage, tracking, Redis with Sentinel, Spark on Kubernetes, autoscaling.

KubernetesMinIOSparkRedis Sentinel

Applied marketplace science

Geospatial demand analysis on H3 hexagons, surge-conversion modelling and SHAP explainability for incentives.

H3LSTMSHAP

Case studies

Five systems, one marketplace

Built for one client over two and a half years. The model needs the features, the features need the pipeline, the experiments need the release system, and the measurement says whether any of it worked.

Will this driver take this ride?

Every offer the platform sends is scored by a neural network that predicts whether the driver will accept and complete it. One model per city, retrained every week.

Roughly one offer in twenty ends in a completed ride, so the signal lives in driver behaviour: recent accepts, this week's income, preferred distances, familiar destinations. Features are built in Spark from windows that end the moment before each offer, so nothing from the future leaks into training. A run is promoted only if it clears a gate on PR-AUC, loss and F1.

Four feature generations

v26126 active via mask v2x42 engineered v334 driver-history v3.134 + spatial input features per offer

Fewer, better features each generation: from raw weekly counters to recency, distance mix and district-level acceptance rates.

Retraining calendar

19 cities, two model families, 2-hour slots staggered across the week so training never competes for the same GPU. Schedule pattern

Apache Airflow · 19 cities × 5 DAG families · weekly Offer & event logs PostgreSQL · last 7 days Parquet in object store hour-by-hour extraction Spark feature job pre-offer windows only GPU training job TensorFlow · per-city DNN MLflow gate PR-AUC · loss · F1 Tagged release serving image promoted Champion against challenger 10,000 fresh offers scored on the live endpoint winner enters a live experiment
A week of logs becomes a candidate model, every week, for every city. Only runs that clear the gate are released.
  • Weekly retraining since 2021: first 15 per-city Kubernetes CronJobs, then about 99 Airflow DAGs generated from city config.
  • GPU jobs for training, tuning and fine-tuning on 7-million-row samples, every run tracked in MLflow.
  • The network beat AutoML, bagging, XGBoost and stacking baselines on ROC-AUC (0.72 against 0.69) at a 5% positive rate.
19city-specific model configurations
~99Airflow DAGs generated from config
4feature generations shipped, v2 to v3.1

Scoring every candidate while the request is still open

Dispatch gives the model between 300 milliseconds and one second to answer for a whole list of drivers. We built the service that answers, and the stream that keeps its features fresh.

One request per ride: price, distance, destination and every candidate driver. The gateway fetches precomputed driver features from Redis in two batched reads, adds ride context, and calls the city's TensorFlow model. A second service consumes ride events from NATS JetStream and keeps about forty behavioural features per driver current, with a six-hour TTL.

Example response, one ride

Sample request and response from the service documentation, 18 candidates, top 10 shown. The legacy score and the model disagree about who to offer to first.

Three experiment designs

Ride-ID bucketrideID mod 100 < n Time-sliced switchbackevery 15 or 60 min, parity flip Day of weekSat · Mon · Wed on v3

All three run per city from configuration. Version-against-version tests rolled out across eight cities.

Dispatch engine client's matching service Inference gateway Go · picks model variant per ride TensorFlow Serving 17 city models · versions = variants ride + candidate drivers probability per driver :predict · 61 or 42 features × N drivers predictions Redis driver features · 6 h TTL MGET, two batched reads Ride events NATS JetStream Feature service Go · ~40 features per driver PostgreSQL offers · events · metrics offer · accepted · finished idempotent batch inserts write features
The hot path (in colour) is one request from dispatch, two Redis reads, one model call. Everything slow or stateful happens off the request path.
  • Bounded concurrency, durable consumers with explicit acks, idempotent batch inserts, graceful shutdown.
  • 43% of the inference service is tests, including integration tests against in-memory Redis and a mocked model server.
  • 52 Prometheus metrics across the two services: cache-hit composition, model-call failures, per-version compute time.
17cities configured with their own thresholds and buckets
5–18autoscaled inference pods per region
3experiment designs available per city

Seventeen city models, one immutable release

A git tag is the release. Everything between a trained model and a serving pod is automated, and rolling back is one step.

The pipeline pulls each city's SavedModel from object storage, lays out the model tree, bakes every version into one TensorFlow Serving image and deploys it with Helm: rolling updates, 3 to 30 pods on CPU autoscaling, routes to both datacenters. Around it we ran the team's self-hosted MLOps platform on OpenShift.

Every tagged release, August 2022 to August 2024

Each dot is a git tag that became a serving image. Dates from the release repository.

What one image serves

17 city models, 32 versions in one container. Several versions stay live per city so experiments can compare them.

The platform around it

OPENSHIFT · ML TEAM NAMESPACES

Each box is a service we deployed and ran, as GitLab-CI-managed manifests with one build, release, deploy, rollback template.

  • Highly available Redis with Sentinel (one primary, four replicas), delivered on OpenShift's restricted security policy with a Helm post-renderer rather than a loosened policy.
  • Spark on Kubernetes through the operator, with S3 buckets and quotas provisioned declaratively.
  • A model-quality exporter prototyped for Prometheus: per-city precision, recall and F1 recomputed from live outcomes every two minutes.
51tagged releases in 24 months
32model versions live at once
3–30serving pods, scaled on CPU

What would this city have done without the change?

When pricing or dispatch changes in one city there is no control group. We built a service that estimates the counterfactual from the cities that did not change.

On the pre-treatment window, a model learns how a target city's daily metric tracks the same metric in donor cities, then keeps predicting after the change. The gap is the estimated effect. Treated cities freeze their pre-treatment model and stream predicted, actual and signed error to a dashboard every morning.

How the estimate reads

Actual against counterfactual, indexed to 100. The shaded gap after the change is the effect. Illustrative series

Post-period error by city and metric

Mean absolute percentage error over the post-period, from the delivered reports. Part of this gap is the treatment itself.

  • Gradient-boosted regressors chosen after benchmarking eleven classical time-series families and Bayesian ridge across four cities.
  • A leakage test in CI fails the build if a treated city appears in another city's donor pool.
  • The same method evaluated a new dispatch mode in two cities with a weekday switchback and t-tests. The effect was not significant, and the report said so.
2–10%post-period error, five cities, five metrics
11forecasting families benchmarked
34cities of daily KPIs in the donor pool

Three questions the marketplace needed answered

Shorter studies that fed product decisions: how surge converts, where pooling is possible, and what drives a driver's response to an incentive.

How does surge convert?

Surge features only12.3 Surge + marketplace4.6 mean absolute error, rides per price check

Per-hexagon LSTM models on 30-second supply and demand buckets. Adding marketplace state to the surge engine's features cut error by 63%.

Where is pooling possible?

1.2 million rides matched on origin and destination hexagons within the same window. Between 24% and 29% had at least one match candidate. Map illustrative

What drives incentive response?

SHAP explanations over a 59-feature incentive-response model, so the incentive team could see which levers the model used. Illustrative plot

63%lower error on surge conversion
1.2Mrides analysed for pooling potential
59features explained with SHAP

Approach

How we work when the system is live

Ship behind a dial

Per city, bucketed by ride ID: 1%, 10%, 50%, 100%. The same dials run the experiments.

Test the serving path

Unit and integration tests boot the real server against in-memory dependencies. CI blocks on them.

Measure in production

Metrics from the first deploy. Model quality recomputed from live outcomes, not only the validation set.

Release immutably

Models baked into tagged images. Deploy, rollback and delete are each one step.

Guard the experiment

Leakage checks fail the build. Null results are reported as null results.

Configure per market

Thresholds, quantiles, buckets and versions live in config. A new city is a config change.

Stack

Tools we have run in production

Languages
GoPythonSQLProtobuf
Machine learning
TensorFlow / Kerasscikit-learnstatsmodelsSHAPPySpark
Serving & MLOps
TensorFlow ServingMLflowApache AirflowGPU jobs on KubernetesGitLab CI
Data & streaming
PostgreSQLClickHouseRedis & SentinelMinIO / S3Apache SparkNATS JetStreamApache Kafka
Platform
KubernetesOpenShift / OKDHelmPrometheuscert-managerH3

Timeline

Two and a half years, in order

2022 · Q1First counterfactual serviceDaily donor-city models for five cities, on dashboards.
2022 · Q2–Q3The real-time stack landsData pipeline, inference API, immutable releases and the MLOps platform, within three months.
2023Automated retrainingWeekly Airflow DAGs, GPU jobs, Spark on Kubernetes, the v2x and v3 model families.
2024Feature store and live experimentsJetStream feature service, switchback tests in eight cities, version-against-version comparisons.

Work with us

Have a decision your product makes thousands of times an hour?

We take on embedded engagements: a small ML and platform team that ships into your stack, owns it in production and hands it over documented.

softwareplusai2024@gmail.com

Client name withheld under confidentiality. Figures come from the delivered code, configuration and release history. Graphics marked illustrative show the shape of a result, not client data.