1. Enter the context window
Use the maximum context supported by the selected model and API configuration.
2. Add fixed and query tokens
Include system instructions, tool definitions, examples, conversation history, and the expected user query.
3. Describe retrieval payload
Enter the number of chunks and average content plus metadata tokens per chunk.
4. Reserve output capacity
Keep enough tokens for the response rather than allowing retrieved context to consume the entire window.
5. Apply a safety margin
Use margin for tokenizer variation and longer-than-average chunks, then review remaining capacity and maximum chunks.