Module token_budget

Module token_budget 

Source
Expand description

Token budget management for context engineering

This module implements token counting and budget tracking to manage the attention budget of LLMs. Following Anthropic’s context engineering principles, it helps prevent context rot by tracking token usage and triggering compaction when thresholds are exceeded.

Structs§

TokenBudgetConfig
Token budget configuration
TokenBudgetManager
Token budget manager
TokenUsageStats
Token usage statistics

Enums§

ContextComponent
Component types for detailed tracking