Skip to main content

context_limit

Function context_limit 

Source
pub fn context_limit(provider: &str, model: &str) -> Option<u64>
Expand description

The agent-usable models a provider serves per models.dev, mapped to ModelChoice and sorted by id for a stable picker order. Empty when the models-dev feature is off, the catalog can’t be fetched, or the provider is unknown — so a caller can fall back to its own static list. A model’s context window from the catalog, when it lists one.

The only cross-provider source: a hosted endpoint publishes its window in a shape of its own or not at all, so without this a hosted run has no window and profile selection has one less fact to work with.