Technical Reference · Core Systems & Platforms

Model Hosting and Inference Platforms: SLOs, Scaling, and Isolation

Serving production inference with SLOs, scaling, and isolation.

Core Subject: model hosting inference platforms
Curriculum: Enterprise AI Reference
Knowledge Graph: 111 Connected Guides

Model hosting and inference platforms turn trained weights into a production service: accept requests, enforce latency and availability SLOs, scale under bursty traffic, isolate tenants, and roll out new versions without breaking downstream products. This guide owns serving operations—batching, caching, autoscaling, multi-model routing, canaries, observability, cost attribution, and host-layer security for weights and prompts. It does not own LLM pretraining mechanics, model taxonomy, or datacenter fabric design; those live in large language models, AI models, and AI infrastructure respectively.

Treat inference like any critical API: define SLOs, measure tail latency, attribute cost, and design rollbacks before marketing a model name.

Inference as a production service

An inference platform exposes a contract: input schema, output schema, latency percentiles, availability, concurrency limits, and versioning semantics. Clients—chat UIs, batch pipelines, agent tool loops—depend on stable behavior more than on benchmark leaderboard scores. Production inference differs from notebook forward passes because requests arrive concurrently, lengths vary, failures must be classified, and capacity is finite.

Service-level objectives should be written in user-visible terms: time-to-first-token (TTFT), time-per-output-token (TPOT), end-to-end latency for non-streaming calls, error rate, and saturation behavior when queues fill. Pair SLOs with error budgets so teams can ship model updates without silent degradation. A model that is 5% more accurate but violates p99 latency every afternoon is not a free upgrade.

Separate synchronous online paths from asynchronous batch paths. Batch inference optimizes throughput and cost; online paths optimize tail latency and graceful degradation. Mixing them on one pool without admission control creates noisy-neighbor incidents that look like “mystery slowdowns.” Document which routes are latency-critical and which tolerate minutes of delay.

Versioning is part of the API. Pin model IDs, adapter IDs, tokenizer revisions, and quantization formats in client configs. Breaking changes—context length reductions, tool schema shifts, refusal policy changes—belong in release notes with explicit migration windows. Silent swaps by hosted providers are a common source of regressions; contract for notification and pinning where stakes require it.

Platform teams should publish capacity units: max concurrent sessions, tokens per minute, and queue depth before rejection. Product teams should load-test against those units, not against demo traffic alone. Inference without published limits is a shared outage waiting to happen.

Streaming responses change the SLO story. Users perceive TTFT as “responsiveness” and TPOT as “reading speed.” Partial tokens must flow even when back-pressure builds; buffering entire completions defeats streaming UX. Gateways should support client disconnect cleanup so abandoned streams do not hold KV slots indefinitely.

Tool-calling and agent loops multiply round trips: each tool result may trigger another prefill. Hosting plans must budget multi-hop latency and concurrent tool sessions, not single-shot chat. Timeouts on tool steps should fail gracefully without wedging the worker pool.

Incident severity for inference mirrors other tier-1 APIs: define what constitutes SEV1 (widespread unavailability), who pages, and when to enable load shedding versus fail-over regions. Run game days that drain a replica pool while traffic continues—paper runbooks lie.

Dependency mapping matters: which client apps share a gateway, which filters run in-process versus sidecar, and which external vector database calls sit on the critical path. A slow retrieval dependency becomes an inference incident even when GPUs are idle. Set timeouts and bulkheads per dependency class.

Rate limiting at the edge protects inner pools from abuse and from accidental retry storms. Clients that exponential-backoff on 429 recover; clients that hammer 500s do not. Publish retry guidance alongside OpenAPI specs.

Batching, caching, and tail latency

Batching raises accelerator utilization by grouping requests that arrive close together in time. Static batching waits for a full batch; continuous or iteration-level batching admits new sequences as others complete steps—common for autoregressive generative decoding. The engineering tradeoff is always the same: higher throughput versus tighter tail latency. Aggressive batching that helps average tokens/sec can destroy p99 when one long sequence blocks the iteration.

Prefix caching and KV cache reuse reduce redundant compute when many requests share identical system prompts, RAG prefixes, or tool definitions. RAG products often spend a large fraction of prefill on repeated context; caching safe prefixes is a major cost lever—provided tenant boundaries and ACLs are respected. Never reuse KV across customers or across permission tiers.

