This module installs the operating discipline for LLMs in production: serve, quantize, route and canary only where your own eval harness prices the quality side and your traces price the cost side — then translate both into a decision an executive can actually make.
Karthik has the support-assistant model self-hosted on a single GPU and wants to quantize it — 4-bit AWQ would roughly double the concurrency the same card can serve, which the budget would love.
He runs the swap, checks the aggregate eval score against the FP16 baseline, sees it hold within noise, and is ten minutes from shipping.
"Aggregate parity hides slice collapse. Did you diff per-slice?" He hadn't.
Every slice holds except one — long-tail numeric extraction, the queries that pull exact retention windows and error codes out of documents, down four points. For a support assistant that quotes SLAs and thresholds, that is precisely the slice that matters.
The quantization isn't dead; it's a decision now: two-plus times the concurrency at a measured four-point cost on one nameable slice — a sentence an executive can act on.
What she carries upward is not "faithfulness 0.87" but "roughly one answer in eight contains an unsupported claim, which is why the review gate stays on for billing."
The harness the whole track built is now the control system the serving stack answers to.
Everything the track has built — measured retrieval, eval gates, adapters, agents — becomes a production system in this module, and a production system has an operations bill someone must own. That someone is increasingly the senior DS/MLE: postings that name vLLM, quantization, and observability tooling in the same breath as "eval harnesses" are describing one job, the person who can serve a model, prove its quality hasn't drifted, attribute its cost, and roll it back when either goes wrong. The module closes with the skill that makes the rest legible upward: translating faithfulness curves and dollars-per-request into decisions an executive can actually make.
The through-line, one last time, is the eval harness from M5–M6. Quantization is a quality claim your harness verifies. Routing to a cheaper model is safe exactly when the golden set says so. A canary is promoted or rolled back on sampled eval scores. By the end of this module, the harness isn't a testing tool — it's the control system your serving infrastructure answers to.
Self-hosting, quantizing, routing, and canarying are all the same decision wearing different clothes: a quality-cost trade you are only entitled to make if you can measure both sides. The eval harness prices the quality side; the tracing and cost instrumentation in this module prices the other. Teams that operate LLMs without both are guessing twice.
The API-vs-self-host decision is an economics-and-constraints decision. APIs win on frontier quality, zero ops, and elastic scale. Self-hosting wins when data cannot leave your boundary (the default posture for client data in services work), when a tuned 7–8B model from M7 covers the task, or when sustained high volume makes per-token pricing worse than a GPU lease. What makes self-hosting viable at all is the serving engine, and vLLM has become the default answer — it's the engine named in job postings and the paved-path choice at major engineering organizations.
Two ideas do most of vLLM's work:
Together they are why one mid-range GPU can serve a 7–8B model to a team.
Standing it up is deliberately anticlimactic:
pip install vllm
vllm serve Qwen/Qwen2.5-7B-Instruct-AWQ \
--max-model-len 8192 \
--gpu-memory-utilization 0.90 \
--dtype half # T4-class GPUs: fp16, no bfloat16
That exposes an OpenAI-compatible endpoint, so every client, gateway, and framework in your stack points at it with a base-URL change:
from openai import OpenAI # pointed at your own server, not OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="unused")
resp = client.chat.completions.create(
model="Qwen/Qwen2.5-7B-Instruct-AWQ",
messages=[{"role": "user", "content": "Summarize this incident: ..."}],
)
Two flags deserve respect:
--max-model-lenbounds per-request KV growth; set it to what your workload actually needs, because unused context length is concurrency you gave away.--gpu-memory-utilizationthe fraction of VRAM vLLM claims for weights plus KV cache; on a shared or small GPU, headroom prevents OOM at burst.Then benchmark, because a server without a load test is a rumor. The metrics that matter: TTFT (time to first token — the felt latency for streaming UIs), inter-token latency, output tokens/second across the batch (system throughput), and request throughput at your target latency percentile. Use vLLM's bundled benchmark (vllm bench serve) or a k6/locust script against the endpoint, sweep concurrency from 1 to saturation, and record the curve — the knee of that curve is your capacity number, and it goes in the exec memo later, converted to dollars: GPU-hours per million tokens at your observed throughput versus the API price for equivalent quality.
Serving composes with M7: vLLM can mount LoRA adapters over a shared base (--enable-lora), so one deployed base model serves several task-tuned adapters — the deployment story that makes small fine-tunes operationally cheap. For CPU-only environments and laptop demos, Ollama or llama.cpp are the fallback path; the measurement discipline is identical.
For India-based teams, the arithmetic that matters is spot-instance pricing in ap-south-1/asia-south1 for a T4 or A10 versus per-token API cost at your volume, with a Kaggle T4 as the zero-cost lab environment. The lab is sized to fit the free tier; the sizing worksheet in the playbook scales the same math to production.
Quantization shrinks weights (and sometimes activations) to lower precision, buying VRAM headroom — which becomes KV-cache space, which becomes concurrency — and often raw speed. The three formats you'll actually choose between for serving:
| Format | What it is | Hardware reality | Serving effect |
|---|---|---|---|
| AWQ | 4-bit weight-only; activation-aware calibration protects the weights that matter most | Runs on Turing (T4) and everything newer — the free-tier and budget-GPU option | ~4x smaller weights; strong quality retention on instruct models; memory-bound workloads speed up |
| GPTQ | 4-bit weight-only; layer-wise error-minimizing calibration | Turing and newer; optimized Marlin kernels on Ampere+ | Similar footprint to AWQ; quality and speed differences are model-specific — measure, don't assume |
| FP8 (W8A8) | 8-bit float for weights and activations | Needs native FP8 hardware — Ada Lovelace (L4/L40S) and Hopper (H100) class; not T4/A10 | Near-lossless quality in most published reports, with meaningful throughput gains from 8-bit compute |
The pattern to internalize: published quality numbers for quantized checkpoints are averages over generic benchmarks, and your task is not a generic benchmark. Quantization error is uneven — it can be invisible on prose summarization and material on numeric reasoning, edge-case extraction, or your domain's rare vocabulary. So the M6 CI gate gets a new customer:
The deliverable is an eval-parity report — "AWQ holds within noise of FP16 on all slices except long-tail numeric extraction (−4 points), at 2.3x the concurrency on the same GPU" is a decision-ready sentence, and producing it is precisely the "benchmarking model performance" skill postings ask for. KV-cache quantization (FP8 cache) is a further headroom lever with the same verify-first rule.
Never take a quality claim about a quantized model from its Hugging Face card, a leaderboard, or this course. The claim you can act on is the one your own harness produced on your own task. That rule is cheap to follow — the harness already exists — and expensive to skip.
Once more than one model serves traffic — an API frontier model, your vLLM endpoint, a cheap tier for classification — you need a single choke point, or cost control and provider migration become archaeology. A model gateway (LiteLLM is the common self-hostable choice; large orgs build their own) gives every application one OpenAI-compatible URL and centralizes four concerns:
Route by task, not by request heuristics, and let CI enforce it: keep a routing table in version control mapping each endpoint/task to its qualified model tier, with the eval run that qualified it linked in the commit. "Why is this route on the cheap model?" should have an answer with evidence attached.
An unobserved LLM system fails silently in two currencies — quality drifts without alarms, and spend accrues without attribution. The instrumentation stack has three layers, and you should stand them up before the first production request, because retrofitting tracing after the incident is the expensive ordering.
Traces. Every request carries a span tree: retrieval step, each model call, each tool call, each agent hop — with model ID, prompt version, input/output/cached token counts, computed cost, latency, and stop reason on every LLM span, joined to your existing distributed traces by request ID. The ecosystem has converged on OpenTelemetry with the OpenInference semantic conventions for LLM spans, which keeps you portable across backends. The self-hostable options, all free:
| Tool | Shape | Where it fits |
|---|---|---|
| Arize Phoenix | OTel/OpenInference-native tracing plus a library of research-backed evals that run over traces | The evals-on-traces workflow this track teaches; strong RAG and agent trace views |
| Langfuse | OSS tracing with first-class cost tracking, prompt management, and annotation queues | Product-style LLM apps; the trace→annotate→dataset loop |
| MLflow 3 | Tracing plus GenAI scorers inside the experiment tracker you already run | Teams standardized on MLflow for classical ML who want one system of record |
The choice matters less than the fields: prompt version and model ID on every span, because every quality investigation starts with "what changed," and prompt edits don't show up in your deploy log unless you put them there.
Cost dashboards. From trace data, maintain cost-per-request and cost-per-day broken down by feature, route, model, and team — plus cache hit rate, because a caching regression looks exactly like a traffic spike until you split by cache-read tokens. Set budget alerts before the first invoice surprise. Your dashboarding skills transfer directly; the only new idea is that tokens are the metered unit and the gateway plus traces are the meter.
Drift alerts. Production quality drifts for reasons no code change explains — input mix shifts, a provider updates a model behind an alias, a corpus goes stale. The mechanism you already own scales to catch it: sample a few percent of production traces (plus everything user-flagged or validation-failed), run your M6 online eval suite over the sample on a schedule, and alert on metric movement — treating faithfulness-over-time as a monitored series with the same changepoint discipline you'd apply to any production metric. Route the alerting slice's traces into your annotation queue: this is the production→error-analysis→golden-dataset loop from M5, now running continuously. And keep the classical-ML monitoring you already do (feature drift, performance decay) in the same pane — most real systems are hybrids, and the LLM half doesn't excuse the GBM half.
Sampled online evals are a statistical estimator, and you are the person in the room who knows what that implies — size the sample so the alert threshold clears the noise floor, or the on-call channel learns to ignore your drift alarms within a week.
The final piece of discipline: a prompt change is a deploy, and a model swap is a migration. Both get the treatment code gets:
This loop — registry, offline gate, weighted canary, sampled online evals, automatic rollback — is the LLMOps answer to "how do you change anything in production without praying," and describing it end-to-end, with the eval harness as the arbiter at both gates, is the expected shape of the senior interview answer.
The last skill is the one that determines whether any of this infrastructure gets funded: making AI-system performance legible to people who will never read a faithfulness score. Executives make resourcing and risk decisions; your job is to convert harness output and cost telemetry into exactly that — decisions.
Executive-communication questions are scored on translation and honesty: metric → operational consequence → mitigation, cost → unit economics → trend driver, and a stated decision with alternatives priced. An answer that recites eval metrics without consequences, or savings without the quality trade, is the planted distractor.
Your first 15 minutes Monday: take the last quality number you reported upward ("faithfulness 0.87") and rewrite it as a consequence with a control attached ("about one answer in eight carries an unsupported claim, which is why human review stays on for billing questions"). Do that translation yourself for every metric you report — if you leave it to the audience, they'll either ignore the number or over-trust it.
Check yourself: You swap an FP16 model for a 4-bit AWQ build to double concurrency, and the aggregate eval score holds within noise of the baseline. Are you clear to ship, and what is the decision-ready way to report the result?
vllm bench serve or k6, and produce the TTFT/throughput curve with the knee marked. Deliverable: the benchmark report plus the exact serve command and flags, with one paragraph on what --max-model-len cost or bought you.This module anchors the track's two closing labs. Lab L14 — Serve it yourself deploys a 7–8B open model on vLLM, load-tests TTFT and throughput, swaps in an AWQ build, and quantifies the quality-vs-throughput trade with your own eval harness — artifact: the serving config plus the benchmark and eval-parity report. Lab L15 — Observability capstone instruments the full L5–L12 application with Phoenix or MLflow tracing, runs online evals on sampled traces, builds the token-cost dashboard, and triages one injected production regression from traces alone — artifact: dashboards plus the regression RCA memo. Together with L11–L13 they complete the portfolio arc: a tuned, agentic, self-served, observed system with its economics documented. The playbooks provide the vLLM deployment and sizing worksheet (India-aware spot-GPU pricing paths), the quantization decision matrix, the gateway routing-table template with eval-qualification links, the observability field checklist, the canary/rollback runbook, and the executive memo template. Do this at work this week → pb-46 Self-Host an Open-Weight Model with vLLM (the load-tested endpoint behind Karthik's serving), pb-47 Quantization Trade-off Study: AWQ vs GPTQ vs FP8 (Neha's verify-on-your-own-harness parity report), and pb-52 Executive Communication of AI-System Performance (Priya's metric → consequence → mitigation framing). All labs fit the free tier: Kaggle T4 or low-cost spot instances, self-hosted OSS observability, cheap-tier judge models.