Part IV — Expert Production Engineering · Chapter 21
Serving and Resilient Operations
Chapter 20 produced a governed, signed, monitored model. This chapter puts a dependable service around it. A prediction service is a small, long-running program that accepts requests from other systems, validates them, calls the pipeline, and returns answers — thousands or millions of times a day, under changing load, with dependencies that fail, and with people relying on it at three in the morning.
The chapter follows the path of a request and the life of a service: loading pipelines portably and starting the server; authenticating callers and bounding what each request may cost; exposing health, metrics, and traces; reloading models and deploying new versions without dropping traffic; and finally scaling out across several instances with shared limits, consistent routing, and load tests that prove the design holds.
Release note. In v0.63 the installation registers a pea-serve entry point, and serving integrations such as FastAPI, Redis, and tracing are optional extras that need their own dependencies and configuration (Chapter 1, Lesson 2). Listings are marked illustrative: command flags, configuration keys, and endpoint paths show the concepts and must be confirmed against the reference for your installed version (pea --version, pea-serve --help). Live integrations remain subject to the external release gates described in Chapter 24.