Speculative decoding, draft models, and early-exit shortcuts can cut latency but add complexity and quality risk. Measure quality slices alongside latency wins. A speedup that increases hallucination rate on a support bot is not neutral.

Tail latency is dominated by queueing, not averages. Little’s law applies: depth × service time ≈ wait. When GPUs saturate, latency explodes nonlinearly. Admission control—return 429, shed load, or route to a smaller fallback model—beats accepting work that guarantees multi-second stalls for everyone.

Cache policies need invalidation rules. Prompt templates change, retrieved documents update, and fine-tunes alter behavior. Cache keys must include model version, adapter version, and any retrieved content hash when answers depend on fresh context. Stale cache hits are silent product bugs.

Technique Primary win Watch-out
Continuous batching Higher tokens/sec under variable lengths p99 inflation when batches fill with long contexts
Prefix / KV cache Lower prefill cost for shared prompts Cross-tenant leakage if keys are wrong
Quantization at serve More concurrency per GPU Quality regression on rare slices
Request coalescing Better SM utilization Head-of-line blocking without caps

Autoscaling signals that actually work

Autoscaling for inference should react to signals correlated with saturation, not only CPU. Useful inputs include queue depth, time-in-queue, GPU memory pressure, KV cache utilization, tokens in flight, and error rates from OOM or timeout. CPU-only autoscalers miss GPU-bound LLM serving until users already feel pain.

Scale-out has warm-up costs: model load time, CUDA kernel compilation, cache cold starts. Pre-warm replicas during predictable peaks; keep a minimum ready pool for latency-critical tiers. Scale-in too aggressively and the next burst pays load latency tax repeatedly.

Predictive scaling helps for known events—product launches, Monday morning support spikes—but still needs guardrails. Combine scheduled capacity with reactive signals. For edge deployments, scaling may mean routing to regional pools rather than adding devices in the field; edge guides own device constraints while this page owns the serving decision loop.

Multi-region inference adds routing complexity: sticky sessions for long contexts, data residency, and failover that does not cross compliance boundaries. Fail open to a degraded model only when policy allows; regulated workloads may require fail closed instead.

Test autoscaling with adversarial traffic mixes: short prompts plus occasional 128k-context monsters. Autoscaling tuned on uniform lengths fails in production.

Multi-model and multi-LoRA serving

Products rarely serve exactly one checkpoint. Routers send traffic to general models, domain-tuned variants, small classifiers, embedding endpoints, and rerankers. A hosting platform must schedule memory for concurrent model resident sets, swap cold models, and prioritize hot paths. Naive “load every adapter” strategies OOM after looking fine in staging.

Fine-tuning via LoRA and adapter stacks enables many customer-specific heads on a shared base. Multi-LoRA serving loads one base and switches low-rank adapters per request or per tenant. Memory planners must account for adapter count, rank, and concurrent active adapters—not only base parameter bytes.

Model routers can be rule-based (intent → model), learned (latency-quality tradeoff), or cost-aware (cheap model first, escalate on uncertainty). Routers need observability: which route was chosen, why, and whether escalation happened. Hidden routing without logs makes quality incidents untraceable.

Heterogeneous hardware pools—large GPUs for 70B-class models, smaller instances for 7B fallbacks—require explicit routing tables. Do not assume one instance type fits all SLAs. Hugging Face Text Generation Inference and similar open stacks illustrate adapter-aware serving patterns; vendor managed APIs hide details but still enforce concurrency limits you must plan around.

Isolation and noisy-neighbor control

Multi-tenant inference platforms must prevent one customer from starving others. Noisy neighbors appear as latency spikes, KV evictions, and rising error rates without a single “bad” model release. Isolation tools include dedicated pools for premium tenants, GPU partitioning, request quotas, token buckets, and strict admission when memory is exhausted.

Side channels and residual state are security concerns: weights, KV caches, and batch slots may retain data if teardown is sloppy. Reliable process isolation, memory scrubbing between tenants, and attested nodes matter for sensitive deployments. AI safety owns hazard analysis; this page owns the host-layer controls that reduce cross-tenant leakage risk.

Priority tiers should be explicit. Free tiers may queue; paid tiers get reserved concurrency. Without published tier semantics, sales promises and SRE reality diverge. Load tests must include a abusive tenant scenario.

