← All courses

EDGE FDE

Intermediate

Stream tokens and measure speed

Users feel the app is faster when the first token arrives sooner. You can prove it with numbers.

Stream LanguageModelSession tokens and measure TTFT and inter-token latency for on-device and Private Cloud Compute.

Paint partial text, clock first token and gaps, and compare SystemLanguageModel with PrivateCloudComputeLanguageModel. iOS 27 and macOS 27 only.

Lessons

  1. Why the first token matters
  2. Stream tokens in the UI
  3. Measure TTFT and inter-token gaps
  4. On-device versus Private Cloud Compute
  5. Confirm numbers in Instruments

Key concepts

Takeaways

Agent briefs

Related courses

Trace every step of an AI call · Test AI behavior before you ship · Version prompts like product copy · Core AI vs Core ML vs MLX

Official references

Foundation Models · WWDC26 243 Instruments · WWDC26 319 Private Cloud Compute