---
title: "One call is many hops"
lesson_id: "01"
---

# One call is many hops

- **Lesson ID:** 01
- **Goal:** State that one LanguageModelSession call is a chain of hops, and that a single duration is not enough to debug.
- **Human lesson:** [01-one-call-is-many-hops.html](01-one-call-is-many-hops.html)

## Prerequisites

- A working Foundation Models session on iOS 27 or macOS 27.

## Inputs, outputs, and artifacts

- **Inputs:** A slow or wrong reply.
- **Outputs:** The idea that the call has hops.
- **Artifacts:** Progressive `.flow` diagrams and a Swift session sketch.

## Agent build steps

1. Describe the false picture of one call.
2. Show pack, respond, and guardrail in Swift around LanguageModelSession.
3. List that context, tools, model, and checks sit inside the wait.
4. Say Instruments sees framework hops, not your product hops.
5. Link streaming metrics and eval harness.

## Constraints

Keep the language simple, friendly, and literal. iOS 27 and macOS 27 only. No quizzes, Mermaid, or em dashes. Do not invent API names. Mark sketches as sketches and tell the reader to confirm them in the Xcode 27 SDK.

## Key concepts

- The app packs context, the model may call tools, the model runs, then a guardrail checks.
- A single duration hides which hop failed.
- High TTFT often lives in the hop before the first token.
- Instruments does not know your context packer or product guardrail.

## Takeaways

- Debug with a timeline, not one opaque duration.
- Never file 'the model is slow' until you can name the hop.
- Pair this with streaming metrics for clocks and the eval harness for wrong paths.

## Acceptance checks

- One-call versus hops is explicit.
- Instruments is mentioned without replacing product spans.
- Sibling links, progressive `.flow` diagrams, and an Agent brief link are present.
- [ ] Proceed to [lesson 02 brief](02-name-the-hops.llms.md).
