Guides

Choosing a context window

Match token capacity to your task instead of choosing the largest advertised number.

Separate context from output

A context window describes the token capacity available for a request; maximum output is a separate limit on generated tokens. Plan for input plus output within the applicable context budget, while also respecting the output cap. System instructions, conversation history, retrieved passages, and tool results can all consume input space. Verify the selected endpoint’s limits.

Retrieve what matters

More capacity does not guarantee that every relevant detail will be used correctly. For a large document collection, consider retrieving relevant passages rather than sending everything every time. Preserve useful source references and enough surrounding text to interpret them. Measure whether retrieval misses needed evidence or introduces irrelevant material before relying on it.

Leave room and test failures

Reserve space for the expected answer and allow for variation in token counts. Test representative short and long requests, including information near the beginning, middle, and end. Check answer quality, latency, cost, truncation, and limit errors. Choose a window that reliably fits your workflow, and define how to shorten, split, or retry an oversized request.

Source

All model comparisons →