Cannot find 'SystemLanguageModel' in scope

Hi everyone,

I am using Xcode 16.4 in MacOS Sequoia 15.5 with Apple Intelligence turned on.

The following code gives the error message in the title:

import NaturalLanguage

@available(iOS 18.0, *)
func testSystemModel() {
    let model = SystemLanguageModel.default
    print(model)
}

What am I missing?

Answered by DTS Engineer in 844867022

To make it work, use Xcode 26 and import the right framework:

import FoundationModels

Also, unless you run your app on an iOS / iPad / visionOS 26 device, you will need macOS 26, as discussed in this post.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Accepted Answer

To make it work, use Xcode 26 and import the right framework:

import FoundationModels

Also, unless you run your app on an iOS / iPad / visionOS 26 device, you will need macOS 26, as discussed in this post.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Cannot find 'SystemLanguageModel' in scope
 
 
Q