Skip to main content

context_window_for_model

Function context_window_for_model 

Source
pub fn context_window_for_model(model: &str) -> usize
Expand description

Return the context window size (in tokens) for known models.

Uses case-insensitive substring matching against the model identifier. Returns 128 000 for unknown models (conservative for most modern LLMs).