Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2026 System ServicesAI & Machine Learning

WWDC26 · 11 min · System Services / AI & Machine Learning

Build with the new Apple Foundation Model on Private Cloud Compute

Private Cloud Compute lets you access powerful, frontier-class models while protecting user privacy. Explore how it works and how to access it using the Foundation Models framework. Discover best practices for checking availability and handling graceful fallbacks in your apps.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

  • 0:00 — Introduction
  • 1:23 — What is Private Cloud Compute
  • 2:43 — Integrating PCC with Foundation Models
  • 4:00 — Deciding between on-device and PCC
  • 4:32 — Reasoning levels and context size
  • 6:15 — Evaluating and combining models
  • 7:10 — Handling usage limits
  • 10:15 — Next steps

Code shown on screen · 7 snippets

Prompt the on-device model swift · at 2:49 ↗
import FoundationModels

  let session = LanguageModelSession()
  let response = try await session.respond(to: "Summarize this article: \(article)")
Switch to the PCC server model (one-line change) swift · at 3:02 ↗
import FoundationModels
  
  let session = LanguageModelSession(
      model: PrivateCloudComputeLanguageModel()
  )
  let response = try await session.respond(to: "Summarize this article: \(article)")
Structured output and tools work the same swift · at 3:25 ↗
import FoundationModels

  @Generable
  struct ArticleSummary {
      let oneLineSummary: String
      let keyPoints: [String]
  }

  struct FindRelatedArticlesTool: Tool {

  }
  
  let session = LanguageModelSession(
      model: PrivateCloudComputeLanguageModel(),
      tools: [FindRelatedArticlesTool.self]
  )

  let response = try await session.respond(
      to: "Summarize this article: \(article)",
      generating: ArticleSummary.self
  )
Check availability swift · at 3:51 ↗
import FoundationModels
  
  struct ArticleSummarizationView: View {
      private var model = PrivateCloudComputeLanguageModel()

      var body: some View {
          if model.isAvailable {
              // Show UI for making request
          } else {
              // Fall back
          }
      }
  }
Set a reasoning level swift · at 5:26 ↗
let response = try await session.respond(
      to: prompt,
      contextOptions: ContextOptions(reasoningLevel: .light)
  )
  // Reasoning levels: .light, .moderate, .deep
Read the context size swift · at 5:58 ↗
SystemLanguageModel().contextSize
  // 4096 on 26.0
  // 8192 on 27.0 (newer devices)

  PrivateCloudComputeLanguageModel().contextSize
  // 32768
Handle usage limits swift · at 9:41 ↗
struct ArticleSummarizationView: View {
      private var model = PrivateCloudComputeLanguageModel()

      var body: some View {
          if case .belowLimit(let info) = model.quotaUsage.status {
              if info.isApproachingLimit {
                  Text("Nearing usage limit.")
                      .foregroundStyle(Color.orange)
              }
          }
          if model.quotaUsage.isLimitReached {
              Text("Usage limit exceeded.")
                  .foregroundStyle(Color.red)
          }
          if let suggestion = model.quotaUsage.limitIncreaseSuggestion {
              Button("Show options") {
                  suggestion.show()
              }
          }
      }
  }

Resources