Overview

1 Getting started with MLOps and ML engineering

This chapter sets the stage for building production-grade machine learning systems by bridging the gap between model development and real-world operations. It introduces MLOps as the discipline that makes ML reliable, scalable, and auditable in practice, emphasizing that most failures stem from system and process issues rather than model complexity. With a hands-on, iterative approach, the book aims to turn readers—whether data scientists, software engineers, or aspiring ML engineers—into confident practitioners who can take projects from conception to deployment and continuous improvement.

Central to the chapter is the end-to-end ML life cycle. It begins with problem formulation and data work (collection, labeling, and versioning), then proceeds through training, evaluation, and business-oriented validation—steps that are inherently iterative and best orchestrated via automated pipelines. The chapter then distinguishes the dev/staging/production phase, where full automation, CI-triggered workflows, and deployment practices (APIs, containers, cloud, versioned rollouts) take over. Robust monitoring spans both system and ML-specific signals—throughput, errors, drift, and business KPIs—feeding into policies for model retraining and safe promotion. Reproducibility, reliability, and automation are highlighted as non-negotiables throughout.

The chapter also maps the skills and platform foundations needed for MLOps: solid software engineering, practical ML know-how, data engineering awareness, and strong automation practices, with Kubernetes as a useful backbone. It introduces an incremental ML platform built around Kubeflow (notebooks and pipelines) and complemented by components such as a feature store, a model registry, container registries, and CI/CD—while noting that tool choices are contextual and “build vs buy” is a pragmatic decision. Finally, it previews three projects that anchor these concepts: an OCR system, a tabular movie recommender (showcasing feature stores, testing, and drift detection), and a RAG-based documentation assistant that extends the same MLOps foundation to LLMOps with vector search, guardrails, and cost-aware operations.

The experimentation phase of the ML life cycle
The dev/staging/production phase of the ML life cycle
MLOps is a mix of different skill sets
The mental map of an ML setup, detailing the project flow from planning to deployment and the tools typically involved in the process
Traditional MLOps (right) extended with LLMOps components (left) for production LLM systems. Chapters 12-13 explore these extensions in detail.
An automated pipeline being executed in Kubeflow.
Feature Stores take in transformed data (features) as input, and have facilities to store, catalog, and serve features.
The model registry captures metadata, parameters, artifacts, and the ML model and in turn exposes a model endpoint.
Model deployment consists of the container registry, CI/CD, and automation working in concert to deploy ML services.

Summary

  • The Machine Learning (ML) life cycle provides a framework for confidently taking ML projects from idea to production. While iterative in nature, understanding each phase helps you navigate the complexities of ML development.
  • Building reliable ML systems requires a combination of skills spanning software engineering, MLOps, and data science. Rather than trying to master everything at once, focus on understanding how these skills work together to create robust ML systems.
  • A well-designed ML Platform forms the foundation for confidently developing and deploying ML services. We'll use tools like Kubeflow Pipelines for automation, MLFlow for model management, and Feast for feature management - learning how to integrate them effectively for production use.
  • We'll apply these concepts by building two different types of ML systems: an OCR system and a Movie recommender. Through these projects, you'll gain hands-on experience with both image and tabular data, building confidence in handling diverse ML challenges.
  • Traditional MLOps principles extend naturally to Large Language Models through LLMOps - adding components for document processing, retrieval systems, and specialized monitoring. Understanding this evolution prepares you for the modern ML landscape.
  • The first step is to identify the problem the ML model is going to solve, followed by collecting and preparing the data to train and evaluate the model. Data versioning enables reproducibility, and model training is automated using a pipeline.
  • The ML life cycle serves as our guide throughout the book, helping us understand not just how to build models, but how to create reliable, production-ready ML systems that deliver real business value.

FAQ

