Skip to content

Serving and Inference Operations by Scale

Last updated: 2026-05-24

Serving is the operational boundary where a trained model, map labeler, evaluator, or foundation-model tool becomes an accountable production system. In MLOps, serving is not only an HTTP endpoint. It includes batch inference, offline map segmentation, shadow mode, canary rollout, on-vehicle runtime packages, cloud endpoints, multi-model servers, model-mesh platforms, traffic mirroring, autoscaling, rollback, and the telemetry that proves the served artifact is the artifact that was evaluated.

Use this page with mlops-scale-research-scope.md for maturity, model-registry-artifact-lifecycle-by-scale.md for aliases and artifact identity, evaluation-platform-replay-gates-by-scale.md for runtime-package and replay gates, platform-sre-reliability-by-scale.md for endpoint SLOs, error budgets, restore drills, incident lanes, and bypass controls, site-sliced-release-evidence-by-scale.md for ODD-cell rollout evidence, model-monitoring-drift-response-by-scale.md for telemetry and incident actions, secure-artifact-attestation-profile.md for signatures and provenance, and ../../40-runtime-systems/ml-deployment/production-ml-deployment.md for vehicle-side TensorRT/Triton details.

The core rule is: serving authority must be scoped, observable, and reversible. A served model is release-relevant only for the scope named in its registry alias, deployment manifest, input contract, runtime package, monitor policy, and rollback bundle.


What Serving Owns

SurfaceWhat it controlsFailure it prevents
Inference APIRequest/response schema, protocol, error semantics, timeout, batchingClients depend on undocumented tensors or unstable JSON fields
Runtime packageONNX, TensorRT engine, container, Python service, preprocessing, postprocessing, class orderOffline checkpoint differs from deployed behavior
RoutingShadow, mirror, canary, traffic split, site/channel rollout, fallbackNew model receives authority outside its evidence scope
ScalingReplica count, GPU placement, batching, queue policy, cold start, admission controlLatency SLO fails under load or cost explodes at idle
ObservabilityLatency, queue time, model load, input/output quality, artifact IDs, drift, errorsRuntime failures are mistaken for model-quality failures
GovernanceRegistry alias, release packet, attestation, endpoint IAM, approval state, rollbackUnreviewed model reaches production or cannot be rolled back

Serving therefore sits between training/evaluation and operations. It consumes registry records and release evidence; it produces runtime telemetry, shadow/canary evidence, incident facts, and future data-mining triggers.


Scale Ladder

MLOps scaleServing postureMinimum controlAnti-pattern to block
S0 notebook researchLocal inference in notebook or scriptCommit, environment note, sample input/output, no production clientsDemo endpoint becomes a hidden dependency
S1 repeatable prototypeContainerized local or internal serviceFrozen model path, deterministic preprocessing, smoke test, simple latency notelatest.pkl or mutable bucket prefix behind an API
S2 single-product productionProduct endpoint or edge packageRegistry alias, deployment manifest, runtime package test, rollback target, basic monitoringTraining job deploys directly to production
S3 fleet and multi-siteSite/ODD-scoped serving lanesODD-cell routing, shadow/canary, site telemetry, delayed-label joins, blast-radius queryGlobal traffic percentage approves local managed-site behavior
S4 regulated safety-criticalEvidence-controlled servingSafety-case-linked release, signed artifact, retention hold, rollback drill, incident/evidence pathEndpoint update lacks immutable evidence or reportability context
S5 platform scaleMulti-tenant serving platformStandard protocols, policy-as-code, tenant isolation, endpoint SLOs, audit API, cost attributionTeams bypass platform controls because serving is slower than local scripts

Scale follows artifact authority. A small offline semantic-map batch service can require S4 controls if its outputs publish map truth or feed safety evidence. A large exploratory embedding service can remain S1 if no release-affecting consumer depends on it.


Serving Modes

