Skip to main content

Module window_manager

Module window_manager 

Source
Expand description

Context Window Manager Module

Provides dynamic context window management for different LLM models.

§Context Window Strategy

  • For models with context window ≤50k tokens: reserve 20% for output
  • For models with context window >50k tokens: reserve fixed 50k tokens for output

§Features

  • Model-specific context window sizes
  • Token usage tracking (input, output, cache)
  • Usage percentage calculation
  • Near-limit detection

Structs§

ContextWindowManager
Context Window Manager for tracking and managing token usage.

Statics§

MODEL_CONTEXT_WINDOWS
Model context window sizes mapping.