Hello! Welcome back to our final module, Architecture for AI & Machine Learning.
In our previous lessons, we've pieced together the building blocks of a modern ML system: a feature store to manage data for models, training pipelines to produce models, and inference patterns to serve predictions. Now it's time to zoom out and see how these components are integrated into a single, cohesive system.
Today's lesson introduces MLOps (Machine Learning Operations), the discipline that brings software engineering rigor to the machine learning lifecycle. Our learning outcome is to explain the core components of MLOps (e.g., experiment tracking, model registry, deployment). As an architect, understanding this end-to-end framework is essential for building ML systems that are robust, scalable, and manageable in production.
1. From DevOps to MLOps
You are already familiar with DevOps, which unifies software development (Dev) and IT operations (Ops) to shorten development cycles and provide continuous delivery. MLOps applies these same principles to machine learning, but it's more than just a rebranding. ML systems have unique characteristics that demand a specialized approach.
Let's start by reading a short section from a Google Cloud architecture document that clearly outlines why MLOps is a distinct discipline from DevOps.
MLOps: Continuous delivery and automation pipelines in ...
This document clearly breaks down the unique challenges of ML systems and why they require a specialized operational practice beyond traditional DevOps.
Please read the section titled 'DevOps versus MLOps'. Pay close attention to the four ways ML systems differ from other software systems: Team skills, Development, Testing, and Production.
As the article highlights, MLOps has to contend with an extra layer of complexity. It's not just about managing code; it's about managing code, models, and data as a unified whole. The experimental nature of ML development and the potential for model performance to decay in production due to changing data are challenges that traditional CI/CD pipelines don't address.
2. The Core Components of an MLOps Framework
To manage this complexity, MLOps relies on a set of specialized tools and components that work together. While we've touched on some of these before (like feature stores and orchestrators), let's focus on the three pillars that form the backbone of the MLOps lifecycle.
Pillar 1: Experiment Tracking
The ML development process is highly iterative. A data scientist might run hundreds of experiments, tweaking algorithms, hyperparameters, and feature sets to find a model that performs well. Without a systematic way to track this work, it quickly descends into chaos.
This short video explains the problem vividly and introduces the solution.
MLFlow Tutorial | ML Ops Tutorial
This video from the codebasics channel uses a relatable story to illustrate the 'wild west' of unmanaged ML experimentation and why a tool for tracking is so critical.
Watch from the beginning to 06:06. Focus on the challenges the data science team faces in tracking their experiments with notebooks and spreadsheets.
The solution to this problem is an experiment tracking system, with MLflow Tracking being a widely used open-source example. Such a system provides APIs that allow data scientists to automatically log the key information for every experiment run, including:
- Parameters: The inputs to the model training process, like the learning rate (
alpha=0.01) or tree depth (max_depth=5). - Metrics: The outputs used to evaluate model performance, such as accuracy, precision, or F1-score.
- Artifacts: The files generated by the run. Most importantly, this includes the trained model object itself, but it can also include images (like a confusion matrix) or data files.
- Source Code: The version of the code that was executed, ensuring reproducibility.
This creates a searchable, auditable log of every experiment, turning a chaotic process into a structured, reproducible science.
Pillar 2: The Model Registry
Once an experiment produces a model that meets the quality bar, the next step is to prepare it for deployment. It needs to be versioned, documented, and promoted through a governance process. This is the job of the Model Registry.
The Model Registry is a centralized repository for managing the lifecycle of ML models. Think of it as being for models what a tool like Artifactory or Nexus is for software packages.
This next clip from the same tutorial explains the role and function of a model registry.
MLFlow Tutorial | ML Ops Tutorial
Now, let's see how a Model Registry provides the governance layer needed to manage models as they move from development towards production.
Watch the segment from 25:29 to 29:50. This part introduces the Model Registry, shows how to register a model, and explains the concept of versions and lifecycle stages (or aliases like 'Challenger').
Key features of a Model Registry include:
- Versioning: Each registered model has versions (e.g.,
Version 1,Version 2), creating a clear lineage. - Lifecycle Staging: Models can be assigned a stage, such as
Staging,Production, orArchived. This allows you to manage the promotion process. - Annotations and Metadata: You can attach descriptions, tags, and link back to the experiment that produced the model.
- Deployment Integration: CI/CD pipelines can automatically fetch the latest model version from a specific stage (e.g., "get the latest
Productionversion of the fraud model").
This decoupling of the model asset from the code is crucial. It allows you to update models without redeploying your entire application, a concept we'll see in action next.
Pillar 3: Automated Deployment (CI/CD for ML)
This is where all the pieces come together. Automated deployment in MLOps uses CI/CD pipelines to manage the end-to-end lifecycle, from code commit to a running model in production. The maturity of an MLOps practice is often defined by its level of automation.
The Google Cloud article we started with provides an excellent framework for thinking about this maturity.
MLOps: Continuous delivery and automation pipelines in ...
Let's return to the Google Cloud document to see how organizations evolve from manual processes to fully automated CI/CD pipelines for ML.
Please read the sections 'MLOps level 0: Manual process', 'MLOps level 1: ML pipeline automation', and 'MLOps level 2: CI/CD pipeline automation'. This progression provides a clear roadmap for what a mature MLOps system looks like.
As you read, you can see the evolution:
- Level 0 (Manual): The "throw it over the wall" approach, where data scientists manually hand over a model file to engineers. It's brittle, slow, and not reproducible.
- Level 1 (ML Pipeline Automation): The training process itself is automated into a pipeline, enabling Continuous Training (CT). When new data arrives, the pipeline can be triggered to automatically retrain and validate a new model.
- Level 2 (CI/CD Automation): The entire system is automated. A code change triggers a CI pipeline that tests not just the code, but also the data and model components. A successful build triggers a CD pipeline that can automatically deploy the new ML training pipeline, which in turn produces and deploys a new model prediction service.
3. A Complete MLOps Architecture
At MLOps Level 2, all the components we've discussed are integrated into a single, automated workflow. The diagram below shows a reference architecture on the Databricks/Azure stack that illustrates this flow.

This architecture visualizes the end-to-end process:
- Development: A data scientist develops code in a notebook and pushes it to a Git repository.
- Continuous Integration (CI): The push triggers a CI pipeline (e.g., in GitHub Actions or Azure DevOps) that runs unit tests, packages the code, and performs initial model validation.
- Continuous Delivery (CD): On approval (e.g., merging to a main branch), a CD pipeline deploys the automated training pipeline to the production environment.
- Continuous Training (CT): The production training pipeline runs on a trigger (e.g., a schedule, new data), trains a new model, and registers it in the Model Registry.
- Model Deployment: The final step is to deploy the new model version from the registry into a production inference environment (either for batch scoring or as a real-time API), often using a champion/challenger pattern for safe rollout.
Test your understanding!
A data scientist on your team just finished training a new version of a customer churn model in a Jupyter notebook. They saved the model file (model.pkl) to a shared drive and sent you an email saying, "It's ready for production! The accuracy is 2% better." Based on the MLOps maturity levels, which level is this process, and what are two major risks associated with it?
Show answer
This is a classic example of MLOps Level 0: Manual Process.
Two major risks are:
- Lack of Reproducibility: There is no guarantee that you can reproduce this exact model. What version of the libraries did they use? What specific subset of data was it trained on? What were the exact hyperparameters? Without an experiment tracking system, this information is often lost.
- Training-Serving Skew: The feature engineering logic is likely trapped inside the notebook. The engineering team will have to reimplement this logic for the production inference service. Any small difference between the notebook logic and the production logic can lead to a significant drop in model performance. A formal MLOps process with a feature store and versioned code pipelines mitigates this risk.
Conclusion
Today, we've defined MLOps and explored its three core components, which work together to bring automation, reproducibility, and reliability to the machine learning lifecycle.
Key Takeaways:
- MLOps is DevOps adapted for ML: It addresses the unique challenges of managing data, experimental development, and model decay in production.
- Experiment Tracking is the foundation, providing a systematic way to log and compare ML experiments.
- The Model Registry acts as a central governance hub for versioning and managing the lifecycle of trained models.
- CI/CD Automation ties everything together, creating automated pipelines that build, test, and deploy both the ML systems and the models they produce.
Preview of the next lesson:
Theory is great, but practice is better. In our next lesson, we'll get hands-on. We will dive into a Databricks environment and use MLflow Tracking to log model parameters, metrics, and artifacts in an experiment. This will make the concepts we discussed today much more concrete.