Property ContextSize
ContextSize
Gets or sets the context size for the conversation.
public int ContextSize { get; set; }
Property Value
Examples
Setting a specific context size:
using LMKit.Model;
using LMKit.Agents;
using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);
// Use a larger context for document analysis
var options = new AgentExecutionOptions
{
ContextSize = 8192
};
var result = agent.Run("Analyze this long document...", options);
Remarks
The context size determines how much conversation history and content the model can consider. Set to -1 (default) to let the runtime choose an optimal size based on hardware capabilities and model settings.
Larger context sizes allow for longer conversations but require more memory.