Colocating training-ish workloads with online inference on shared accelerators is a frequent mistake. Even “small” eval jobs can fragment memory and trigger latency cliffs. Separate pools or hard quotas are cheaper than perpetual firefighting.

Rollouts, canaries, and rollback

Model releases are code deployments with extra dimensions: weights, tokenizer, chat template, tool schemas, and safety filters. Use progressive delivery: canary traffic percentages, shadow mode (run new model without serving answers), and blue/green pools with instant rollback pins.

Promotion gates should include offline eval suites, latency benchmarks on representative mixes, and error rate monitors—not only accuracy deltas on a static set. Pair with prompt engineering version pins when templates change alongside weights.

Rollback must be one action: revert digest, revert adapter set, revert router weights. Teams that require rebuilding artifacts to rollback will hesitate during incidents. Keep N-1 artifacts hot or fast-loadable.

Feature flags for model routes allow per-tenant canaries—enterprise customer on new checkpoint, everyone else stable—without forking entire stacks. Log flag state in request traces for support debugging.

Document blast radius: which products share a base model, which filters are shared, and what happens if a canary poisons cache keys. Correlated failures across surfaces are common when one hosting cluster serves many apps.

Observability: tokens, queues, and errors

Inference observability starts at the gateway: auth, rate limits, routing decisions, queue time, TTFT, TPOT, tokens in/out, finish reason, model version, and tool-call counts. Distributed traces should cross gateway → scheduler → worker → tokenizer → model → post-filters. Without traces, “slow chat” tickets bounce between teams forever.

Metrics to dashboard: tokens/sec by model, batch size distributions, KV memory usage, cache hit rate, prefill versus decode time, OOM rate, 429 rate, and saturation events. Alert on leading indicators—rising queue depth, climbing KV evictions—before user-visible SLO breach.

Log prompts and outputs with redaction and retention policies. Support debugging needs enough context; privacy needs minimization. Structured error codes beat generic 500s: context_length_exceeded, model_overloaded, filter_blocked, adapter_missing.

Synthetic probes with fixed prompts detect drift in latency and refusals between regions. Probes are not a substitute for eval suites but catch gross regressions fast.

Cost attribution and unit economics

Finance and product need dollars per million tokens—and per tenant, feature, and model route. Attribute GPU-seconds, memory-resident time, egress, retrieval calls, and idle reserved capacity. Without attribution, teams optimize the wrong layer—tuning prompts while the router sends everything to a 70B model.

Chargeback models encourage efficient routing: escalate to large models only when small models fail confidence checks. Show product managers the marginal cost of default context length and of always-on rerankers.

Spot/preemptible instances may suit batch inference; strict online SLOs usually need stable pools. Reserved capacity lowers unit cost at utilization risk—model that with explicit headroom targets, not hope.

Compare hosted API list price to self-hosted fully loaded cost: engineering, on-call, utilization, and failure waste. Hosted wins on time-to-capacity; self-hosted wins on steady high utilization and data control—see tradeoffs below.

Security of weights and prompts at the host layer

Model weights are intellectual property and sometimes regulated assets. Encrypt at rest, restrict decrypt to serving nodes, audit exports, and sign artifacts in CI. Supply chain integrity for containers and CUDA stacks matters as much as application code.

Prompt and completion logs are sensitive. Encrypt in transit and at rest, enforce RBAC on admin consoles, and separate production logs from training corpora. Accidental fine-tuning on production chats recreates leakage hazards.

Host-layer controls complement application security: network egress policies on workers, secret injection without logging, and blocking arbitrary code execution from tool endpoints. Agents amplify impact when hosting stacks grant broad outbound access.

Key management for customer-provided keys (BYOK) and per-tenant encryption is increasingly expected in enterprise deals. Document who can decrypt what under break-glass procedures.

Hosted versus self-hosted tradeoffs

Hosted inference APIs—frontier labs and cloud model endpoints—offer fast access, managed scaling, and operational simplicity. Tradeoffs include vendor lock-in, opaque model updates, data residency constraints, and list pricing at scale. Contract for pinning, notice periods, and eval access when releases are safety-critical.