ModeTypical workloadRequired fromNotes
Local batch inferenceResearch scoring, one-off label generationS0Must not create release labels without later promotion
Reproducible batch jobDataset scoring, offline map segmentation, pseudo-label generationS1-S2Best for aggregated LiDAR maps, image colorization, open-vocabulary labelers, and replay scoring
Online synchronous endpointLow-latency API, product service, live perception microserviceS2Needs timeout, readiness, liveness, autoscaling, and schema stability
Asynchronous endpointLarge payloads, long processing, batch-like online workflowsS2-S3Useful for long map tiles, image/video clips, or foundation-model labelers
Shadow or mirrored endpointCandidate observes production traffic without authorityS2-S3Telemetry must separate champion and shadow outputs by artifact ID
Canary endpointCandidate serves limited real authorityS3Scope by ODD cell, not only traffic percentage
Edge or on-vehicle runtimePerception, occupancy, segmentation, safety monitorS2-S4Hard real-time, hardware, calibration, map, and fallback constraints dominate
Multi-tenant platformMany teams, model families, endpoints, tenantsS5Requires policy, quotas, inventory, endpoint templates, and exception workflow

For autonomy, batch serving is often as important as online serving. Offline map segmentation, replay evaluation, auto-labeling, synthetic-data scoring, and delayed-label joins can change release truth even when they never answer a live API request.


Architecture Options

Serving architectureAdvantagesDisadvantagesBest use
Python script or notebookFast, transparent, no platform dependencyWeak API contract, weak concurrency, weak observabilityS0 exploration and tiny batch jobs
FastAPI/Flask custom serviceSimple API, easy to wrap custom preprocessingReimplements model loading, batching, health, metrics, rollout, and GPU controlS1 prototypes and low-risk internal services
ONNX Runtime servicePortable model format, CPU/GPU execution options, quantization pathCustom preprocessing and rollout controls still need engineeringS1-S3 portable model serving and CPU/GPU batch inference
TensorRT embedded runtimeLowest latency on NVIDIA targets, strong fit for Orin/ThorHardware/version-specific engines, build/cache discipline requiredS2-S4 vehicle inference and edge map/perception packages
NVIDIA TritonMulti-framework serving, model repository, dynamic batching, ensembles, metrics, model managementOperational complexity, repository discipline, edge integration choicesS2-S5 GPU serving, multi-model perception, batch/offline inference, shared GPU endpoints
KServeKubernetes-native InferenceService, serving runtimes, traffic, autoscaling, protocol standardizationRequires Kubernetes/Istio/Knative or raw deployment expertiseS2-S5 cloud/on-prem platform serving with common endpoint abstraction
Seldon Core 2Kubernetes/local deployment, control/data plane separation, experiments, pipelinesPlatform ownership needed; autonomy metadata still externalS3-S5 enterprise model-serving platform and inference graphs
Ray ServePython-native composition, autoscaling, distributed replicas, good for model graphsNeeds Ray cluster operations and careful resource isolationS2-S5 simulation, foundation-model tools, model cascades, Python-heavy services
BentoMLGood service packaging, Python developer ergonomics, deployment and autoscaling optionsProduction governance and autonomy evidence need external systemsS1-S3 teams shipping custom model APIs without full platform buildout
MLServer / Open Inference Protocol serviceStandard V2 protocol, REST/gRPC, multi-model serving, works with KServe/SeldonLower-level than a complete release platformS2-S5 interoperable Python inference servers
Managed SageMaker / Vertex AI / Azure ML endpointsFast production path, autoscaling, traffic split, monitoring integrations, managed operationsVendor coupling, data-residency and custom artifact metadata limitsS2-S4 cloud-native products and standard model families
OTA edge package with local supervisorWorks offline, deterministic startup, can fail closed, integrates with vehicle safetyHarder rollout and observability; every package must match target hardwareS2-S4 vehicles, robots, managed sites, and safety-adjacent perception

A practical stack often splits responsibilities: Triton or TensorRT for edge/GPU execution, KServe/Seldon/Ray/BentoML for service deployment, managed endpoints where cloud integration is enough, and a separate registry/evidence layer that controls authority.


Platform Selection by Scale

DecisionS0-S1S2-S3S4-S5
API protocolLocal function or simple RESTREST/gRPC with documented schema; prefer Open Inference Protocol where feasibleStandard protocol plus policy, audit, compatibility, and tenant namespace
Runtime loadingDirect checkpoint or ONNXImmutable version, container/engine digest, readiness probeSigned artifact, admission policy, rollback cache, evidence retention
Traffic controlManual run selectionShadow, canary, blue/green, mirror, header/route/site routingPolicy-gated rollout, automatic hold/rollback triggers, exception workflow
ScalingManual machine choiceMin/max replicas, GPU placement, batching, queue alertsCapacity SLO, quota, chargeback, reserved incident/evidence lane
ObservabilityLogs and timing notesLatency, errors, input/output quality, artifact IDs, drift proxiesPlatform SLOs, alert quality, audit export, blast-radius query
SecurityLocal credentialsEndpoint IAM, network isolation, signed containerTenant isolation, attestation verification, vulnerability disposition, data residency

