MV

Context Window

The context window is the maximum number of tokens a model can process during generation, including input and output.

A token is a unit of text or other data processed by the model—not necessarily a whole word.

  • Input tokens — Information provided to the model, including instructions, messages, and tool interactions.
  • Output tokens — Tokens generated by the model, including reasoning tokens where applicable.

Input and output must fit within the context window; models may also have a separate output limit.

Diagram of a context window across three turns. Each turn's input includes the previous turn's input and output. In turn 3, reasoning and part of the output fit inside the window, and the rest is truncated.

When the limit is exceeded, the system may truncate context, removing information to make room, or reject the request. Losing earlier instructions or details can cause the model to repeat actions, miss requirements, or produce inconsistent answers.

Back to the glossary

Newsletter

Get new glossary entries and AI system patterns in your inbox.