Key Terms
| Term | In one line |
|---|---|
| Back-of-envelope | peak QPS = (users × actions/user/hour) ÷ 3600, then ×3 for peak headroom |
| Semantic caching | Embed the query, look for a near-duplicate above ~0.95 cosine, return the cached answer |
| Model routing | Send the simple majority of queries to a cheap model, escalate the rest |
| Golden dataset | Hundreds of labeled examples, ideally curated by domain experts, run on every change |
| Contract testing (Pact) | CI check that producer and consumer API changes can’t silently diverge |
| LoRA | Freezes the base model, trains small low-rank adapters (~0.1% of weights) |
| Clean claim | Complete, correctly coded, payer-compliant on first submission — target >95% |
Numbers That Matter
| Figure | Value | Where it bites |
|---|---|---|
| Semantic cache saving | 30–40% of call volume | The first cost lever to reach for |
| Model routing saving | 30–50% blended | The second lever, bigger but needs a quality gate |
| Batch API | ~50% cheaper per call | Only for work that tolerates delay |
| Reserved capacity | 30–60% off on-demand | 1–3 year commitment on steady-state workloads |
| Budget alerts | 80% / 100% thresholds | Tag every resource by team/project/env so spend is attributable |
| RAG chunking default | 256–512 tokens, 10–20% overlap | A starting point to tune against eval data, not an answer |
| Failure triage sample | 50 failures, categorized | Do this before proposing a fix — never guess |
| AI project buffer | +30–50% schedule | Versus a smaller buffer for well-understood traditional work |
| DORA (healthy) | Deploy ~daily · lead time <1 day · CFR <5% · MTTR <1 hr | The four numbers to quote unprompted |
Decision Rules
- 5GB file, multiple sinks? Don’t parse it in an API process — it will OOM. If nothing needs it in real time, let a data-integration service (ADF or equivalent) ingest and fan out natively. Add sinks as configuration, not as code.
- “Searchable within 5 minutes” means event-driven, not nightly batch: blob upload triggers parse → chunk → embed → index. Budget roughly 10s parse, 1s chunk, ~100ms per chunk to embed.
- Retrieval stuck at 70–85%, stakeholder wants 95% in weeks? Sample and categorize 50 failures first. Then cheap wins in days (tighten prompts, add reranking, fix the ten worst queries), then structural work. Commit to a measured trajectory, never to the number.
- CFO wants 50% off a $15K/month bill? Quick wins in 1–2 weeks (semantic caching, shorter system prompts, batch API), then model routing, then reserved capacity. Sequence by time-to-value and state the quality risk of each.
- Full fine-tune vs LoRA: full updates all weights — best quality, multiple GPUs, large dataset. LoRA freezes the base and trains adapters — far cheaper, swappable per tenant, near-parity for most enterprise tasks. Default to LoRA and justify upward.
- Forced model migration? Audit every service using the model, run the golden set against the replacement in week 1–2, adjust prompts for the new model’s quirks in week 3, then cut over behind a flag with the old version still reachable.
- Azure compute default: Container Apps covers the large majority of workloads — managed Kubernetes underneath, scale-to-zero, KEDA autoscaling, Dapr — at far less operational cost than raw AKS. Reach for AKS only when you need what it exposes.
Say This Out Loud
“Before I propose a fix for a retrieval quality problem, I sample fifty failures and categorize them. Almost every time, what looks like one problem is three — a chunking problem, a query-understanding problem, and a handful of documents that were never ingested properly. If you skip that step you end up tuning prompts against a data bug.”
“For back-of-envelope I take users times actions per user per hour, divide by 3,600 for average QPS, then apply a three-times multiplier for peak. I’d rather say the assumption out loud and be corrected early than build a design on a number the interviewer thinks is wrong.”
“On cost I sequence by time to value. Semantic caching and prompt trimming land in a fortnight and typically take thirty to forty percent off call volume. Model routing is the bigger lever, thirty to fifty percent blended, but I won’t ship it without a quality gate on the golden set — cheap answers that are wrong cost more than the model ever did.”