Do not start with a model-serving platform before the service contract is clear. The durable part is the endpoint manifest and artifact identity; the serving engine can change later.


Inference Service Manifest

At S2+, every release-relevant service should have a manifest that can be attached to a release packet and queried during incidents.

FieldRequired contents
service_idStable service name, version, owner, environment, namespace, endpoint URL or vehicle package ID
artifact_setModel/checkpoint, ONNX/TensorRT/container, preprocessing, postprocessing, map, calibration, taxonomy, prompt/evaluator, threshold IDs
registry_authorityAlias, lifecycle state, allowed-use scope, approver, rollback alias
input_contractModality, schema, tensor names/shapes, coordinate frame, timestamp policy, calibration requirements, missing-data behavior
output_contractClass order, units, coordinate frame, confidence, uncertainty, abstention/OOD fields, release-state fields where used
runtime_targetCPU/GPU/DLA, CUDA/TensorRT/driver versions, memory budget, hardware cohort, acceleration profile
traffic_policyBatch, online, shadow, canary, blue/green, mirror, site/route/vehicle cohort, percentage, header, or release channel
scaling_policyMin/max replicas, autoscaling metric, queue length, batch size, max latency, cold-start budget
observabilityMetrics, logs, traces, artifact IDs in telemetry, sampling policy, retention, delayed-label join key
safety_policyDegraded mode, fail-closed behavior, fallback artifact, ODD restriction, on-call owner, incident severity
securityImage digest, signature, SBOM, provenance, IAM, network policy, secrets, vulnerability disposition
evidence_linksEvaluation manifest, runtime smoke, replay report, shadow/canary report, release packet, rollback drill

The manifest should be generated by pipeline orchestration and consumed by deployment, monitoring, incident response, and registry lifecycle checks.


Runtime Optimization and Capacity

Serving optimization is a trade among latency, throughput, determinism, cost, and safety margin.

TechniqueBenefitRiskGuardrail
Dynamic batchingHigher GPU utilization and throughputAdded queue latency can violate real-time budgetsPer-model max queue delay and p99 latency gate
Static batchingPredictable executionWastes capacity at low trafficUse for deterministic replay or fixed camera/LiDAR batches
TensorRT FP16/INT8/FP8Lower latency and memoryQuantization can damage rare classes or calibrationRepresentative calibration set and slice metrics
Multi-model serverFewer processes, shared metrics, model managementOne serving process can become a shared failure domainIsolation by criticality and rollback-tested model repository
AutoscalingCost and capacity elasticityCold starts, replica churn, unstable p99Min replicas for safety-critical services and warmup tests
Model ensemblesStandardized preprocessing/model/postprocessing graphHidden coupling between componentsVersion each component and hash the ensemble graph
Model mesh / multi-model loadingEfficient many-model hostingLoad/unload latency and cache eviction riskPin active champions and protect rollback artifacts
Edge DLA/GPU partitioningLower power and predictable computeUnsupported ops or precision differencesRuntime package smoke on target hardware cohort
Request shedding/backpressureProtects latency under overloadDropped requests can hide safety evidenceExplicit admission policy, telemetry, and fallback behavior

For vehicle inference, latency budgets should include sensor preprocessing, transfer, inference, postprocessing, synchronization, and downstream consumer deadline. The model server's p50 latency is not enough.


Rollout and Routing Patterns

PatternWhat it provesGood fitGuardrail
Blue/greenNew fleet or deployment can replace old without downtimeCloud endpoints and service APIsHealth alarms and rollback before old fleet is removed
CanaryCandidate handles limited authorityS2-S3 product and site rolloutCanary cohort must match target ODD cell
Linear traffic shiftGradual exposureStable web/API trafficNot enough for rare hazards unless slice exposure is measured
Shadow/mirrorCandidate sees live traffic without authorityS2-S3 model comparisonMirror logs must not affect operators or labels without promotion
Header or cohort routingExplicit user/site/vehicle selectionMulti-site fleets and A/B testsScope in manifest and monitoring denominator
Route/zone/task routingODD-cell-specific model or adapterAirports, ports, warehouses, campuses, urban districtsSite champion cannot leak into unapproved route/task
Emergency rollbackRestore known-good artifact setAll S2+ releasesRollback artifact must still load under active runtime/map/schema

