Llama.Detokenize
----------------

Convert the provided tokens into text (inverse of llama\_tokenize()).

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

MBS( "Llama.Detokenize"; LlamaSession; Tokens { ; remove special; unparse special } ) 

**MBS**( **"Llama.Detokenize";** /\* Convert the provided tokens into text (inverse of llama\_tokenize()). \*/  
**$LlamaSession**; /\* The session identifier.e.g. $$session \*/   
**$Tokens**; /\* A JSON array with numbers.  
The token values depend on the model.e.g. \[234\] \*/   
**$remove special**; /\* Optional; Allow to remove BOS and EOS tokens if model is configured to do so.  
Pass 1 to allow or 0 to disallow.  
Default is 1.e.g. 1 \*/   
**$unparse special**) /\* Optional; If true, special tokens are rendered in the output.  
Pass 1 to allow or 0 to disallow.  
Default is 1.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| LlamaSession | The session identifier. | $$session |  |
| Tokens | A JSON array with numbers.   The token values depend on the model. | \[234\] |  |
| remove special | Allow to remove BOS and EOS tokens if model is configured to do so.   Pass 1 to allow or 0 to disallow.   Default is 1. | 1 | Optional |
| unparse special | If true, special tokens are rendered in the output.   Pass 1 to allow or 0 to disallow.   Default is 1. | 1 | Optional |

### Result

Returns OK or error.

### Description

Convert the provided tokens into text (inverse of llama\_tokenize()).  
### See also

- [Llama.Tokenize](LlamaTokenize.md)

### Release notes

- **Version 16.3**
    - Fixed memory leaks in Llama.Tokenize and Llama.Detokenize functions.

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr1](https://www.mbsplugins.de/archive/2026-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

Created 10th February 2026 , last changed 10th February 2026

  
[Llama.ContextUsed](LlamaContextUsed.md) - [Llama.InitSampler](LlamaInitSampler.md)

[HTML Version](LlamaDetokenize.shtml)