liveBook · Manning

Chapter 6: Productionizing ML models

What you will learn in chapter 6 of Machine Learning Platform Engineering

The chapter introduces production deployment with BentoML and data drift monitoring with Evidently, using the income classification model as its running example.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduces production deployment with BentoML and data drift monitoring with Evidently, using the income classification model as its running example.

Key terms: BentoML, deployment manager, APIs, serving logic, data drift, Evidently, data distributions, monitoring, income classification, large language models (LLMs)

6.1 BentoML as a deployment platform

This section introduces BentoML as a way to turn the previously batch-deployed income classifier into an API service by packaging it as a Bento and deploying it through Yatai.

Key terms: BentoML, Bento, Yatai, API endpoint, unified distribution format, Kubernetes, Docker image, Kubernetes manifests, monitoring logic, CI

6.1.1 Building a Bento

This section builds an income-classifier Bento by importing an MLflow model, defining a BentoML inference service, and specifying how to package the application.

Key terms: bentoml.mlflow.import_model, MLflow model URI, BentoML local store, bentoml models list, bentoml.Service, runner, bentoml.mlflow.get(model_name).to_runner(), @svc.on_startup, context.state, Feast

6.1.2 Building and pushing the Bento

This section builds an income-classifier Bento, tests it locally, and pushes it to Yatai for Kubernetes deployment.

Key terms: bentoml build, bentoml list, local Bento Store, Size, Model Size, docker run, minio-service, mlflow-service, Feast Redis Online Store, user_id

6.1.3 Deploying a Bento

This section walks through deploying a pushed income-classifier Bento with Yatai, checking its API and metrics, and explaining what BentoML handles automatically.

Key terms: Yatai, Models tab, Bentos tab, Deployments tab, Bento tag, replicas, Kubernetes job, Docker image, API Server, Runner

6.2 Evidently for data drift monitoring

The section explains why deployed models need data drift monitoring and introduces how Evidently compares historical and inference data to detect changes.

Key terms: data drift, historical data, inference data, label drift, prior probability shift, covariate shift, sudden drift, Evidently, Kolmogorov–Smirnov Test, KS Test

6.2.1 Data drift detection report and dashboard

This section shows how to generate and interpret Evidently data drift reports, then set up a dashboard to track results across data snapshots.

Key terms: metric, metric preset, DataDriftPreset, DataQualityPreset, RegressionPreset, reference dataset, current dataset, Report, save_html, Reference Distribution

6.2.2 Data drift detection Kubeflow pipeline component

This section adds an Evidently data drift check to the income classifier’s batch inference pipeline and uses its reports to populate a dashboard.

Key terms: data drift, reference data, retrieve_features_task, run inference component, MLflow client, run ID, MinIO, Feast, Evidently workspace, report.run

6.2.3 Data drift detection for a model deployed as an API

This section adds sliding-window data drift monitoring to a BentoML prediction API, shows how to interpret its reports, and outlines what to do when drift appears.

Key terms: reference dataset, microbatch, /predict endpoint, MonitoringService, window size, current data, report snapshots, RemoteWorkspace, MLflow, iterate

6.3 Summary

The chapter summary connects streamlined model deployment with the need to understand its infrastructure and monitor data drift after deployment.

Where this is used later

Concepts explained in this chapter

← Chapter 5: Orchestrating ML pipelines Chapter 7: Data analysis and preparation →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.