← All courses ← Course home

Lesson 04 of 05

On-device versus Private Cloud Compute

The same stream API can run on the device or on Private Cloud Compute. The clocks change. Measure both.

Agent brief (llms.md)

On iOS 27 and macOS 27, LanguageModelSession accepts a model. The default is the on-device system model. Pass PrivateCloudComputeLanguageModel() when you want Apple's server model on Private Cloud Compute.

DefaultOn-device
DefaultOn-device
ServerPrivate Cloud Compute
DefaultOn-device
ServerPrivate Cloud Compute
LogTTFT and gaps
import FoundationModels

let onDevice = LanguageModelSession()
let pcc = LanguageModelSession(model: PrivateCloudComputeLanguageModel())

Confirm availability before you show the feature. PCC needs a network and an Apple Intelligence device. If the network fails, retry on the device. Check availability on the model. Do not assume PCC is free of delay. The first token now includes a round trip.

Apple's WWDC26 Private Cloud Compute session reports a larger context window on the server model (32K) and a smaller window on the device. A long transcript that is fine on PCC can stall or fail on-device. Trim history before you switch down. Dynamic Profiles can do that with historyTransform. Switching a profile can also invalidate the KV cache and raise TTFT. Measure after every switch.

Keep one log schema for both models. Same four numbers. Add a field for the model you used. A product owner can then see that PCC bought quality or context, and what it cost in first-token wait.

Read Version prompts like product copy when you route a short on-device profile and a longer PCC profile from one registry.

Rule. Never compare a PCC total time to an on-device TTFT. Same clock, same model field, then compare.

Next, confirm the same numbers in Instruments.

Key concepts

  • The default session is on-device. Pass PrivateCloudComputeLanguageModel() for PCC.
  • Check availability before you show the feature. Retry on-device if the network fails.
  • PCC first token includes a round trip. The server model has a larger context.
  • A profile switch can invalidate the KV cache and raise TTFT.

Takeaways

  • Never compare PCC total time to on-device TTFT.
  • Use one log schema for both models with a model-used field.
  • PCC buys quality or context at a first-token cost.