skip to content
Victor Guerra

Notes / ML Systems / Production

Model Serving & Deployment

Updated Sep 10, 20261 min read
Table of Contents

Challenges of deploying large models, and how to serve them efficiently.

Deployment challenges & fixes

ChallengeFix
Latency / inference speedcompression (quantize/prune/distill — model-compression), smaller variants (DistilBERT/MobileNet), batch/async serving
Memory / resource usageoptimized runtimes (ONNX, TensorRT), offload, distributed inference
Scalability (many users)inference servers (Triton, TorchServe, TF-Serving), orchestration, autoscaling, caching
Cold start (slow first request)preload/warm models, lightweight routing model
Versioning complexitymodel registries (MLflow, SageMaker, Vertex), CI/CD, canary rollouts + A/B
Monitoringtrack latency/throughput/confidence/drift, log requests, Prometheus/Grafana
Bias/fairness/explainabilityexplainability tools, subgroup audits, fairness-aware training
Security/privacywatch adversarial inputs, differential privacy, input sanitization, restrict API
Costquantization/distillation/accelerators, route only high-importance inputs to big models, serverless

Batched inference

Combine multiple requests into a single forward pass → better GPU utilization and throughput, lower per-request overhead. Flow: collect requests → stack into a batch tensor → single model call → split outputs back. Triton Inference Server does dynamic batching (groups requests at runtime, configurable max/preferred batch size) across backends (PyTorch/TF/ONNX/TensorRT).

The throughput win is the same idea as batching in training (dataloader-and-batching) — amortize fixed per-call overhead and saturate the GPU’s parallelism — but you trade a little latency (waiting to fill a batch) for throughput.


Related: model-compression, distributed-training, ml-in-production, dataloader-and-batching, triton-vector-add