Llama.ModelChatTemplate
-----------------------

Queries the chat template text for the model.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Llama](component_Llama.md) | [16.1](newinversion161.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Llama.ModelChatTemplate"; LlamaSession; TemplateName ) 

**MBS**( **"Llama.ModelChatTemplate";** /\* Queries the chat template text for the model. \*/  
**$LlamaSession**; /\* The session identifier.e.g. $$session \*/   
**$TemplateName**) /\* The chat template name.  
Default is "" to pick the default template.e.g. "chatml" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| LlamaSession | The session identifier. | $$session |
| TemplateName | The chat template name.   Default is "" to pick the default template. | "chatml" |

### Result

Returns text or error.

### Description

Queries the chat template text for the model.  
Returns empty text is template isn't available for the mode.  
### Blog Entries

- [Use Llama.cpp in FileMaker](https://www.mbsplugins.de/archive/2026-02-17/Use_Llamacpp_in_FileMaker/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 12nd February 2026 , last changed 12nd February 2026

  
[Llama.Loaded](LlamaLoaded.md) - [Llama.ModelMetadata](LlamaModelMetadata.md)

[HTML Version](LlamaModelChatTemplate.shtml)