Do not equate traffic percentage with safety coverage. A 10% canary can still miss night, rain, construction, terminal-frontage, worker-crossing, narrow-corridor, and changed-map slices.


Training and Model-Architecture Coupling

Serving constraints should feed back into model and training choices before the final release gate.

Model/training decisionServing implicationExample control
Sparse 3D LiDAR networkMay need custom ops, sparse libraries, or batch-size limitsExport smoke and target-hardware profile before promotion
Image-LiDAR fusionRequires synchronized modalities and calibration validityInput contract fails closed on missing image/calibration if image is runtime-required
Train-time image distillationImage dependency should not appear at serving timeManifest marks image as train-time only, not runtime input
Open-vocabulary labelerUsually batch/offboard, not hard real-timeReviewer workflow and allowed-use state before labels train a model
Foundation model or VLM endpointHigh latency, cost, prompt/retrieval driftUse for advisory, labeling, or evaluation unless safety evidence supports authority
Quantization-aware trainingImproves deployable accuracy under INT8/FP8Evaluate quantized package, not just FP32 checkpoint
Model cascade or early exitSaves computeMonitor branch distribution and rare-class misses
Site adapter or LoRALocalizes behaviorAdapter is a registry artifact with site-scoped serving route

The serving platform should not discover deployment infeasibility after evaluation. At S2+, export, runtime package smoke, and latency/memory gates belong before shadow or site_canary.


Autonomy and Managed-Site Rules

For airside, port, yard, warehouse, campus, construction, mining, and non-road urban-district mapping applications:

  • Serving scope should be ODD-cell-specific: site, route, zone, task, weather/lighting, vehicle kit, map state, calibration package, and release channel.
  • Runtime models must report model, map, calibration, semantic taxonomy, telemetry schema, and runtime package IDs in every monitoring event.
  • Offline aggregated-map segmentation services must be governed like production systems when they publish semantic maps, release-state labels, map-hygiene layers, pseudo-label exports, or digital-twin assets.
  • LiDAR-only, LiDAR-image fusion, image-distilled, and image-dependent routes need different serving manifests. A model that needs images at runtime cannot be deployed to a LiDAR-only vehicle cohort.
  • Stationary people, parked movable assets, cones, pallets, temporary barriers, and FOD candidates require serving outputs that preserve semantic class, confidence, and release-state fields instead of collapsing them into permanent map truth.
  • Urban-district mapping that is not a road-driving ODD still needs privacy, facade/sidewalk/service-lane slice metrics, construction/change routing, and tenant/site data boundaries.

Serving is also a map-governance boundary. A semantic-map service, map cleaner, or labeler can change what downstream vehicles believe is permanent infrastructure.


Observability and Incident Hooks

Metric familyExamplesRelease use
Service healthReadiness, liveness, model loaded, replica count, request errorsBlocks rollout or triggers rollback
Latency and queuep50/p95/p99, queue time, batch size, timeout, dropped requestsRuntime SLO and canary exit
ResourceGPU memory, utilization, DLA usage, CPU, storage, model cacheCapacity and cost planning
Input qualitySchema violations, missing modality, point count, camera exposure, timestamp skewDetects broken serving contract
Output behaviorConfidence, class counts, OOD rate, uncertainty, abstention, map release-state volumeDrift and delayed-label routing
Artifact identityModel, engine, container, map, calibration, taxonomy, prompt/evaluator IDsRoot-cause and blast-radius query
Rollout stateShadow/canary/champion, cohort, route, site, percentage, time windowSite-sliced release evidence
SecuritySignature verification, image digest, vulnerability disposition, policy resultAdmission and audit evidence

The monitoring event contract in model-monitoring-drift-response-by-scale.md should include these fields. Without artifact identity, a serving dashboard cannot distinguish model drift from map changes, calibration faults, endpoint rollout, or runtime degradation.


Release Blockers