Self-hosted stacks on NVIDIA GPUs or cloud VMs maximize control: custom batching, private adapters, air-gapped options, and cost optimization at high steady utilization. You own patching, scaling, incidents, and compliance evidence. Open serving runtimes and Microsoft Azure model hosting patterns are common starting points; success still requires SRE discipline.

Hybrid patterns are typical: self-host embeddings and rerankers, buy frontier generation; or self-host in regulated regions and use hosted elsewhere. Make data flow explicit on architecture diagrams—prompts, logs, and fine-tune exports cross boundaries.

Decision checklist: required latency percentiles, data residency, needed model sizes, expected tokens/day, team on-call maturity, and appetite for vendor roadmap risk. Neither choice is universally correct; mismatched choice is expensive.

Capacity planning worksheets should list peak concurrent sessions, context length distribution, output length distribution, and tool-call rate—not a single “QPS” number. Prompt engineering changes shift that distribution silently when templates grow. Revisit capacity when default prompts or RAG chunk counts change.

Serving embedding endpoints alongside generative models on shared pools requires separate SLOs: embedding batches are often smaller, more cacheable, and more latency-sensitive for retrieval paths feeding RAG. Do not starve embedding SLAs because chat traffic filled GPUs.

Disaster recovery for hosting means replicated artifacts, DNS or gateway failover, and rehearsed restore of signing keys. Model weights without backup digests are single points of failure as painful as database loss.

FinOps partnership: tag requests with tenant, product, and feature IDs at the gateway so cost exports reconcile with finance systems. Untagged GPU hours become political arguments instead of optimization roadmaps.

Compliance overlays—HIPAA, PCI adjacent workflows—may require dedicated pools, no training on production logs, and geographic pinning. Document which routes are in scope for audits; mixing regulated and unregulated traffic on one pool complicates evidence collection.

Health checks should validate end-to-end inference: tokenizer load, model forward, sample generation, and filter chain—not only TCP reachability. Green load balancers with broken CUDA contexts have wasted many incident hours.

Quantization and fine-tuning adapter combinations should be regression-tested as a matrix, not single points. INT4 base plus new LoRA is a different product than FP16 base plus same LoRA—pin both in client configs.

Operational anti-patterns

Notebook throughput as capacity plan. No admission control under KV pressure. Silent model swaps without client pins. One global batch size for all tenants. Sharing caches across ACL boundaries. Autoscaling on CPU only. Rollback that requires re-downloading weights. Cost dashboards without per-route attribution. Treating inference as “just API glue” while skipping SLOs.

Where model hosting sits in the Knowledge graph

Parent context: AI infrastructure for accelerators and fabrics; AI models for selection and lifecycle. Adjacent: RAG and embeddings for retrieval stages that share hosting pools; edge AI for placement at the edge. This page is the operations layer between trained artifacts and product features—link here when the question is how to serve reliably, not how tensors are arranged.

Closing

Model hosting is production engineering for learned functions: batch and cache without sacrificing tails, scale on the right signals, isolate tenants, canary releases, observe tokens and queues, attribute cost, and protect weights and prompts at the platform boundary. Build those practices before chasing the next benchmark point.

References and further reading

Technical Clarifications

Frequently Asked Questions

Operational and architectural questions regarding model hosting inference platforms.

What is the difference between model hosting and AI infrastructure?

AI infrastructure covers accelerators, fabrics, and cluster capacity. Model hosting is the inference service layer: batching, routing, SLOs, rollouts, and multi-tenant serving on top of that capacity.

Which metrics matter most for LLM inference SLOs?

Track time-to-first-token, time-per-output-token, p99 end-to-end latency, error rate, queue depth, and saturation behavior—not average throughput alone.

When should teams use prefix or KV caching?

Use prefix caching when many requests share identical system prompts, tool definitions, or RAG prefixes, provided cache keys respect tenant ACLs and model version pins.

How do canary deployments work for model updates?

Route a small traffic percentage to the new weights or adapter, compare latency and quality guardrails, and keep one-click rollback to the previous artifact digest.

Hosted API versus self-hosted inference—how to choose?

Choose hosted for speed to capacity and lower ops burden; choose self-hosted for data control, custom serving, and favorable unit economics at high steady utilization.

Knowledge Graph Continuation

Related Architectural Concepts

Continue exploring adjacent systems, infrastructure, and governance models in this subject domain.