Unlocking Real-time Predictions with Shopify's Machine Learning Platform
Shopify extended its Ray-based Merlin ML platform with online inference, running each real-time model as a dedicated service in its own namespace on GKE that loads models from the Comet ML registry and can read features from the Feast-based Pano store. The serving layer is written in Python and offers three tiers: no-code MLServer configs, low-code custom MLServer classes, and fully custom FastAPI services, all scaffolded by a Merlin CLI from cookiecutter templates. Users test serving layers in short-lived Merlin Workspaces, then deploy through Shopify's standard Services DB, Buildkite and Shipit pipelines with separate staging and production configs for autoscaling and resource tuning.
Related posts
- The Magic of Merlin: Shopify's New Machine Learning Platform
Shopify Engineering mediumAdeptMerlin is Shopify's redesigned ML platform built on open source tools. It uses Ray clusters running on Kubernetes as short-lived, per-use-case "Merlin Workspaces", and "Merlin Projects" are Docker images with isolated Python environments built through CI/CD. Data scientists prototype from JupyterHub through the Ray Client, then productionize by scheduling Airflow DAGs that create a workspace, run the job and tear it down, with Datadog and Splunk for monitoring. Onboarding the product categorization model took few code changes: Ray Train distributed TensorFlow training, and Ray ActorPool distributed multi-step batch inference.
- Shopify's Playbook for Scaling Machine Learning
Shopify Engineering easyNoviceShopify's approach to scaling machine learning grew out of its first ML product, an order fraud detector that replaced a rule-based system with a high false-positive rate. Teams should pick a problem users care about, confirm the data is trustworthy and accessible, account for downstream dependencies such as fulfillment, and optimize for product outcomes rather than raw model scores. Shopify shipped a simple logistic regression model, built in Python, serialized to PMML, scheduled with Airflow and served in real time from Rails. To scale to hundreds of models, Shopify relies on input/output reconciliation, shadow backtesting, drift monitoring, platform-enforced best practices and automated model operations.
- How Doppel eliminated ML infrastructure tax with Modal
Modal mediumAdept
Doppel, which builds ML models to detect social engineering attacks, moved much of its training and inference from sequential experiments and GCP Cloud Run to Modal. On the training side, independent work such as K-fold cross-validation now runs in parallel via Modal's map(), and coding agents drive the experiment loop through Modal's CLI. For inference, image layer caching and persistent volumes for model weights cut builds from 10–30 minutes by up to 10x, with sub-minute warm builds. Autoscaling absorbs attack-campaign spikes without Cloud Run's one-GPU-per-instance limit, and direct remote calls replace the hand-built Flask HTTP layer around each model.
- How Shopify turns open models into task experts
Shopify Engineering hardMasterShopify's Sidekick keeps a frontier model for merchant conversation and planning but offloads token-heavy subagent work, such as GraphQL query generation, to open models it post-trains and self-hosts. Each model is built through a loop: a rubric and an LLM judge tuned with GEPA/ACE to match human agreement, an optimized frontier agent as the baseline, open-model selection, early inference benchmarking with AIPerf, nightly self-healing that converts failed conversations into training data via critic hints, and post-training with Megatron Bridge. For GraphQL, Nemotron 3.5 Lightning went from 37.7 to 74.5 on the judge after six loops and about 61,000 healed examples, beating the frontier model's 73. It also cut median latency from 6.50s to 0.87s and serving cost by about 90%, and Blackwell GPUs made both training and serving cheaper.
- Deploy Triton Inference Server on Railway
Railway mediumAdeptNVIDIA Triton Inference Server can serve CPU-friendly ML models on Railway, with MinIO as an S3-compatible model repository. The walkthrough starts with PyTriton wrapping a simple AddSub model in a Docker image and calling it through the Triton HTTP client. It then moves to plain tritonserver in poll mode, reading a model repository from MinIO so models such as a Python AddSub and a TorchScript ResNet18 load dynamically when uploaded. Config.pbtxt layouts, the required AWS credential environment variables and a client for listing models and running inference are all shown.