Table of Contents

Property MaximumContextLength

Namespace
LMKit.Extraction
Assembly
LM-Kit.NET.dll

MaximumContextLength

Gets or sets the maximum context length (in tokens) allowed for the language model during splitting.

public int MaximumContextLength { get; set; }

Property Value

int

An int representing the maximum number of tokens the LM is permitted to handle.

Examples

// Load a vision-capable model (8B or larger recommended)
LM model = LM.LoadFromModelID("qwen3-vl:8b");

var splitter = new DocumentSplitting(model);

// Override the default context length for large documents
splitter.MaximumContextLength = 8192;

DocumentSplittingResult result = splitter.Split(new Attachment("large_batch.pdf"));
Console.WriteLine($"Found {result.DocumentCount} document(s)");

Remarks

By default, this value is automatically determined at runtime based on hardware capabilities and the model's constraints. When assigned, the value is clamped between MinContextSize and the model's maximum context length.