Llama.InitSampler
-----------------

Initializes the sampler chain.

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

MBS( "Llama.InitSampler"; LlamaSession; Configuration ) 

**MBS**( **"Llama.InitSampler";** /\* Initializes the sampler chain. \*/  
**$LlamaSession**; /\* The session identifier.e.g. $$session \*/   
**$Configuration**) /\* The JSON array with the sampler objects. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| LlamaSession | The session identifier. | $$session |
| Configuration | The JSON array with the sampler objects. |  |

### Result

Returns OK or error.

### Description

Initializes the sampler chain.  
Please pass a JSON array with objects. Each object has an entry "sampler" naming one of the samplers to use.  
  
greedy  
  
dist  
seed: optional parameter with seed.  
  
top\_k  
k  
  
top\_p  
p: e.g. 0.8  
min\_keep: e.g. 1  
  
min\_p  
p: e.g. 0.8  
min\_keep: e.g. 1  
  
typical  
p: e.g. 0.8  
min\_keep: e.g. 1  
  
temp  
t: e.g. 0.8  
  
temp\_ext  
t:  
delta:  
exponent:  
  
top\_n\_sigma  
t:  
  
xtc  
p:  
t:  
min\_keep  
seed:  
  
mirostat  
n\_vocab:   
seed: optional  
tau:  
eta:  
  
mirostat\_v2  
seed: optional  
tau:  
eta:  
  
### Examples

Init the sampler:

 Set Variable \[ $r ; Value: MBS (  
 "Llama.InitSampler" ;  
 $$session ;  
 JSONSetElement(  
 "\[\]" ;  
 \[ "\[+\].sampler" ; "min\_p" ; JSONString \] ;  
 \[ "\[:\].p" ; ,8 ; JSONNumber \] ;  
 \[ "\[:\].min\_keep" ; 1 ; JSONNumber \] ;  
 \[ "\[+\].sampler" ; "temp" ; JSONString \] ;  
 \[ "\[:\].t" ; ,8 ; JSONNumber \] ;  
 \[ "\[+\].sampler" ; "dist" ; JSONString \])  
)\]  
### See also

- [Llama.CloseSampler](LlamaCloseSampler.md)

### Example Databases

- [Llama chat](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Llama%20chat.shtml#10ScriptAnchor_)

### Blog Entries

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

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

  
[Llama.Detokenize](LlamaDetokenize.md) - [Llama.List](LlamaList.md)

[HTML Version](LlamaInitSampler.shtml)