<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/SystemLanguageModel",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels19SystemLanguageModelC"
  },
  "title" : "SystemLanguageModel"
}
-->

# SystemLanguageModel

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

```
final class SystemLanguageModel
```

## Overview

The `SystemLanguageModel` refers to the on-device text foundation model that powers Apple
Intelligence. Use [`default`](/documentation/FoundationModels/SystemLanguageModel/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`](/documentation/FoundationModels/SystemLanguageModel/UseCase) to perform tasks like [`contentTagging`](/documentation/FoundationModels/SystemLanguageModel/UseCase/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, visionOS **26.4**
- iOS, iPadOS, macOS, and visionOS **27.0**

For more information about how model versions affect your app, see
[Updating prompts for new model versions](/documentation/FoundationModels/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](https://www.apple.com/apple-intelligence/).

Use [`SystemLanguageModel.Availability`](/documentation/FoundationModels/SystemLanguageModel/Availability-swift.enum) to change what your app shows to people based on the availability condition:

```swift
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

[`default`](/documentation/FoundationModels/SystemLanguageModel/default)

The base version of the model.

### Creating a model for a use case

[`init(useCase:guardrails:)`](/documentation/FoundationModels/SystemLanguageModel/init(useCase:guardrails:))

Creates a system language model instance for a specific use case.

[`SystemLanguageModel.UseCase`](/documentation/FoundationModels/SystemLanguageModel/UseCase)

A type that represents the use case for prompting.

[`SystemLanguageModel.Guardrails`](/documentation/FoundationModels/SystemLanguageModel/Guardrails)

A set of controls that flag sensitive content from model input and output.

### Accessing the model variant

[`variant`](/documentation/FoundationModels/SystemLanguageModel/variant-swift.property)

The variant of the on-device model backing this instance.

[`SystemLanguageModel.Variant`](/documentation/FoundationModels/SystemLanguageModel/Variant-swift.struct)

The variant of an on-device model.

### Checking model availability

[`isAvailable`](/documentation/FoundationModels/SystemLanguageModel/isAvailable)

A Boolean value that indicates whether the system is entirely ready.

[`availability`](/documentation/FoundationModels/SystemLanguageModel/availability-swift.property)

The availability of the language model.

[`SystemLanguageModel.Availability`](/documentation/FoundationModels/SystemLanguageModel/Availability-swift.enum)

The availability status for a specific system language model.

### Inspecting model capabilities

[`contextSize`](/documentation/FoundationModels/SystemLanguageModel/contextSize)

The maximum context size in tokens that the model supports.

[`supportedLanguages`](/documentation/FoundationModels/SystemLanguageModel/supportedLanguages)

Languages that the model supports.

[`supportsLocale(_:)`](/documentation/FoundationModels/SystemLanguageModel/supportsLocale(_:))

Returns a Boolean value that indicates whether the given locale is supported by the model.

### Counting tokens

[`tokenCount(for:)`](/documentation/FoundationModels/SystemLanguageModel/tokenCount(for:))

Returns the token count for the specified instructions.

### Handling a language model error

[`SystemLanguageModel.Error`](/documentation/FoundationModels/SystemLanguageModel/Error)

An error specific to the on-device system language model.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)