Contents

SystemLanguageModel

An on-device Apple Foundation Model capable of text generation tasks.

Declaration

final class SystemLanguageModel

Mentioned in

Overview

The SystemLanguageModel refers to the on-device text foundation model that powers Apple Intelligence. Use default to access the base version of the model and perform general-purpose text generation tasks. To access a specialized version of the model, initialize the model with SystemLanguageModel.UseCase to perform tasks like contentTagging. Apple periodically updates SystemLanguageModel in routine OS updates to improve the on-device model’s abilities and performance. Currently there are 3 model versions that align with:

  • iOS, iPadOS, macOS, and visionOS 26.0 - 26.3

  • iOS, iPadOS, macOS, and visionOS 26.4

  • iOS, iPadOS, macOS, visionOS, and watchOS 27.0

For more infomation about how model versions affect your app, see Updating prompts for new model versions.

Before you use the model, you need to verify its availability. Model availability depends on whether the device and region supports Apple Intelligence. For a list of supported devices, see Apple Intelligence.

Use SystemLanguageModel.Availability to change what your app shows to people based on the availability condition:

struct GenerativeView: View {
    // Create a reference to the system language model.
    private var model = SystemLanguageModel.default

    var body: some View {
        switch model.availability {
        case .available:
            // Show your intelligence UI.
        case .unavailable(.deviceNotEligible):
            // Show an alternative UI.
        case .unavailable(.modelNotReady):
            // The model isn't ready because it's downloading or because of other system reasons.
        case .unavailable(let other):
            // The model is unavailable for an unknown reason.
        }
    }
}

Topics

Getting the default model

Creating a model for a use case

Checking model availability

Inspecting model capabilities

Counting tokens

Handling a language model error

See Also

System language model