AI Compass
Compass

Serving models

From file to service: runtimes, formats, quotas and the operational questions that must be settled before the first request.

·2 min read·By Fachredaktion Technik
DETAIL
3 sections

The idea

A trained model is a file. A service is something else: it accepts requests, distributes them, answers within a committed time, reports failures and can be shut down without losing requests in flight.

Choosing a runtime

RuntimeForStrength
Ollama, llama.cppSingle user, trials, edgeVery simple, CPU capable
vLLMMulti-user on GPUContinuous batching, paged attention
TGIMulti-user on GPUGood integration, streaming
TritonMixed model typesVery flexible, more setup
ONNX RuntimeSmall models, CPU, edgeSlim, platform independent

What must exist before the first request

  • Health checks separately for "process alive" and "model loaded and ready".
  • Warmup: the first request after start is orders of magnitude slower, because kernels compile and memory is allocated.
  • Quotas per user and per tenant, in tokens per minute and concurrent requests.
  • A bounded queue: above the bound, reject rather than accept and answer slowly.
  • Graceful shutdown: stop accepting, finish in-flight requests, then exit.
  • Streaming: time to first character is the perceived response time.

Sizing quotas

Card capacity:             1,200 tokens/s throughput
Commitment per user:          25 tokens/s
Theoretically concurrent:     48 users
Safety margin 30 %:           33 users
Quota per user:           60,000 tokens/hour

The safety margin is not decoration. Without it, every load peak breaches the commitment and the queue grows faster than it drains.

Queueing behaviour

Mean sojourn time in an M/M/1 model

ρ = λ / μ W = 1 / (μ − λ) = (1/μ) / (1 − ρ)

Waiting time does not grow linearly with utilisation but runs to infinity as utilisation approaches one.

λ
request arrival rate
μ
service rate of the system
ρ
utilisation, that is λ divided by μ
W
mean time in the system
Utilisation ρSojourn time relative to idle
0.502.0×
0.703.3×
0.805.0×
0.9010.0×
0.9520.0×

That is the justification for the safety margin above: utilisation above about 70 percent is unplannable under variable load. Anyone committing to a response time plans at 60 to 70 percent, not 90.

Several models on one card

Three routes, each with a different compromise:

RouteIsolationUtilisation
One model per cardCompleteLow with uneven load
Several models in one processNoneHigh
Partitioning the card into instancesHardware-levelMedium, fixed split

For tenant-separated systems the third is usually the only one that can be evidenced: a shared process without memory separation is hard to justify as separation to a supervisory authority. See Data residency.

What must be logged

  • Model version and checksum per request, not per day.
  • Input and output token counts, for billing and capacity.
  • Time to first token and total time, separately.
  • Reason for abort when a request was not answered in full.
  • No plaintext of inputs unless that is an explicitly defined purpose with a retention period.

The last line is routinely decided wrongly. A complete log of all prompts is tempting for debugging and is routinely a processing operation on personal data with its own legal basis. See Logging.

Related courses and sources

ToolFreeEN

Netron

Opens a model file and draws its structure. The fastest way to see what a delivered model actually contains.

For a quick look inside a delivered model before putting it into operation.

ToolFreeEN

Ollama

Run open models locally, one command per model. The simplest way to try running without a provider at all.

For a first try with a local model, with no provider and no account.

ToolFreeEN

vLLM

A high-throughput server with continuous batching and paged attention cache. The reason self-hosting becomes economical at volume.

For self-hosting at volume; the reason it can pay off at all.

Was this page helpful?
Serving models