FoundationModels.Prewarm
------------------------

Prewarm the model.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FoundationModels](component_FoundationModels.md) | [15.5](newinversion155.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "FoundationModels.Prewarm"; FoundationModel { ; Prefix } ) 

**MBS**( **"FoundationModels.Prewarm";** /\* Prewarm the model. \*/  
**$FoundationModel**; /\* The identifier for the model.e.g. $model \*/   
**$Prefix**) /\* Optional; The prefix text. \*/ 

### 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

- [FoundationModels.Release](FoundationModelsRelease.md)
- [FoundationModels.Respond](FoundationModelsRespond.md)

This function checks for a license.

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

  
[FoundationModels.List](FoundationModelsList.md) - [FoundationModels.Release](FoundationModelsRelease.md)

[HTML Version](FoundationModelsPrewarm.shtml)