Tool
Context window planner for LLM requests
A request fails, or gets cut off, when its input and reply do not fit the provider's context limit. Lay out what you send, keep room for the answer, and see what is left.
Does not fit
43,471 tokens over
available = 32,768 − 4,000 reply − 1,639 margin = 27,129 spare = 27,129 − 70,600 = -43,471
Limit published by Featherless, checked 14 November 2026.
Why plan the context
The context limit covers input and output together. If the input leaves too little room, the reply is cut short or the request is rejected; MolochAI, for example, documents a 413 error with the cap when a request is over its limit. The limit that matters is the provider's, which is often lower than the model's configured context: the same Gemma 4 variant is listed with 32,768 tokens at one provider and 64,000 at another, while the base model's configuration allows 262,144.
Caveats
- Token counts depend on the model's tokenizer. Count with the tokenizer of the model you will call, or read
usage.prompt_tokensfrom a real response. - Chat templates add tokens around every message, which is what the margin is for.
- Thinking models spend output tokens on reasoning before the answer, so reserve more than the visible reply.
- Some providers cap output per reply separately from the context; the planner warns when your reservation exceeds a known cap.
Related: token cost calculator, VRAM estimator for long contexts on your own hardware.