---
title: "How Shopify improved consumer search intent with real-time ML"
description: "Shopify generates about 2,500 text and image embeddings per second (216M/day) in near real time with Google Cloud Dataflow and Apache Beam's RunInference on T4 GPUs, feeding Storefront Semantic Search and a BigQuery warehouse."
url: "https://swe.quest/articles/how-shopify-improved-consumer-search-intent-with-real-time-ml-15d46e89bc4248e9"
canonical: "https://shopify.engineering/how-shopify-improved-consumer-search-intent-with-real-time-ml"
source: "Shopify Engineering"
published: "2024-10-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["inference","stream-processing","ml-platform","search","cost-optimization"]
---

# How Shopify improved consumer search intent with real-time ML

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2024-10-18, 8 min read, Case study. Original: [https://shopify.engineering/how-shopify-improved-consumer-search-intent-with-real-time-ml](https://shopify.engineering/how-shopify-improved-consumer-search-intent-with-real-time-ml)

## Summary

Shopify generates about 2,500 text and image embeddings per second (216M/day) in near real time with Google Cloud Dataflow and Apache Beam's RunInference on T4 GPUs, feeding Storefront Semantic Search and a BigQuery warehouse. Cutting Dataflow's per-process worker harness threads from 12 to 4 reduced memory use about 2.6x, from roughly 104GB to 40GB, without hurting GPU-bound throughput. That let the team drop high-memory machines and save 14% in cost. Sharing one model across processes and forcing a single SDK container both hurt throughput too much. Bursty input produced bundles of one element, so in-bundle batching rarely formed real batches, but stateful cross-bundle batching added unacceptable shuffle latency; per-process model copies still keep the GPU saturated.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Stream processing](https://swe.quest/tags/stream-processing.md) (Data & databases)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- Apache Beam basics ([easy posts on Elixir & Erlang](https://swe.quest/tags/elixir-erlang.md?difficulty=easy))
- GPU inference ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

Google Cloud Dataflow, Apache Beam, RunInference, BigQuery, NVIDIA T4, Shopify Storefront Search

## Related posts

- [Building world-class product search at Shopify: Where C++ excellence meets ML innovation](https://swe.quest/articles/building-world-class-product-search-at-shopify-where-c-excellence-meets-ml-0dc65e1a92fe63ec.md): Shopify Engineering · 2025-11-12 · Easy · 5 min read · Search, Performance engineering, C & C++, Machine learning, Language design
  Shopify's product search runs ML ranking models (transformers, neural rankers, CatBoost/LightGBM) at native C++ speed through RankFlow, a Python-like ranking DSL, and TurboDSL, its execution engine.
- [Introducing the Hugging Face Embedding Container for Amazon SageMaker](https://swe.quest/articles/introducing-the-hugging-face-embedding-container-for-amazon-sagemaker-cc289650f9404f51.md): Hugging Face · 2024-06-07 · Medium · 7 min read · Inference & serving, Cloud platforms, RAG & retrieval, Python
  The Hugging Face Embedding Container for Amazon SageMaker, built on Text Embedding Inference (TEI), is now generally available for deploying open embedding models such as Snowflake Arctic Embed and BGE.
- [Boost your throughput with dynamic batching](https://swe.quest/articles/boost-your-throughput-with-dynamic-batching-c7c722ba8af78c33.md): Modal · 2024-09-16 · Medium · 4 min read · Inference & serving, Performance engineering, Serverless, Python
  Modal added a \`@modal.batched()\` decorator that groups incoming requests into batches flushed when either \`max\_batch\_size\` is reached or \`wait\_ms\` elapses, avoiding the unbounded waits of fixed-size batching.
- [Leveraging multimodal LLMs for Shopify’s global catalogue: Recap of expo talk at ICLR 2025](https://swe.quest/articles/leveraging-multimodal-llms-for-shopify-s-global-catalogue-recap-of-expo-talk-at-5a595806db6311fb.md): Shopify Engineering · 2025-07-16 · Medium · 11 min read · LLMs, E-commerce, Model training, Inference & serving, Evaluation
  Shopify's Global Catalogue uses fine-tuned open-source vision LLMs (LLaVA 1.5 7B, then LLaMA 3.2 11B, now Qwen2VL 7B) to classify, extract attributes from, standardize and match billions of merchant product listings.
- [Benchmarking Text Generation Inference](https://swe.quest/articles/benchmarking-text-generation-inference-6c04e8c47131c2d4.md): Hugging Face · 2024-05-29 · Medium · 10 min read · Inference & serving, Performance engineering, LLMs
  Text Generation Inference ships a benchmarking tool that profiles LLM serving across batch sizes, plotting throughput against latency separately for prefill and decode so deployments can be tuned for a workload such as RAG or chat.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
