Exporting models for C++ inferenceA compact model in the C++ FrontendProducing a TorchScript artifact (from C++)Loading and running TorchScript in C++Parity: does the artifact match the native graph?Consuming ONNX from C++ for portabilityWhat to keep consistentDeploying models to real targetsPackaging the binary (the one you ship)The heart of serving: a Micro-Batcher with Concurrency ControlConcurrency controls (keeping p95/p99 honest)Cloud, On-Prem, Edge: what actually changes?Optimizing models for speed and costQuantization: fewer bits, more throughputFP16 mixed precision (TorchScript, CUDA)INT8 (ONNX Runtime, Q/DQ graphs)Pruning: remove structure, not just valuesDistillation: deploy the studentRuntime tuning: feeding the hardware efficientlyLayout, threads, algorithms (LibTorch)Runtime tuning with ONNX RuntimeTie it together: a simple, repeatable benchmarkPractical playbookServing models in real timeContract at the BoundaryThe Scheduling Layer: Micro-Batching with Concurrency ControlHTTP and gRPC as the Service EdgeHTTP (REST and Server-Sent Events)gRPC (Unary and Server-Streaming)Tail-Latency DisciplineCloud, On-Prem, and EdgeA Minimal End-to-End ShapeOperating and evolving production systemsMake Behavior VisibleDetect Drift Before Users DoRelease Safely: Shadow, Canary, Roll BackClose the Loop: Retraining on PurposeReliability, Cost, and GovernanceA Stable System is a Measured SystemSummaryQuestionsFurther readingAnswersGet this book’s PDF version and more