Skip to main content

scale_budget

Function scale_budget 

Source
pub fn scale_budget(
    base_budget: usize,
    compaction_count: Option<i64>,
    config: &InjectionConfig,
) -> usize
Expand description

Compute the effective token budget based on compaction depth.

Formula: base_budget * (1 + (compaction_count - 1) * escalation_factor) Clamped to max_budget_cap if set.

compaction_count of 0 or None is treated as 1 (no scaling).