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

Capacity, cost, failure and privacy-risk models for a stated workloadValidation of one capacity, cost or reliability prediction
1

Read

In this order, only the parts listed

0 of 2 done

  1. 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.

  2. Account for attempts and human workDurable Tool-Using Workflow

    Milestones B and E; Measurement requirements; Design-defense questions

2

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.
3

Try it yourself

Closed-book, before checking anything

Derive a synthetic single-slot FIFO model: 20 tasks arrive every 0.5 seconds starting at time zero; each uses three serial calls of exactly 0.1 seconds, with no overhead, retries or overlap. Service demand is 0.3 seconds per task, utilization is 0.6, capacity is tasks per second, queue wait is zero and the last task finishes at 9.8 seconds. Verify with a virtual-clock simulator on CPU. Then predict one agentlab resource total before a held-out run, recording the model, workload, versions and assumptions; explain differences from the prediction.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 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. 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. 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:cli through the OpenAI-compatible adapter in llm/default_plugins/openai_models.py to llm/models.py, llm/logs.py and llm/migrations.py. Run tests/test_openai_endpoint.py, test_migrate.py, test_pause_resume.py and test_tools.py on CPU, point llm openai endpoint at 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-gate tests (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.