LLM fundamentals

Context window

Also known as LLM context window, Context length

By WeavePublished 2 min read

Definition

A context window is the amount of information a language model can consider within a request and its generation process, usually expressed in tokens. The applicable limits and accounting rules depend on the model and serving interface.

The prompt is more than the latest message

A coding agent may send system instructions, conversation history, file contents, tool definitions, and tool results along with the user's latest question. Those inputs can occupy much more space than the question itself.

The generation budget matters too. Depending on the model and interface, input, output, and reasoning tokens interact with the available limits in different ways. Consult the actual provider documentation when calculating whether a request fits.

A larger window does not solve selection

Suppose an illustrative agent can include an entire repository in a request. That capacity does not establish that every file is relevant or that the model will reliably use a critical detail buried among unrelated material.

Selecting useful context remains important. Retrieved passages, concise tool results, and clear instructions can make a request easier to interpret. Removing information carelessly can also lose an assumption the model needs.

What happens as a conversation grows

An application may reject an oversized request, truncate messages, summarize earlier turns, or compact its working context. These behaviors are application and provider choices, not a universal property of every model.

A summary can preserve the main task while losing exact identifiers or unresolved constraints. When evaluating an agent, include long-running tasks that exercise this behavior. A model that performs well on a fresh conversation may behave differently after many tool calls and context-management steps.

How this relates to Weave

Context requirements help determine which models are suitable for a routed request. Weave Router's role is model selection within agent work, so a meaningful evaluation should include long-context turns as well as short prompts. Check the current model and provider limits instead of assuming every routing candidate accepts the same request.

Explore Router

Sources and further reading

  1. Context windows, Claude Platform Docs