What is the ML life cycle and why is it so iterative?The ML life cycle spans problem formulation, data collection and preparation, data versioning, model training, evaluation, validation, deployment, monitoring, and retraining. Unlike traditional software, ML progresses through repeated experiments and feedback loops—poor evaluation may send you back to adjust data prep or model choices. Even after deployment, monitoring often triggers new training runs, making iteration the norm, not the exception.
How do the experimentation and dev/staging/production phases differ?Experimentation emphasizes rapid iteration and learning: assembling datasets, training variants, and evaluating results via an orchestrated (semi-automated) pipeline. The dev/staging/production phase hardens this work with full automation, CI/CD triggers, deployment as a service (often a REST API), versioning, performance and drift monitoring, and clear rollback paths—while also accounting for ethics, security, scalability, and reliability.
How do I decide whether to use ML or a simpler heuristic?Start by asking if ML is necessary at all. Simple heuristics can be accurate and cheaper to build/operate. Choose ML when data is complex or high-dimensional and patterns are non-linear or too intricate for rules. If you opt for ML, define a crisp problem statement, success criteria, and the business value (e.g., OCR extracting ID numbers; fraud detection minimizing false positives while catching bad transactions).
What are best practices for data collection, labeling, and splitting?Identify reliable data sources early; use synthetic data if real data is scarce or sensitive. Invest in accurate labeling (e.g., bounding boxes and text for OCR), leveraging domain experts where needed. Organize labeled data into training, validation, and test sets to reduce leakage and fairly assess generalization. Plan for scale and quality checks because data work is often the bottleneck.
Why is data versioning critical and how does it differ from code versioning?Both data and code change model behavior. Data versioning ensures reproducibility—so a model trained today can be recreated tomorrow with the same inputs and parameters. Unlike code (well-served by Git), data comes in diverse formats and sizes, making versioning harder and tooling less standardized. Still, tracking dataset snapshots, schemas, and lineage is essential to trust results and support audits.
What is pipeline orchestration and why automate early?Orchestration connects life-cycle steps—prep, training, evaluation, validation, deployment—into a reproducible pipeline. Automating early reduces manual error, makes experiments repeatable, speeds iteration, and lays the groundwork for CI/CD in production. Tools like Kubeflow Pipelines represent each step as a component with defined inputs/outputs, enabling reliable, scalable workflows.
What does production-grade model deployment involve?Commonly, you expose inference via a REST API, containerize with Docker, and deploy to a platform like Kubernetes. Production-readiness requires load testing, autoscaling for spiky traffic, observability, strict versioning of model and service artifacts, and safe rollout/rollback strategies. CI/CD should build, push, and deploy images automatically on code or model changes.
What should I monitor once a model is in production?Track system performance (e.g., latency, throughput, error rates) and ML-specific signals: input data drift, model drift, and critical business KPIs (e.g., churn, approvals). Monitoring closes the loop—degradation in these metrics can trigger alerts and automated retraining pipelines to restore performance and value.
When should I retrain a model and how do I automate it?Retraining cadence depends on the use case. You can schedule it (e.g., monthly) or trigger it based on thresholds—such as drift scores, KPI drops, or label feedback. Automate end to end: artifact tracking for reproducibility, pipeline runs for training/validation, and CI/CD for safe, versioned deployments—so new models can promote from staging to production with minimal friction.
What core skills and platform components do I need, and should I build or buy?Key skills: strong software engineering (debugging, performance), working knowledge of ML frameworks, data engineering for data quality and pipelines, and automation/DevOps (CI/CD, containers, Kubernetes). Core platform components include pipeline orchestration (e.g., Kubeflow Pipelines), a Feature Store (to share features and prevent training-serving skew), a Model Registry (to track runs and promote versions), deployment via containers/Kubernetes, and monitoring. There’s no one-size-fits-all platform—evaluate “build vs buy” based on constraints, but assembling one yourself at least once deepens understanding and lets you tailor to your needs; the same foundations extend naturally to LLMOps with additions like vector databases, guardrails, and cost controls.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Machine Learning Platform Engineering ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Machine Learning Platform Engineering ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Machine Learning Platform Engineering ebook for free