on
SLIs, SLOs, and SLAs — tuning reliability for AI-powered services
Site Reliability Engineering gave us a compact language for talking about reliability: SLIs (what we measure), SLOs (the targets we commit to), and SLAs (the formal promises). That language still matters, but when your product relies on machine learning or large language models, the old orchestra needs new instruments — and new tuning rules. This article walks through the essentials and shows which additional SLIs and SLO practices are showing up in recent engineering guidance and research.
Quick primer: the three pillars
- Service-Level Indicator (SLI): a quantitative measurement of one aspect of service behavior (e.g., fraction of successful responses, p95 latency).
- Service-Level Objective (SLO): a target for one or more SLIs over a defined window (e.g., availability ≥ 99.9% over 30 days).
- Service-Level Agreement (SLA): a contractual commitment to customers, often with penalties when SLOs are missed.
These definitions are the same in ML-serving contexts, but the meaningful SLIs expand beyond traditional availability and latency. (mlsysbook.ai)
Why AI/ML systems change the game
Traditional web services fail in visible ways (errors, timeouts). ML systems add subtle failure modes:
- Silent degradation: model quality drifts because of data distribution shifts; there may be no increase in HTTP errors yet answers become wrong or harmful.
- Label lag: ground-truth labels arrive much later than predictions, so quality SLIs are delayed and sparse.
- Output structure and safety: models produce structured or free-form output that can violate format, hallucinate facts, or take unsafe actions.
- Agents and compound behavior: agentic systems orchestrate tools, spawn sub-tasks, and can amplify small error rates into large failures.
Recent standards and reviews call out these exact monitoring gaps and the need for richer operational contracts for AI services. (nvlpubs.nist.gov)
Think of it like a band: traditional SRE tracked whether instruments played and whether they started on time; AI reliability also needs someone listening for whether the tune is actually the song we asked for.
Useful SLIs for AI-powered services
Below are categories of SLIs that teams are increasingly adopting, with practical intent behind each.
- Availability (classic): fraction of requests that return a syntactically valid response within a timeout. Useful for error-budget math. (mlsysbook.ai)
- Latency (classic, but extended):
- End-to-end latency (p50/p95/p99).
- Time-to-first-token and inter-token latency for streaming LLM responses (important for user-perceived responsiveness). (gurkanozkan.ai)
- Schema-valid output rate: percent of responses that conform to the expected JSON/schema (catches malformed outputs early). (gurkanozkan.ai)
- Quality / correctness SLIs:
- Sampled-label accuracy (precision/recall/F1 on a labeled sample).
- Proxy automated metrics (e.g., LLM-as-judge ratings, embedding similarity to trusted sources) for near-real-time checks. (jameshu.io)
- Groundedness / factuality: fraction of outputs passing a grounding check (e.g., evidence found in indexed knowledge base or external sources). (gurkanozkan.ai)
- Model freshness / data freshness: age of deployed model and staleness of features; useful when data shifts matter. (cloud2br-msftlearninghub.github.io)
- Safety / policy SLIs: rate of policy-violating outputs or unauthorized actions (especially for agentic systems). Industry groups are calling for these observability measures as core reliability indicators. (partnershiponai.org)
Practical measurement challenges
- Sampling and labeling: because labels are delayed or expensive, quality SLIs will often be sampled. Sampling strategy and variance must be explicit — a biased sample is a false comfort. (harvard-edge.github.io)
- Evaluation windows and latency: choose windows that reflect user impact (30 days is common for availability; shorter windows may be needed for quick operational feedback). (mlsysbook.ai)
- Multi-dimensional error budgets: ML services often track multiple independent SLOs (availability, latency, freshness, quality). Treat the error budget as a vector or use rules that block risky changes when any critical dimension is exhausted. (harvard-edge.github.io)
- Canary and continuous evaluation: run a small percentage of traffic against a new model and measure quality SLIs in parallel — automated judges or human-in-the-loop checks shorten feedback cycles. (gurkanozkan.ai)
Example SLO package for a chat/assistant API
Below is an example “compact” SLO package for an LLM-based assistant (phrasing is illustrative, not contractual):
- Availability SLO: 99.9% of requests return a 2xx HTTP response with schema-valid output within 30s over a 30-day window. (mlsysbook.ai)
- Latency SLO: p95 time-to-first-token < 500 ms over 30 days. (gurkanozkan.ai)
- Schema SLO: ≥ 99% of sampled responses conform to the JSON schema (sampled at 1% of traffic). (gurkanozkan.ai)
- Quality SLO: On a rolling sample of 1,000 interactions per 30 days, mean judged correctness ≥ 0.8 (using a validated proxy metric or human review). (jameshu.io)
- Freshness SLO: Deployed model retrained or validated on fresh data within the last 30 days (or features refreshed within X hours) depending on domain. (cloud2br-msftlearninghub.github.io)
Small examples: how to express SLIs in practice
Availability SLI (Prometheus-like pseudocode):
availability = sum(rate(http_requests_total{job="assistant",status=~"2.."}[30d]))
/ sum(rate(http_requests_total{job="assistant"}[30d]))
Schema-valid rate (pseudo-logic):
- Emit metric schema_valid{result=”true”} = 1 when response passes schema validation; 0 otherwise.
- Then compute rate over window: sum(schema_valid == 1) / count(schema_valid).
For quality SLIs where labels lag, maintain a labeled-sample pipeline and report the metric with explicit note of label date ranges and sample size. (gurkanozkan.ai)
Final note: fit the music to the room
SLOs are a reliability contract with the team and, possibly, customers. For AI systems the contract should expand to include quality, freshness, structure, and safety — because service health is no longer just “did the server respond?” but “did the system respond correctly and safely?” Standards and research from industry and national bodies emphasize the observability and monitoring gaps unique to AI — they’re prompting engineers to add the SLIs above into everyday practice. (nvlpubs.nist.gov)
If traditional SRE is a metronome that keeps the beat, AI-aware SRE needs both a metronome and a critic with an ear for harmony: availability and latency keep the lights on, but quality and safety keep the music recognizable.