> For the complete documentation index, see [llms.txt](https://www.mlcompendium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.mlcompendium.com/ai-engineering/mlops.md).

# MLOps Patterns

Production ML repeats the same shapes. The page gathers the pattern guides first, the catalogs, roadmaps, courses, and Metaflow reading, and then shows two end-to-end systems that use them.

## General patterns

A pattern only helps once you can see where it sits in a product's life, so the catalogs start with the lifecycle itself. [ML product lifecycle patterns](https://medium.com/data-science/understanding-ml-product-lifecycle-patterns-a39c18302452) is Antony Mayi's guide to understanding ML-product lifecycle patterns, and the figure below is its picture of those lifecycles.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-11e98eabdc48b17adc0a6ffc2074fb1bbdaa368d%2Fimage%20(1)%20(1).png?alt=media" alt=""><figcaption><p>ML product lifecycle patterns</p></figcaption></figure>

Inside that lifecycle, the design choices have names. The [ML design patterns book](https://github.com/GoogleCloudPlatform/ml-design-patterns) repo is the source code accompanying the O'Reilly book Machine Learning Design Patterns, and the two figures after it are pages from that book.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-bec11514fecffe9654433c8181803c03d40f5a3e%2Fimage%20(2).png?alt=media" alt=""><figcaption><p>ML design patterns book</p></figcaption></figure>

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-275c7a03f229d88791c97c41547a46139512da90%2Fimage%20(1).png?alt=media" alt=""><figcaption><p>ML design patterns book</p></figcaption></figure>

The book's patterns are about the model; the next catalog is about the system around it. [MLOps design patterns](https://github.com/mercari/ml-system-design-pattern/tree/master) is Mercari's set of system design patterns for machine learning, shown in the figure below.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-010e5f9ed4d10fe26da6291328f7d7a1c5c6c80b%2Fimage.png?alt=media" alt=""><figcaption><p>MLOps design patterns</p></figcaption></figure>

When a single catalog is not enough, [Awesome MLOps](https://github.com/visenger/awesome-mlops) is the curated list of references for MLOps. The Visenger figure, copied from the original hosted image, and the table of contents after it show how that list is organized.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-414c94eb8c59ea7a74c2555b673090ba761e8cfe%2Fgimg-2a37b4dcacbf.png?alt=media" alt=""><figcaption><p>Visenger</p></figcaption></figure>

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-666e5c4c2f66abfdad16028ae6d83d1ad207f308%2Fimage%20(2)%20(1).png?alt=media" alt=""><figcaption><p>Table of contents</p></figcaption></figure>

Lists describe the field as it is; roadmaps describe where it is going. The [MLOps Roadmap](https://github.com/cdfoundation/sig-mlops/blob/main/roadmap/2022/MLOpsRoadmap2022.md) is the 2022 roadmap of the CD Foundation's SIG MLOps. [Google's Practitioners Guide to MLOps: a framework for continuous delivery and automation of machine learning](https://cloud.google.com/resources/mlops-whitepaper) is written for ML leaders and enterprise architects who want to understand MLOps in theory and in practice. The [State of MLOps](https://ml-ops.org/content/state-of-mlops) page on ml-ops.org comes with the template shown below.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-919a3a6d9505543b4642d252016fa83632d1b417%2Fimage%20(3).png?alt=media" alt=""><figcaption><p>Template</p></figcaption></figure>

The roadmaps become concrete in two hands-on pieces. [Easy MLOps with PyCaret and MLflow](https://medium.com/data-science/easy-mlops-with-pycaret-mlflow-7fbcbf1e38c6) is by Moez Ali. [Challenges and solutions by Iguazio](https://medium.com/data-science/ml-ops-challenges-solutions-and-future-trends-d2e59b74dc6b) is by Yaron Haviv, and the Iguazio figure below is credited to that article. The general-patterns figure after it is copied from the original hosted image.

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-9a3cd0c0eb5f2a3e730cefa4d87da851f17870fb%2Fgimg-cad16f4b25b6.png?alt=media" alt=""><figcaption><p>Iguazio</p></figcaption></figure>

<figure><img src="https://83674056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgd48oS5_duTKOVE_Et%2Fuploads%2Fgit-blob-2007cb8c772c30f4dd5e36a729e95a32c8cbebcb%2Fgimg-32acb26e3d04.png?alt=media" alt=""><figcaption><p>General patterns</p></figcaption></figure>

For a full course instead of articles, [Stanford CS329](https://stanford-cs329s.github.io/syllabus.html) is CS 329S: Machine Learning Systems Design. The course goes into how ML systems are built, and how to debug them, find a root cause, and monitor them.

One framework keeps coming up in these patterns, so the Metaflow reading on Medium follows, from a high-level review and the schema to docs on loading and storing data:

A pipeline also has to be tuned and watched once it runs. HyperparameterHunter is the thread of [Hyperopt, MLflow, unit tests, concept drift, using Python and Kafka](https://medium.com/data-science/putting-ml-in-production-ii-logging-and-monitoring-algorithms-91f174044e4e), the logging-and-monitoring side of putting ML in production.

The same notes are in [Drift](/ai-engineering/mlops-monitoring-and-alerts.md#drift) and [ML Experiment Management](/ai-engineering/experiment-management.md).

## Patterns in practice

With the catalogs in hand, two systems show the patterns running end to end.

The same notes are in [MetaFlow](/ai-engineering/full-stack-and-ops.md#metaflow) and [Prefect](/ai-engineering/full-stack-and-ops.md#prefect).

The first is an MLOps end-to-end system, "[You dont need a bigger boat](https://github.com/jacopotagliabue/you-dont-need-a-bigger-boat)", using Metaflow, Snowflake, DBT, Prefect, Great Expectations, Weights & Biases, SageMaker, and Lambda. The second strips that down: [A simplistic end-to-end system](https://github.com/jacopotagliabue/post-modern-stack) joins the modern data stack with the modern ML stack using Snowflake, DBT, S3, CometML, Reclist, and SageMaker.

Both systems follow the lifecycle this page opened with, and Antony Mayi's guide is also at its original address: A Guide to Classifying Operational Lifecycles of ML-Driven Products with an Overview of their Notable Patterns, ML product lifecycle patterns. <https://towardsdatascience.com/understanding-ml-product-lifecycle-patterns-a39c18302452>

## Deprecated links

{% hint style="warning" %}
These links and images no longer work. The original wording is kept here. A same-resource copy, when one was checked, is used above.
{% endhint %}

* Easy mlops with pycaret and mlflow. This address no longer opens: <https://towardsdatascience.com/easy-mlops-with-pycaret-mlflow-7fbcbf1e38c6>
* Challenges and solutions by iguazio. This address no longer opens: <https://towardsdatascience.com/ml-ops-challenges-solutions-and-future-trends-d2e59b74dc6b>
* 4 (amazing). This address no longer opens: <https://towardsdatascience.com/learn-metaflow-in-10-mins-netflixs-python-r-framework-for-data-scientists-2ef124c716e4>
* 5 (extra). This address no longer opens: <https://towardsdatascience.com/be-more-efficient-to-produce-machine-learning-pipeline-with-metaflow-db5f943ebbe7>
* HyperparameterHunter, Hyperopt, mlflow, unit test, concept drifts, using python and kafka. This address no longer opens: <https://towardsdatascience.com/putting-ml-in-production-ii-logging-and-monitoring-algorithms-91f174044e4e>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.mlcompendium.com/ai-engineering/mlops.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
