Context Window
The token budget available for a model request
What is a context window in a language model?
A context window limits the tokens a model can process within a request. Instructions, earlier messages and material supplied by an app take up space. When input and output share a window, the model also needs room to generate its response.
How it works
Calculator
Allocate a context budget
Calculate remaining space within a shared input/output limit. Input includes instructions, conversation, documents and tool results. The starting values are an editable sample; providers may apply additional limits.
- Input + reservation
- 10,000
- Remaining capacity
- 0
| Category | Tokens |
|---|---|
| Capacity | 10,000 |
| Input + reserve | 10,000 |
View inputs and results
| Item | Value |
|---|---|
| Shared capacity · tokens | 10,000 |
| Total input · tokens | 8,000 |
| Output reservation · tokens | 2,000 |
| Input + reservation | 10,000 |
| Remaining capacity | 0 |
| Allocated percentage | 100% |
Remaining = capacity − input − output reservation. The reservation is space planned for a response. This calculator uses the supplied counts; it does not tokenize text or check a real model’s limits.
Reference: Anthropic: context windows
Key takeaways
-
Budget instructions, documents, tools, history, and output.
-
Check exact model limits and application truncation rules.
Illustrative example
A support assistant has 8,000 input tokens in a shared window of 10,000. It reserves 1,500 for its answer, leaving 500 for more input. Fetching a 900-token manual page would put the request 400 over budget. Sending the relevant 200-token paragraph instead leaves 300 tokens free and keeps the full answer allowance.
Why can a chat lose track of an earlier message?
A chat can show the full transcript while the app sends a shorter history to the model. If a customer changed a delivery address and the app kept only an earlier summary, the model may see the old address. Check which address appears in the messages or retrieved records for that turn. If both versions are present, make the correction and its date explicit.
How much of the context window is left for the answer?
For a shared window, subtract the full input count from the window size. Then check the model’s separate output limit. With 8,000 input tokens in a 10,000-token window, there is room for 2,000 more tokens. If the model caps output at 1,500, that smaller limit sets the longest possible generation. A model that counts reasoning within its output budget can return a shorter visible answer.