Llama.ContextUsed
-----------------

Queries context memory used.

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

MBS( "Llama.ContextUsed"; LlamaSession ) 

**MBS**( **"Llama.ContextUsed";** /\* Queries context memory used. \*/  
**$LlamaSession**) /\* The session identifier.e.g. $$session \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| LlamaSession | The session identifier. | $$session |

### Result

Returns number or error.

### Description

Queries context memory used.  
### Examples

Query memory used:

 MBS ("Llama.ContextUsed"; $$session ) &amp; " of " &amp; MBS ("[Llama.ContextAvailable](LlamaContextAvailable.md)"; $$session )  
### See also

- [Llama.ContextAvailable](LlamaContextAvailable.md)

This function is free to use.

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

  
[Llama.ContextAvailable](LlamaContextAvailable.md) - [Llama.Detokenize](LlamaDetokenize.md)

[HTML Version](LlamaContextUsed.shtml)