Platforms to show: All Mac Windows Linux Cross-Platform
SystemLanguageModelsMBS class
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| class | Foundation Models | MBS Swift Plugin | 25.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
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 UseCase to perform tasks like UseCase contentTagging.
Verify the model availability before you use the model. Model availability depends on device factors like:
- The device must support Apple Intelligence.
- Apple Intelligence must be turned on in Settings.
- 3 properties
- property Available as Boolean
- property Handle as Integer
- property UnavailableReason as Integer
- 4 methods
- method Constructor
- method Constructor(UseCase as Integer, Guardrails as Integer)
- method supportedLanguages as String()
- method supportsLocale(localeIdentifier as String) as Boolean
- 2 shared methods
- 8 constants
Guardrails
| Constant | Value | Description |
|---|---|---|
| GuardrailsDefault | 0 |
Default guardrails. This mode ensures that unsafe content in prompts and responses will be blocked with a `LanguageModelSession.GenerationError.guardrailViolation` error. |
| GuardrailsPermissiveContentTransformations | 1 | Guardrails that allow for permissively transforming text input, including potentially unsafe content, to text responses, such as summarizing an article. more |
Unavailable Reason
| Constant | Value | Description |
|---|---|---|
| UnavailableReasonAppleIntelligenceNotEnabled | 2 |
Apple Intelligence is not enabled on the system. |
| UnavailableReasonAvailable | 1 |
The model is available. |
| UnavailableReasonDeviceNotEligible | 4 |
The device does not support Apple Intelligence. |
| UnavailableReasonModelNotReady | 3 |
The model(s) aren't available on the user's device. Models are downloaded automatically based on factors like network status, battery level, and system load. |
Use Case
| Constant | Value | Description |
|---|---|---|
| UseCaseContentTagging | 1 |
A use case for content tagging. |
| UseCaseGeneral | 0 |
A use case for general prompting. |
This class has no sub classes.
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 25.5
- Use Foundation Models in Xojo
- MBS Xojo Plugins, version 25.5pr1
Release notes
- Version 25.5
- Added FoundationModels classes for using Apple LLM. See LanguageModelSessionsMBS, SystemLanguageModelsMBS and others.
Some methods using this class:
- LanguageModelSessionsMBS.Constructor(Model as SystemLanguageModelsMBS = nil, Instructions as InstructionsMBS)
- LanguageModelSessionsMBS.Constructor(Model as SystemLanguageModelsMBS = nil, Instructions as String)
- LanguageModelSessionsMBS.Constructor(Model as SystemLanguageModelsMBS = nil, Transcript as TranscriptMBS)
Some properties using for this class:
- LanguageModelSessionsMBS.SystemLanguageModel as SystemLanguageModelsMBS
Some related classes:
The items on this page are in the following plugins: MBS Swift Plugin.
SystemConfigurationMBS - TabPanel