Platforms to show: All Mac Windows Linux Cross-Platform
LlamaModelMBS class
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| class | Llama | MBS Tools Plugin | 25.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
- 22 properties
- property ClassifierOutputs as Integer
- property ctx_train as Integer
- property Description as String
- property embd as Integer
- property embd_inp as Integer New in 26.1
- property embd_out as Integer New in 26.1
- property Handle as Integer
- property HasDecoder as Boolean
- property HasEncoder as Boolean
- property head as Integer
- property head_kv as Integer
- property IsDiffusion as Boolean
- property IsHybrid as Boolean
- property IsRecurrent as Boolean
- property layer as Integer
- property Meta as Dictionary
- property MetaCount as Integer
- property ParameterCount as Integer
- property RopeType as Integer
- property Size as Integer
- property swa as Integer
- property Vocab as LlamaVocabMBS
- 12 methods
- method ChatTemplate(Name as String) as String
- method ClassifierOutputLabel(index as integer) as String
- method Constructor Private
- method Constructor(File as FolderItem, Parameters as LlamaModelParametersMBS = nil)
- method Constructor(Path as String, Parameters as LlamaModelParametersMBS = nil)
- method DecoderStartToken as Int32
- method Destructor
- method MetaKey(Index as Integer) as String
- method MetaValue(Index as Integer) as String
- method MetaValue(Key as String) as String
- method SaveToFile(File as FolderItem)
- method SaveToFile(Path as String)
- shared method MetaKeyName(Key as Integer) as String New in 26.1
- 17 constants
Metadata Key Names
| Constant | Value | Description |
|---|---|---|
| MetaKeySamplingMinP | 3 |
Sets a minimum probability threshold relative to the most likely token. Tokens with probability lower than min_p * max_probability are excluded, filtering out extremely unlikely choices. |
| MetaKeySamplingMirostat | 9 |
Enables Mirostat adaptive sampling, which dynamically adjusts randomness to maintain a target entropy level. Useful for keeping generation coherent while avoiding collapse or runaway randomness. |
| MetaKeySamplingMirostatEta | 11 |
Controls the learning rate (η) for Mirostat’s entropy adjustment. Higher values react faster to entropy changes but may cause instability. |
| MetaKeySamplingMirostatTau | 10 |
Sets the target entropy (τ) for Mirostat sampling. Lower values aim for more focused text; higher values allow more creative variation. |
| MetaKeySamplingPenaltyLastN | 7 |
Specifies the number of recent tokens to consider when applying repetition penalties. Only tokens within this sliding window are penalized. |
| MetaKeySamplingPenaltyRepeat | 8 |
Defines the strength of the repetition penalty applied to previously generated tokens. Higher values more aggressively discourage repeated words or phrases. |
| MetaKeySamplingSequence | 0 |
Defines the order in which sampling strategies are applied when generating tokens (e.g., top-k → top-p → temperature). This allows fine-grained control over how multiple sampling filters are composed. |
| MetaKeySamplingTemp | 6 |
Applies temperature scaling to logits before sampling. Values < 1.0 make outputs more deterministic; values > 1.0 increase randomness. |
| MetaKeySamplingTopK | 1 |
Limits token selection to the K most probable tokens at each step. Lower values reduce randomness and increase determinism; higher values allow more diverse outputs. |
| MetaKeySamplingTopP | 2 |
Enables nucleus sampling, where tokens are selected from the smallest set whose cumulative probability is ≥ P. This dynamically adapts the candidate set size based on confidence. |
| MetaKeySamplingXtcProbability | 4 |
Controls the probability of applying XTC (eXtended Token Control) sampling during generation. Used to intermittently introduce stronger randomness or exploration behavior. |
| MetaKeySamplingXtcThreshold | 5 |
Defines the entropy or confidence threshold at which XTC sampling activates. XTC is only applied when the token distribution meets this threshold condition. |
Rope Type
| Constant | Value | Description |
|---|---|---|
| RopeTypeMrope | 8 |
Modified RoPE used for supporting longer context lengths (like in LLaMA 2 64k or LLaMA 3). |
| RopeTypeNeox | 2 |
GPT-NeoX style RoPE, which can differ in frequency base or application. |
| RopeTypeNone | -1 |
Indicates that no RoPE is applied or is unsupported. Often used as a default or error state. |
| RopeTypeNorm | 0 |
The standard Rotary Positional Embedding (used in original LLaMA models). |
| RopeTypeVision | 24 |
RoPE adapted for vision models (e.g., LLaVA or CLIP-like models). |
This class has no sub classes.
Blog Entries
- Use Llama.cpp in Xojo
- MBS Xojo Plugins, version 26.1pr3
- Using llama.cpp in Xojo
- MonkeyBread Software Releases the MBS Xojo Plugins in version 25.5
Xojo Developer Magazine
Release notes
- Version 26.1
- Added embd_out and embd_inp to LlamaModelMBS class.
- Added MetaKeyName function and related constants to LlamaModelMBS class.
Some methods using this class:
- LlamaContextMBS.Constructor(Model as LlamaModelMBS, Parameters as LlamaContextParametersMBS = nil)
Some properties using for this class:
- LlamaContextMBS.Model as LlamaModelMBS
Some related classes:
- class LlamaContextMBS
- class LlamaContextParametersMBS
- class LlamaModelParametersMBS
- class LlamaVocabMBS
The items on this page are in the following plugins: MBS Tools Plugin.
LlamaExceptionMBS - LlamaModelParametersMBS