Unit 4 of 10 · about 5 hours · derive, measure
Capacity, cost and risk models, and validating one prediction
An integrated workflow can amplify one task into retrieval, generation, retries and human work. Counting only successful model calls hides both the limiting resource and the cost of failure.
You'll be able to
- Derive capacity and per-accepted-task cost from a stated task mix, attempt policy and resource budget.
- Identify the first capacity or privacy boundary under explicit workload and failure assumptions.
- Validate one prediction and explain the residual instead of fitting the prediction after the run.
Covers
Read
In this order, only the parts listed
0 of 2 done
- Enterprise RAG: audit the workload modelAI Product Architecture Case Studies
Case study 8.31: Requirements, Capacity Estimation, Real-World Example, Scaling and Failure Modes (page read 2026-10-18)
Use the stated workload, not the vendor rates or claimed gains. Correct the Real-World Example: its quoted 10 billion chunks at 1,024 tokens each and $1.02 per million tokens cost $10,444,800, not about $10,000 per tenant. Its own tenant workload is 80 million chunks. The latency table includes first-token time, not full answer generation.
- Account for attempts and human workDurable Tool-Using Workflow
Milestones B and E; Measurement requirements; Design-defense questions
Focus on
- The Systems unit on unit cost and headroom supplies resource accounting. Here, multiply by all reached model, retrieval and tool attempts, including failures and fallbacks.
- Separate first-token time, full task latency, service demand and queue wait. Capacity follows the constrained resource, not the sum of unrelated stage percentiles.
- Build a privacy-risk table of assets, exposed surfaces, attacker capabilities and controls. State unmeasured likelihoods as unknown; an attack-suite frequency is not a population breach probability.
- Local inference has no hosted token invoice, but still uses time, energy, storage and review effort. Keep measured resource units separate from hypothetical prices.
Common mistakes · 3
- Treating a case study's capacity table as a measured deployment. Recompute dimensions and label every workload assumption.
- Estimating cost per success using only successful attempts. Failed and abandoned tasks consume resources too.
- Assigning a breach probability from a few scripted attacks. They establish failure examples or tested boundaries, not real-world prevalence.
Try it yourself
Closed-book, before checking anything
agentlab resource total before a held-out run, recording the model, workload, versions and assumptions; explain differences from the prediction.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What does ten-times arrival rate do to the synthetic single-slot model?Answer
It demands 6 seconds of service per second from one slot. An unbounded queue cannot remain stable; admission, less work or more capacity is necessary.
2.Does a first-token latency budget bound completion latency?Answer
No. Decode, validation, subsequent tool rounds and human review can follow the first token. Measure the task's declared completion event.
3.Your capacity prediction misses because retries doubled. Is the prediction validated?Answer
No. Report the miss and its cause. Revise the attempt model separately and test the revised prediction on another held-out run.
You're done when
Your virtual-clock result matches the exact model, and one preserved prediction has a measured result, residual explanation and explicit validity boundary.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 8 more in the section
- Durable Tool-Using WorkflowRoadmap-Final · required
Close Milestones B, D, E and F and the correctness requirements: crash-window replay, approval bound to the exact effect, fencing, ambiguous outcomes surfaced instead of claimed exactly-once, the matched deterministic, routed and agentic comparison, and clean reproduction. Finish the existing system rather than rebuilding it; delegation stays optional.
- AI Product Architecture Case StudiesEngineering Handbook · support
Pick two of case studies 8.30 to 8.33 (ChatGPT, Enterprise RAG, Coding Agent, Perplexity Search; slugs
chatgpt-conversational-ai,enterprise-rag,coding-agent,perplexity-ai-search), reconstruct each decomposition, identify its hidden assumptions and compare it with yours. Recompute the capacity tables before trusting a number: several are wrong (8.31's per-tenant index cost, 8.33's daily query volume).
Also in this section
- AI Engineering and Agentic Systems CheckpointRoadmap-Final · primary
Execute the complete checkpoint now: explain ownership, derive budgets and contracts, pass versioned evaluation, prove tenant isolation and replay safety, red-team the system, measure the joint frontier, then reconstruct and modify a production-like application.
- Evidence-Grounded Retrieval SystemRoadmap-Final · required
Close the deferred clauses: Milestones B (instrumentation), D (injected failure attribution), E (paired optimization) and F (blinded query and delete campaign with a clean rebuild), the correctness requirements and the rubric. Index rollback and an honest negative result are this track's additions, not project headings.
- LLM (command-line tool and library), pinnedSimon Willison · required
At commit 2465dfc (version 0.36), trace the path from
llm.cli:clithrough the OpenAI-compatible adapter inllm/default_plugins/openai_models.pytollm/models.py,llm/logs.pyandllm/migrations.py. Runtests/test_openai_endpoint.py,test_migrate.py,test_pause_resume.pyandtest_tools.pyon CPU, pointllm openai endpointat your local server, then make one bounded, tested change such as versioned usage normalization or a tool-chain budget, with a migration and a secret-free replay fixture. - AI and ML System Design HandbookEngineering Handbook · reference
Part 9 chapters 0 to 8 are overview-depth architecture notes for serving, RAG, vector search, agents, evaluation, LLMOps, cost and safety. Use them as a checklist for omissions in the integrated design; serving (00, 02) belongs to the Inference track.
- Managing Incidents and Incident ResponseGoogle SRE · support
Read SRE book Chapter 14 (elements of incident management, when to declare an incident) and Workbook Chapter 9 Incident Response with its case studies. Write the incident procedure for the integrated system and run it once against an injected fault.
- AI Agents in Depth - Integration ReviewBojie Li · support
Use 5.1.4 harness engineering, 7.9 and 7.10 and Chapter 9 (9.3.2 safety boundaries for continual evolution, Experiment 9-6 canary and rollback) as a final review. The offline
chapter9/harness-safety-gatetests (no API key) show a release gate that rejects a seeded bad candidate. - The Hitchhiker's Guide to Agentic AI - ProductionHaggai Roitman · support
Use v3 Chapter 27 (27.5 testing, 27.6 observability, 27.7 deployment) and 28.7 human-in-the-loop UI to audit the integrated system. Verify claims against official documentation.
- AI Engineering Handbook - AI Product EngineeringHandbook Academy · support
Use Part 11 to connect evaluation and system evidence to product decisions, feedback and iteration. Finish with a decision memo that distinguishes model capability, orchestration, retrieval, tool, evaluator and user-experience effects.