Download

Foundation Models. Apple's language model inside your app

What the on-device Apple Intelligence model can do, how much text it holds, which iPhones run it, which languages it understands and how to get typed Swift results from it.

In short

Foundation Models is Apple's framework that lets an app use the Apple Intelligence language model right on the device, free and offline. It runs on iOS 26 and later, and the on-device model has about 3 billion parameters and a context window of 4,096 text units per conversation.

What Foundation Models is

Apple introduced the framework on June 9, 2025 at WWDC25, in the Meet the Foundation Models framework talk. It reached people with iOS 26, iPadOS 26, macOS 26 and visionOS 26, and the watch got it with watchOS 27. Inside is the Apple Intelligence language model, about 3 billion parameters compressed to 2 bits per weight (Apple Machine Learning Research). The model is built into the system, so your app doesn't get any bigger.

On September 29, 2025 Apple stressed that these features work offline and that inference is free of cost (Apple Newsroom). There's no key, no per-request bill and no server of your own. Per the documentation, the on-device model handles summarization, entity extraction, text refinement, game dialog and creative writing well. For deeper reasoning and long documents Apple offers the Private Cloud Compute server model.

Where it lives in Xcode

You add the framework with import FoundationModels, with nothing else to install. A conversation with the model is a LanguageModelSession object, which can answer with plain text or a typed structure. Before calling it, check SystemLanguageModel.default.availability. Apple notes that availability depends on whether the device and region support Apple Intelligence.

The #Playground macro on the Xcode canvas is handy for trying instructions. Since February 2026 it shows how much of the 4,096 units the input and the response used. Step-by-step usage shows up in Instruments, Product › Profile, then the Foundation Models instrument (Managing the context window).

Apple's numbers and requirements

WhatValue
SystemsiOS, iPadOS, macOS and visionOS 26.0, watchOS 27.0
On-device modelabout 3 billion parameters, 2 bits per weight
On-device context window4,096 text units per conversation
One text unit3–4 characters in English, 1 character in Chinese, Japanese, Korean and Vietnamese
Private Cloud Compute32K units, iOS 27 and later, needs network, daily limit per person
Cost to developersfree, works offline
Apple Intelligence languages16, from English and Chinese to Turkish and Vietnamese
iPhoneiPhone 15 Pro and 15 Pro Max, every iPhone 16, 17, 18, Air and Duo
iPad and MacM1 chip or later, iPad mini with A17 Pro, MacBook Neo

Per the Foundation Models documentation, Apple Machine Learning Research and the Apple Intelligence page, checked October 17, 2026.

How much text the model holds in one conversationContext window of Apple's language models in text units as of October 17, 2026. The on-device model holds 4,096 units per conversation and runs free and offline since iOS 26. The Private Cloud Compute server model holds 32K units, is available from iOS 27, needs a network connection and gives each person a daily request limit. In English one unit is about 3 to 4 characters. Source developer.apple.com.How much text the model holds in one conversationContext window of Apple's models as of October 17, 2026On-device modelfree, offline, since iOS 264,096Private Cloud ComputeiOS 27, needs network, daily limit32K
The server model fits 8 times more text, while the on-device model works offline with no limit. Per the Foundation Models documentation, checked October 17, 2026.

The 4,096 units cover everything at once, instructions, tool definitions, the response schema and the model's answer. When the window fills up, the conversation throws a contextSizeExceeded error, and Apple suggests starting a new conversation and carrying over only what's needed.

Typed results and tools

The framework's standout feature is guided generation. You describe a Swift structure with the @Generable macro, say a recipe with a title, a list of ingredients and a cooking time, and the framework guarantees the model returns exactly that type. No parsing of text answers by hand. Fields are refined with @Guide, in words and with limits, for example maximumCount caps a list's length.

The second piece is tool calling. You write a type conforming to the Tool protocol, and the model decides when to call it, for example to search your app's database or fetch weather from your own service. Since June 2026 ToolCallingMode controls how the model uses tools. Apple covered both in its WWDC25 talk (Meet the Foundation Models framework).

How to add a model-powered feature, step by step

  1. Make sure the project's minimum is iOS 26, or wrap the new feature in if #available(iOS 26, *).
  2. Add import FoundationModels and check availability. If the model isn't there, show the regular screen without AI.
  3. Check the person's language with supportsLocale. If it's unsupported, say so and turn the feature off.
  4. Describe the answer as a @Generable structure and keep instructions short, Apple suggests no more than three paragraphs.
  5. Try the task in #Playground on the canvas and see how many text units it used.
  6. Test on an iPhone with Apple Intelligence. Rerun it on every new iOS version, since the model changes with the system.

Common mistakes

  • Skipping the availability check. On an iPhone without Apple Intelligence, with it turned off or in an unsupported region, there's no model, and the feature has to cope.
  • Counting on languages outside Apple's list. As of October 17, 2026 Apple Intelligence supports 16 languages, and a request in any other returns an unsupportedLanguageOrLocale error.
  • A long chat in a single conversation. Every exchange eats into the 4,096-unit window, and a long chat sooner or later hits the limit.
  • Not retesting after an iOS update. Apple changed the on-device model in iOS 26.4 in February 2026 and again in iOS 27, and answers to the same instructions can shift.

Appto writes your app in SwiftUI in a regular Xcode project and checks every screen in the simulator, and features built on Apple's model fit into that project like any other. More on the code page.

Questions

Is Foundation Models free?

Yes. The model is built into the system, Apple has called its inference free of cost since September 2025, and there are no keys or per-request fees.

Does Foundation Models work offline?

The on-device model works without a network. The Private Cloud Compute server model, available from iOS 27, needs one.

Which iPhones support Foundation Models?

Devices with Apple Intelligence. For iPhone that's iPhone 15 Pro and 15 Pro Max and every iPhone 16 model and later (apple.com, October 17, 2026).

Which languages does Apple's on-device model support?

The 16 Apple Intelligence languages as of October 17, 2026, including English, Chinese, Japanese, German, Spanish, Turkish and Vietnamese.

How much text fits in one conversation with the model?

4,096 text units on device, counting instructions, schemas and answers together. The Private Cloud Compute server model fits 32K.

Build your own app in Appto

Appto checks the niche on fresh App Store data, designs the screens, writes the code, builds the App Store page and submits to Apple from your account or shows you what to press in App Store Connect. Runs on your own Claude Code or Codex.

Download for Mac