Runtime and endpoint architectures
Separate model runtime, API contract, policy enforcement, scheduling, and workload responsibilities.
Before you start
Module prerequisites: SAI-210. Check the exercise-specific tools and environment before running commands.
Module outcomes: Match runtimes and hardware to workloads; Design governed model endpoints and routing; Plan capacity, reliability, and failure behavior. This lesson contributes to that sequence.
Separate responsibilities
Describe model storage and loading, inference runtime, accelerator scheduling, API translation, authentication, authorization, rate and quota enforcement, routing, safety or policy inspection, telemetry, and deployment management as distinct responsibilities. A single product may combine several of them, but the architecture documentation should not hide who is actually responsible for each one — when something fails, "the serving stack" is not an owner.
Endpoint contract
Define accepted request shapes, size and context limits, streaming behavior, timeout and cancellation semantics, response structure, error and refusal codes, version negotiation, identity context, idempotency where relevant, and evidence correlation. Treat this contract as something clients depend on independently of the runtime behind it.
Avoid exposing runtime-specific features through a supposedly portable contract unless the dependency is intentional and explicitly recorded — a client that silently depends on one runtime's quirks becomes an unplanned migration blocker later, documented in Architecture decision records.
Isolation and tenancy
Decide whether models, accelerator memory, caches, queues, logs, and administrative controls are shared across workloads or tenants. Document tenant and data separation, scheduling fairness, noisy-neighbor behavior, model-loading authority, and cleanup between requests. An isolation decision made implicitly by whatever the runtime defaults to is still a decision — it should be reviewed, not inherited by accident.
Failure paths
Specify what happens when a model cannot load, context is too large, the queue is full, a stream is interrupted, policy is unavailable, or evidence cannot be recorded. Clients need stable, non-misleading failure signals rather than a generic error that could mean anything from "retry immediately" to "this request will never succeed."
Retrying an unsafe or non-idempotent operation can amplify harm — a client-side retry policy designed for a typical web API can be actively dangerous against a model endpoint that performed a partial or side-effecting action before failing. Define which failure classes are safe to retry automatically and which require a fresh, explicitly authorized request.
Module worked example
A model loads successfully but requests fail when several users submit long prompts.
- Apply the control
- Measure peak cache demand, active sequences, queueing and tail latency on the declared hardware.
- Expected result
- The serving decision limits concurrency and context to an observed workload envelope.
- Troubleshooting
- Loading weights is not a capacity test. Separate weight memory, cache, runtime overhead and reserve.
Practice and completion check
Choose one control from this lesson. Identify its actor, target, enforcement point and expected result. Describe an allowed case and a denied or failed case. For a runnable exercise, retain observed output and separate it from expected output. Record unresolved limitations before marking the lesson complete.
Your lesson progress
Completion is self-reported learning progress; it does not certify practical competence.
Status: Not marked
Loading your learning record…