Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

FoundationModels.Prewarm

Prewarm the model.

Component Version macOS Windows Linux Server iOS SDK
FoundationModels 15.5 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "FoundationModels.Prewarm"; FoundationModel { ; Prefix } )   More

Parameters

Parameter Description Example Flags
FoundationModel The identifier for the model. $model
Prefix The prefix text. Optional

Result

Returns OK or error.

Description

Prewarm the model.
Requests that the system eagerly load the resources required for this session into memory and optionally caches a prefix of your prompt.

This method can be useful in cases where you have a strong signal that the user will interact with session within a few seconds. For example, you might call prewarm when the user begins typing into a text field.

If you know a prefix for the future prompt, passing it to prewarm will allow the system to process the prompt eagerly and reduce latency for the future request.

Important: You should only use prewarm when you have a window of at least 1s before the call to respond.

Note: Calling this method does not guarantee that the system loads your assets immediately, particularly if your app is running in the background or the system is under load.

See also

This function checks for a license.

Created 26th September 2025, last changed 27th September 2025


FoundationModels.List - FoundationModels.Release