Skip to main content

strategy_for_model

Function strategy_for_model 

Source
pub fn strategy_for_model(effective_context_tokens: u32) -> ContextStrategy
Expand description

Choose a context strategy tuned to a model’s effective context window (CH-05, fable §13). Larger-context models get a proportionally larger sliding window before summarisation kicks in; small-context models summarise sooner. effective_context_tokens should be the usable window (typically 50-80% of advertised), not the advertised maximum.

This is the per-model selection layer; the chosen strategy is then applied by apply_strategy. Placement (lost-in-the-middle mitigation) is handled by keep_first_last.