Glossary
Context window — Glossary
The maximum number of tokens a model can consider in one request, including instructions, history, and retrieved text.
Full definition
A context window is the working memory budget of a language model measured in tokens. Everything the model can “see” for a completion—system prompts, chat history, tool results, and retrieved chunks—must fit inside that budget.
Larger windows enable longer documents in a single call but raise cost and can introduce noise if irrelevant text dilutes attention. Many applications therefore combine moderate context with retrieval-augmented generation.
Always count tokens with the model’s tokenizer. Word counts are unreliable across languages and code.