duo-intelligence
Adds Foundation Models to an iPhone Duo app: the on-device model (SystemLanguageModel) and the Private Cloud Compute server model (PrivateCloudComputeLanguageModel) behind one LanguageModelSession API, an AI side pane beside the content when the phone is open or in book pose (split ArrangementView) and a one-line summary when it is closed or in tabletop, streaming (streamResponse with @Generable partial snapshots) into a pane that keeps going through fold and unfold, availability checks and non-AI fallbacks, quota and error handling (LanguageModelError), tool calling, image prompts (Attachment), reasoning levels (ContextOptions) and privacy. Use when someone adds summaries, an assistant, chat, tagging or image understanding to an app that runs on iPhone Duo, or when an AI feature restarts on a fold, sits in the fold or doesn't fit the outer display.
Kimeur · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add Kimeur/duology --skill duo-intelligenceAbout this skill
name: duo-intelligence description: "Adds Foundation Models to an iPhone Duo app: the on-device model (SystemLanguageModel) and the Private Cloud Compute server model (PrivateCloudComputeLanguageModel) behind one LanguageModelSession API, an AI side pane beside the content when the phone is open or in book pose (split ArrangementView) and a one-line summary when it is closed or in tabletop, streaming (streamResponse with @Generable partial snapshots) into a pane that keeps going through fold and unfold, availability checks and non-AI fallbacks, quota and error handling (LanguageModelError), tool calling, image prompts (Attachment), reasoning levels (ContextOptions) and privacy. Use when someone adds summaries, an assistant, chat, tagging or image understanding to an app that runs on iPhone Duo, or when an AI feature restarts on a fold, sits in the fold or doesn't fit the outer display." metadata: verified: "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no" sources: "https://github.com/Kimeur/duology/blob/main/reference/sources.md"
duo-intelligence
The Foundation Models framework gives an app Apple's on-device language model and, from iOS 27, the larger Private Cloud Compute model, through the same Swift API (Foundation Models). On iPhone Duo the question is where the result goes and what happens when the phone folds mid-answer. This skill answers both.
Load neighbours when the task needs them: duo-continuity (state that survives a fold), duo-layout (size classes, the fold, ArrangementView), duo-postures (book and tabletop layouts), duo-app-intents (let Siri and Shortcuts run the same feature). To start a new notes app with all of this in place, use recipe-notes-ai.
Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1) on 20 October 2026; see references/evidence.md. Unverified means we could not confirm it. Everything else comes from Apple's pages, linked inline. Full source list: reference/sources.md.
What Apple says, and what it doesn't
Apple's iPhone Duo pages and the six Duo Tech Talks say nothing about Foundation Models (we searched the transcripts, the HIG page and the developer overview). The Duo advice below applies Apple's general Duo rules to AI features: keep the same features on both displays, let the open phone add one level of detail, keep controls out of the fold (HIG: Designing for iPhone Duo). An AI pane is a supporting pane, like the Podcasts transcript Apple puts beside Now Playing with a split ArrangementView (talk 111463). The model facts come from the Foundation Models docs and WWDC26 sessions 241 and 319.
On device: SystemLanguageModel | Server: PrivateCloudComputeLanguageModel | |
|---|---|---|
| Since | iOS 26.0 | iOS 27.0, plus a managed entitlement |
| Network | Not needed | Needed |
| Context | 4,096 tokens | 32K tokens |
| Limits | None | A daily limit per person; iCloud+ raises it |
| Reasoning | No | light, moderate, deep |
| Images | Yes, iOS 27 (.vision capability) | Yes |
Sources: Adding server-side intelligence with Private Cloud Compute, Managing the context window, Analyzing images with multimodal prompting. Both models conform to the iOS 27 LanguageModel protocol, so LanguageModelSession(model:instructions:) takes either one and the rest of your code stays the same.
Rules
- Start on device. Use Private Cloud Compute only when evaluation (Apple's Evaluations framework, new in Xcode 27) shows the on-device model can't do the job, the app has the entitlement, and the person knows the text leaves the phone (PCC guide, HIG: Generative AI).
- Check availability, then still expect failure. Measured: the simulator reported both models
.available, yet every on-device request failed. Every request needs a non-AI fallback. - One feature, two sizes. Open and wide: the result in a pane beside the content. Closed, or any window that can't fit the pane beside: one line, with a way to the full pane. Same feature, same data.
- Own the request in a model, not a view. One
AssistantModelper window, created in the window root. A fold resizes the window; the stream must not notice (duo-continuity). - Ask for structure. A
@Generabletype with a short headline first feeds the closed phone early and the open pane fully, from one request. - Let the arrangement keep the pane off the fold. A split
ArrangementViewputs the note and the pane one on each side. Text in a scroll view may cross the fold; Stop, Retry and text fields may not. - Say where AI is used and keep people in control. Label the pane, say what the model is doing, and let people dismiss or retry the result (HIG: Generative AI). Add Stop too: a request can hang (measured).
- Gate the APIs.
SystemLanguageModeland sessions are iOS 26.0.PrivateCloudComputeLanguageModel, `Lang