Completion Length Predictor

Estimate how many tokens an LLM will generate for your prompt

Uses task-type patterns and prompt signals to estimate output token length, so you can budget cost accurately instead of always assuming max_tokens. Shows a likely range and the cost of the completion. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How can output length be predicted before generation?

It cannot be predicted exactly, but task type is a strong signal: summaries compress input, Q&A produces short answers, code and essays expand. The tool combines the task profile with cues in your prompt (explicit length requests, input size) to estimate a realistic range rather than a single number.

Completion length predictor

Output tokens usually cost more than input tokens, and they are the part you cannot see until after you pay for them. Always budgeting at max_tokens overstates your bill; ignoring output entirely understates it. This predictor reads your prompt and task type to estimate a realistic output length and cost, so your projections sit close to reality.

How it works

Each task type carries a characteristic output profile: summaries shrink the input, Q&A answers are short, code and long-form writing expand well beyond the prompt. The tool starts from the task profile, then adjusts using signals in your prompt — input length, and any explicit length instruction like “in one paragraph” or “list ten items.” It returns a low, expected, and high token estimate and prices the expected completion against your model’s output rate. Everything runs in your browser.

Typical output ranges by task type

Task typeTypical output (tokens)What drives length
Short Q&A20 – 150Answer complexity
Summarisation10 – 30% of inputCompression ratio
Classification / sentiment5 – 30One label or short explanation
Code generation100 – 2,000+Problem size, language verbosity
Essay / long-form writing500 – 4,000Topic breadth, word count instruction
Chain-of-thought reasoning300 – 1,500Problem depth
Structured data extraction50 – 500Number of fields

These are rough guides. Real output depends on the specific model, the content of the prompt, and any length instructions you include.

How output cost compounds

On many tasks, output tokens cost significantly more per token than input tokens. For a model with a 5:1 output-to-input cost ratio, a 10,000-token input costs the same as a 2,000-token output. On chat and code tasks where output is substantial and repeated across many calls, the output cost can dominate the total bill — which is exactly why this estimate matters more than input counting for those workloads.

For example, a customer-support system making 10,000 calls per day where average output is 300 tokens (not 1,000 at max_tokens) saves the difference between budgeting 10M tokens of output versus 3M. At typical rates, that gap is significant enough to change which model tier is viable.

Tips and notes

The single biggest accuracy gain is telling the model how long to be — “answer in two sentences” both shortens output and makes it predictable. Use the high estimate to set a sensible max_tokens cap and the expected estimate for cost budgeting; they serve different purposes. Output cost often dominates total cost on generative tasks, so this estimate matters more than input counting for chat and code workloads. Measure your real completions over a few hundred calls and adjust your assumptions — nothing beats your own data for refining the forecast.