get_context_window_limit (models/_defaults.py)

sdk-python · strands-py/src/strands/models/_defaults.py · python · Apache-2.0
ai, AI / Agents

Lookup table and helper for model context window limits across providers, used for LLM configuration.

# Source: https://github.com/strands-agents/harness-sdk | License: Apache-2.0
# Provided via justclaw.it.com; keep this notice with the code.
"""Default model metadata lookup tables.

Provides context window limits for known model IDs across all providers.
Values sourced from provider documentation and
https://github.com/BerriAI/litellm/blob/litellm_internal_staging/model_prices_and_context_window.json

Applied to providers with well-known, fixed model IDs: Bedrock, Anthropic, OpenAI,
OpenAI Responses, Gemini, and Mistral. Providers that use local/custom model IDs
(Ollama, LlamaCpp, SageMaker) or proxy to other providers with their own prefixed
ID format (LiteLLM) are excluded — their context windows depend on deployment config,
not a static table.
"""

import logging
from collections.abc 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key