<!-- llms-explorer concept facts · https://llms-explorer.com/tree/foundation-models-context-and-error-version-reconciliation/ · pack 2026-10-23 · ~1590 tokens -->

# Foundation Models context and error version reconciliation

> Source-anchored research for Foundation Models context and error version reconciliation. Run status: COMPLETED.

Parent: [Apple Foundation Models framework](https://llms-explorer.com/tree/apple-foundation-models-framework/) · 4 facets · 11 facts · page: https://llms-explorer.com/tree/foundation-models-context-and-error-version-reconciliation/

## How it works

- Apple says the system model changes when users update to OS 26.4 and OS 27, and asks developers to retest prompts after those model updates. Prompt behavior therefore needs regression checks across model versions, even when the app uses the same framework API. (high confidence) (verified as of 2026-08-06) — [source](https://developer.apple.com/documentation/updates/foundationmodels.md)

## Problems, failure modes and limitations

- Apple lists LanguageModelError, SystemLanguageModel.Error, and LanguageModelSession.Error as OS 27 APIs. Its documentation says these types are unavailable on OS 26 and shows an availability check that falls back to LanguageModelSession.GenerationError; it also says apps built with Xcode 26 continue catching the old error until rebuilt with Xcode 27. Error handling must account for both runtime OS availability and the SDK used to build the app. (high confidence) (verified as of 2026-10-22) — [source](https://developer.apple.com/documentation/foundationmodels/languagemodelerror.md)
- The legacy overflow case is LanguageModelSession.GenerationError.exceededContextWindowSize; the newer model error is LanguageModelError.contextSizeExceeded, whose payload exposes the model’s contextSize and the transcript tokenCount. Apple explicitly redirects legacy assetsUnavailable to SystemLanguageModel.Error.assetsUnavailable and legacy concurrentRequests to LanguageModelSession.Error.concurrentRequests, separating on-device asset failures and session misuse from model-generation errors. (high confidence) (verified as of 2026-10-22) — [source](https://developer.apple.com/documentation/foundationmodels/languagemodelsession/generationerror)
- The numeric on-device context limit is not safely summarized as a universal 4,096 tokens across OS 27. Apple’s WWDC26 sample prints 8,192, while its general context guide and TN3193 still state 4,096. A third-party macOS project reports 4,096 on an M2 and 8,192 on an M3 Pro with macOS 27. Apple’s symbol docs do not publish the full hardware matrix, so apps should query contextSize and treat the exact device/model mapping as unresolved. (medium confidence) (verified as of 2026-10-23) — [source](https://developer.apple.com/documentation/foundationmodels/systemlanguagemodel/contextsize.md)
- The OS 26 generation uses LanguageModelSession.GenerationError, including exceededContextWindowSize, assetsUnavailable, and concurrentRequests. OS 27 separates model-generation failures into LanguageModelError (including contextSizeExceeded), on-device model errors into SystemLanguageModel.Error, and session misuse into LanguageModelSession.Error; Apple's OS 27 documentation shows availability checks that fall back to GenerationError on OS 26. (high confidence) (verified as of 2026-10-22) — [source](https://developer.apple.com/documentation/foundationmodels/languagemodelsession/generationerror.md)

## Comparisons and alternatives

- Apple defines SystemLanguageModel.contextSize as the maximum token count the current model supports in one session, including input prompts and generated responses. The symbol is listed from OS 26.0 and back-deployed before 26.4, so implementations can query the platform value instead of inferring a limit from OS alone. (high confidence) (verified as of 2026-08-06) — [source](https://developer.apple.com/documentation/foundationmodels/systemlanguagemodel/contextsize)
- The published context-size figures are not a universal constant: Apple's general context guide states 4,096 tokens, while its WWDC26 sample prints 8,192. An apfel maintainer's 2026-10-05 correction reports 4,096 on an M2 MacBook Air running macOS 27.0.1 and 8,192 on an M3 Pro; SwiftLM likewise describes newer releases and hardware reporting larger sizes. The sources do not establish a complete OS, device, and active-model matrix, so query contextSize at runtime instead of hard-coding 4,096 or 8,192. (medium confidence) (verified as of 2026-10-05) — [source](https://developer.apple.com/documentation/foundationmodels/managing-the-context-window.md)

## Facts and statements

- Apple introduced token-count inspection with OS 26.4. VoltaSDK reports that tokenCount(for:) overloads require OS 26.4 while contextSize is back-deployed to earlier OS 26 releases, so exact token counts and context capacity need separate availability handling. (high confidence) (verified as of 2026-06-08) — [source](https://developer.apple.com/documentation/updates/foundationmodels.md)
- Apple documents three SystemLanguageModel generations aligned with OS 26.0–26.3, 26.4, and 27.0, and says the on-device model changes with OS 27 updates and prompts should be retested. This implies the runtime OS/model generation is a separate version dimension from the SDK used to build the app. (high confidence) (verified as of 2026-10-22) — [source](https://developer.apple.com/documentation/foundationmodels/systemlanguagemodel.md)
- Apple defines SystemLanguageModel.contextSize as the model's maximum per-session token capacity, including both input prompts and generated responses. Apple says context-inspection and token-counting APIs were released in iOS 26.4 to help apps adapt to hardware; tokenCount(for:) can inspect instructions, prompts, and transcripts, and contextSize is annotated as back-deployed before 26.4. (high confidence) — [source](https://developer.apple.com/documentation/foundationmodels/systemlanguagemodel/contextsize.md)
- VoltaSDK reports that contextSize is back-deployed across OS 26.x while tokenCount(for:) overloads require the 26.4 SDK. HB Martin's migration checklist quotes Apple's note that apps built with Xcode 26 continue catching GenerationError until rebuilt with Xcode 27. Together, these sources mean compile-time SDK availability and runtime OS availability need separate gates. (medium confidence) (verified as of 2026-10-10) — [source](https://github.com/deruloop/VoltaSDK/blob/main/docs/iOS26-Implementation.md)
