Llama.ContextAvailable
----------------------

Queries context memory available.

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

MBS( "Llama.ContextAvailable"; LlamaSession ) 

**MBS**( **"Llama.ContextAvailable";** /\* Queries context memory available. \*/  
**$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 available.  
You can specify the context size with the parameters to [Llama.StartContext](LlamaStartContext.md) function.  
### Examples

Query memory used:

 MBS ("[Llama.ContextUsed](LlamaContextUsed.md)"; $$session ) &amp; " of " &amp; MBS ("Llama.ContextAvailable"; $$session )  
<small>  
Example result: 43 of 20480</small>### See also

- [Llama.ContextUsed](LlamaContextUsed.md)
- [Llama.StartContext](LlamaStartContext.md)

This function is free to use.

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

  
[Llama.CloseSampler](LlamaCloseSampler.md) - [Llama.ContextUsed](LlamaContextUsed.md)

[HTML Version](LlamaContextAvailable.shtml)