# The Post Modern Stack

Jacopo Tagliabue, Coveo | MLOps Meetup | Episode 103 | 1:04:58
Hosted by Ben Epstein

Source: https://www.youtube.com/watch?v=JUFgKSZo1j4
Channel: MLOps Community, now AAIF Live (https://www.youtube.com/@AAIFLive-x1r). Summarised by MLOps Talks.
Page: https://mlopstalks.com/talks/the-post-modern-stack
Published: 2022-06-21
Tags: data-pipelines, model-serving, recommender-systems, testing

## TL;DR
- A small team can build an end-to-end ML pipeline without adopting the full complexity associated with large companies.
- The post-modern stack joins Snowflake and dbt for data preparation with Metaflow for versioning, remote compute, testing, and deployment.
- A real session-based recommendation pipeline can move from 30 million anonymized e-commerce events to a live prediction endpoint with a relatively small amount of code.

## Summary
Jacopo Tagliabue presents a streamlined alternative to the larger MLOps stacks often shown by major technology companies. His example uses Snowflake and dbt to turn raw JSON events into model-ready tables, then uses Metaflow to connect data retrieval, model training, artifact versioning, testing, and deployment. The workshop uses a real anonymized e-commerce dataset with 30 million events rather than a toy dataset. The model is an LSTM that predicts the next product in a shopper's session. Training can run locally or on an AWS GPU, while deployment uses Amazon SageMaker. Jacopo argues that data quality, reliability, and a workable pipeline often matter more than squeezing out additional model accuracy. He is also direct about the limits of the example. Data quality checks and cleanup after failed deployments still require explicit work, and Metaflow's serialization support depends on whether objects can be pickled. The repository is intended as a starting point that teams can extend with other warehouses, trackers, or serving systems.

## Key ideas
### ML practice is often presented as more complex than it needs to be
[07:56](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=476s)
Jacopo says ML discussions often show polished systems from companies such as Uber and DeepMind, while ordinary work may involve importing a scikit-learn model and writing a few lines of Python. He identifies two misleading ideas: that models are the main source of value and that building ML pipelines requires a large specialist team. For many teams, he argues, better data and more reliable systems provide more benefit than small gains in model accuracy. He also says that a few people with the right tools can build a pipeline at terabyte scale before adding more staff or complexity.

### The post-modern stack removes infrastructure that beginners may not need
[15:04](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=904s)
The earlier repository, called 'You Don't Need a Bigger Boat', showed a fuller pipeline with data preparation, validation, feature construction, model building, deployment, and tracking. Users found it useful but difficult to set up because it had many moving parts. The new post-modern stack keeps the basic blocks while removing some of the surrounding machinery, including a separate orchestrator. Jacopo describes it as a way to move from zero to a solid first version of an ML pipeline, with the option to add more components later.

### The workshop uses a real recommendation workload instead of toy data
[16:16](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=976s)
The example starts with an anonymized e-commerce dataset containing 30 million events. The raw records describe product interactions, including timestamps, URLs, product IDs, and session IDs. The pipeline turns these events into a session-based recommendation dataset. Its model receives products a shopper has interacted with and predicts the next product they are likely to view. Jacopo uses this example to show that the same pipeline structure can handle a real workload rather than relying on the Iris or Titanic datasets.

### Snowflake and dbt prepare warehouse data for training
[17:15](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=1035s)
The raw input arrives as JSON-like events in Snowflake. dbt runs SQL transformations that first flatten the records into a tabular form, with fields such as the product ID represented as columns. A second transformation groups product interactions into lists that the sequential model can consume. Metaflow then queries the prepared table and stores the resulting dataset as a versioned artifact. Jacopo explains that the SQL inside the Metaflow flow mainly retrieves and filters data, while the reusable transformations remain in dbt.

### Metaflow connects local development with remote training
[31:00](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=1860s)
The training step uses a Metaflow decorator that can send only the training code to an AWS GPU. An environment variable enables or disables that remote execution, so the same pipeline can run locally during development or use cloud hardware for a larger job. Metaflow stores the model and other values marked with self as versioned artifacts. This gives the team a record of which dataset, parameters, and model belonged to each run.

### Testing happens before the model is deployed
[34:00](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=2040s)
Before deployment, the flow runs tests with Reckless. The tests use the trained model to produce predictions and check whether they satisfy selected qualitative and quantitative constraints. Jacopo also describes Metaflow Cards, which can record a visual HTML representation of a step and preserve it with the run. The test stage is intended to stop a model from reaching the endpoint when its outputs fail the team's stated conditions.

### Deployment can be a small amount of Python when the model artifact is ready
[37:06](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=2226s)
The deployment step stores the serialized model in Amazon S3 and asks Amazon SageMaker to create an endpoint from that artifact. Jacopo says the endpoint can be launched with two Python commands once the model is in the format SageMaker expects. The demo checks that the endpoint is running, sends it through the end-to-end flow, and then deletes it so the workshop does not keep paying for the compute. A production deployment would leave the endpoint running.

### Scaling the example mostly changes configuration rather than pipeline code
[50:00](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=3000s)
Jacopo says the data transformation layer can keep the same SQL as the dataset grows because Snowflake handles the warehouse computation. Training can move from a local run to cloud GPU execution by enabling a decorator. Serving can also change through the serving image and SageMaker instance settings. He presents this as the main value of the template: moving from a small dataset to a much larger one should require parameter changes rather than a rewrite of the pipeline.

### Lineage and cleanup still need deliberate engineering
[52:45](https://www.youtube.com/watch?v=JUFgKSZo1j4&t=3165s)
In response to questions, Jacopo explains that Metaflow gives each run its own ID and stores its artifacts separately, which helps with debugging and prevents one run from overwriting another. It does not automatically guarantee cleanup when a later step fails after deploying an endpoint. The code needs an explicit cleanup path, such as a try/finally pattern. He also says Metaflow's self-based artifact storage depends on objects being pickleable, which is why the example decomposes the model into a JSON-like representation rather than directly serializing the Keras model.

## Notable quotes
- Jacopo Tagliabue: "The general guess is that you're not Google, but that's totally okay." (10:39)
- Jacopo Tagliabue: "Very few people with the right tools can actually build a terabyte-scale pipeline that works effectively before you need to bring on more people or more complexity." (09:46)
- Jacopo Tagliabue: "You develop locally and then when you need it you can spin off specific steps of this compute and just those to a GPU in the cloud." (32:01)
- Jacopo Tagliabue: "Every run is a universe in itself in that sense." (39:29)
- Jacopo Tagliabue: "You start with 200,000 rows or whatever and you go to 30 million and you don't have to change a single thing in all of this if not some parameters." (51:12)

## Tools & references mentioned
- MLOps Community
- Demetrios Brinkmann
- Metaflow
- Snowflake
- dbt
- scikit-learn
- Uber
- DeepMind
- Amazon SageMaker
- AWS
- Comet
- Reckless
- Great Expectations
- Keras
- Spark
- Airflow
- BigQuery
- Kubernetes

## Who should watch
- You are building an ML system with a small team and want a practical starting point instead of a large platform stack.
- Your data is already in a warehouse, and you need a path from SQL transformations to training, testing, and serving.
- You use Metaflow or are evaluating it and want to understand its artifact versioning, remote execution, and deployment model.

## Editor's note

Jacopo Tagliabue shows that a small team can move the same recommendation pipeline from local development to cloud training without rewriting it. ZenML lets teams write workflows as Python steps and choose the orchestrator and infrastructure through configuration, so the same pipeline code can run on a laptop, Kubernetes, Airflow, Kubeflow, or a cloud service. Each run records its inputs, outputs, and code version for tracing.

Written by the MLOps Talks editors (the ZenML team), not by the speaker.

## Related talks

- [Building a Modern Data Analytics Stack](https://mlopstalks.com/talks/building-a-modern-data-analytics-stack) (Jeff Katz, Jigsaw Labs, 55:21)
- [Human-centric ML Infrastructure: A Netflix Original](https://mlopstalks.com/talks/human-centric-ml-infrastructure-a-netflix-original) (Savin Goyal, Netflix, 56:07)
- [Building an ML Platform from Scratch: Live Coding Session](https://mlopstalks.com/talks/building-an-ml-platform-from-scratch-live-coding-session) (Alon Gubkin, Aporia, 1:57:24)
- [Building an ML Platform from scratch](https://mlopstalks.com/talks/building-an-ml-platform-from-scratch) (, 1:46:08)
- [Modern ML Stack is a Lie](https://mlopstalks.com/talks/modern-ml-stack-is-a-lie) (Mike Del Balso, Tecton & Joe Reis, 22:20)