BlockerApplies fromExample
Missing serving manifestS2Endpoint has no input/output/runtime/traffic contract
Artifact mismatchS2Deployed TensorRT engine was not the one evaluated
Mutable artifact referenceS2Runtime pulls latest image or bucket prefix
Missing rollbackS2Previous artifact cannot load under active runtime
No health/latency gateS2Canary starts without readiness, liveness, p99, memory, or queue checks
Shadow contaminationS3Shadow output influences labels, operators, or maps before review
ODD scope leakS3Site adapter receives traffic outside approved site/route/task
Missing artifact IDs in telemetryS3Incident cannot identify active model/map/calibration/runtime
Unsigned or unverified packageS3-S4Vehicle loads untrusted model/container/map package
Safety monitor regressionS4Endpoint update changes monitor timing, false-free-space behavior, or fallback state without evidence
Platform bypassS5Team deploys model outside shared registry/eval/policy path

A serving release is ready only when it can be deployed, observed, held, rolled back, and explained from immutable evidence.


KPIs

KPIMeaningScale
Package parityDeployed artifact digest matches evaluated artifact digestS2+
Endpoint readinessPercentage of releases with readiness/liveness/load smoke evidenceS2+
p99 latency marginDifference between deadline and observed p99 including preprocessing/postprocessingS2+
Canary exposure coverageTarget ODD cells observed during canary windowS3+
Rollback load-test successRollback artifact still loads and serves under active runtimeS2+
Artifact-ID telemetry coverageRequests/events with model/map/calibration/runtime IDsS3+
Shadow disagreement closureShadow disagreements triaged into no-op, label, replay, hold, or rejectS3+
Endpoint cost per useful inferenceCost normalized by accepted labels, replay decisions, or product requestsS3-S5
Platform bypass rateDeployments outside approved serving pathS5
Incident blast-radius timeTime to identify affected endpoint, artifact, site, and cohortS3-S5

Serving KPIs should be interpreted with risk. Reducing p99 by removing safety checks is not an improvement. Lowering cost by deleting rollback capacity is not FinOps success.


Failure Modes

Failure modeWhat happensControl
Endpoint-first MLOpsTeam builds serving before defining data/eval/registry contractsRequire manifests and artifact identity before S2 endpoint
Checkpoint promoted instead of packageOffline score does not match deployed behaviorEvaluate the exact container/engine/service graph
Framework lock-in hides missing metadataManaged endpoint looks production-ready but lacks map/calibration/ODD fieldsAttach autonomy-specific deployment manifest
Autoscaling hides cold-start riskCanary passes during warm traffic but fails after idleWarmup, min replicas, load test, and cold-start SLO
Batch service treated as non-productionAuto-labeler or map segmenter silently changes training truthRegistry, allowed-use, and reviewer states for batch outputs
Global canary hides local failureEasy routes dominate exposureODD-cell denominator and site-sliced rollout
Shadow output leaks into operationsCandidate affects humans without authoritySeparate logs, access policy, and allowed-use state
Rollback artifact expiredPrevious model cannot load due to runtime/schema driftPeriodic rollback load test and retention hold
Serving monitor shares failure modeSame process failure disables model and monitorIndependent health path or safety monitor where required
Platform too slowTeams deploy custom endpoints outside governanceGolden paths, platform SLOs, exception flow, admission control

  • mlops-scale-research-scope.md - MLOps maturity ladder and lifecycle planes.
  • mlops-reference-architectures-by-scale.md - S0-S5 platform blueprints and durable interfaces.
  • mlops-migration-checklist-by-scale.md - transition gates before introducing serving platforms.
  • mlops-scorecards-and-kpis-by-scale.md - serving, runtime, release, and platform KPIs.
  • model-registry-artifact-lifecycle-by-scale.md - aliases, lifecycle states, artifact-set records, and rollback retention.
  • evaluation-platform-replay-gates-by-scale.md - runtime package checks, replay gates, and shadow/canary evidence.
  • platform-sre-reliability-by-scale.md - endpoint and serving-platform SLOs, error budgets, backup/restore, incident lanes, and bypass controls.
  • model-monitoring-drift-response-by-scale.md - monitoring event contract and response state machine.
  • site-sliced-release-evidence-by-scale.md - ODD-cell release manifests and canary denominators.
  • pipeline-orchestration-release-workflows-by-scale.md - export, package, register, deploy, and release state machines.
  • secure-artifact-attestation-profile.md - signed runtime artifacts and verification gates.
  • ../ota/perception-slam-artifact-compatibility-matrix.md - model/map/calibration/runtime compatibility for release.
  • ../../40-runtime-systems/ml-deployment/production-ml-deployment.md - TensorRT, Triton, edge inference, latency, and vehicle deployment details.

Sources

Public research notes collected from public sources.