Tokens and context windows
Budget for the actual tokenizer, input content and response allowance.
How to use it
- A token is a model's processing unit and may represent a word fragment, punctuation or other content. Different languages and tokenizers produce different counts for similar-looking text.
- The context limit and maximum output limit are separate constraints. Count instructions, history, tool definitions and attachments according to the selected model's rules.
- Measure real requests with the provider's counter or usage report. Reserve enough output space for the task and monitor truncation rather than estimating solely from word count.
Prompt template
Plan the input for {{task}} under {{context_limit}} and {{output_limit}}. Identify essential source material, removable repetition and the required response size. Estimate with the actual tokenizer and report assumptions for files, images and tool overhead.Check the result
- Compare estimates with measured usage on a representative request.
- Check the termination reason and whether the response was truncated.
Common mistakes
- Do not use one language's words-per-token estimate as a universal rule for all locales and media.