Skip to main content

should_compact

Function should_compact 

Source
pub fn should_compact(
    history: &[ChatMessage],
    context_length: usize,
    vram_ratio: f64,
) -> bool
Expand description

Returns true when history is large enough to warrant compaction. Pass the model’s context_length and current vram_ratio for adaptive thresholds.