Skip to content
BENIBIX Learn

Max Tokens

AI💬 LLMsText Generation

Also known as Maximum Output Tokens, max_tokens, Output Token Limit

The most tokens a model may write in one reply. It stops at the cap.

Think of it like

Think of it like a friend who can only talk till the bell rings.

Example

Lucy sets max tokens to 100 and asks for a full report. The answer stops after about 75 words, mid-sentence.

Why it matters

Output tokens cost money and time. The cap keeps both under control.

Definition

Max tokens is a setting that caps how many tokens a model may write in one reply. When the reply hits the cap, it stops, even mid-sentence. It guards you from long, costly answers and from runs that never end. The cap counts only the output. But the input and output together must still fit in the context window.
In the top row, the reply hits the token cap and is cut off mid-sentence.

Common mistake

Setting it too low and thinking the model gave up. A reply cut at the cap ends mid-thought; check the stop reason the tool reports.

Key takeaways

  1. 1
    Caps the reply. Counted in tokens.
  2. 2
    Stops hard. Even mid-sentence.
  3. 3
    Saves cost. No runaway answers.

Compare

Learn it properly