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 will periodically update SystemLanguageModel in routine OS updates to improve the on-device model’s abilities and performance. Currently there are 2 model versions that align with:

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

  • iOS, iPadOS, macOS, visionOS 26.4

To better understand the impact of model version on your app, see the guide Updating prompts for new model versions.

Before you use the model, you’ll need to verify its availability. Model availability depends on device factors like:

  • The device must support Apple Intelligence.

  • Apple Intelligence must be turned on in Settings.

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(.appleIntelligenceNotEnabled):
            // Ask the person to turn on Apple Intelligence.
        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