Skip to main content

Context Window Management

Overflow Strategies

When a request exceeds a provider's context window:

StrategyBehavior
route_to_largerRoute to a compliant provider with a larger context window
summarizeSummarize older messages to fit within the window
truncateRemove oldest messages (preserving system prompt)

Configuration

context_management:
strategy: route_to_larger
max_summarization_ratio: 0.5
preserve_system_prompt: true
preserve_last_n_messages: 3

Fail-Closed Behavior

If route_to_larger is configured but no compliant provider has a sufficient context window, the request is rejected — it will not route to a non-compliant provider.