Control how long Gemma 4 thinks
prompting & control tokens
// what it does
A reasoning pass can run 4,000+ tokens before the final answer, so raise max_new_tokens / max_tokens well above your answer length or the response gets cut off mid-thought. Steer the depth from the system prompt — for example "<|think|> Think briefly and focus on key steps" — to trade thoroughness for speed. Harder tasks (competition math, debugging) reward a larger budget.
// shell
$ llama-cli -hf ggml-org/gemma-4-E4B-it-GGUF -sys "<|think|>Think briefly, focus on key steps." -n 2048 -p "Is 2027 prime?"// gotcha
If the token limit is too low with thinking on, the model spends its whole budget reasoning and returns an empty or truncated final answer. Budget for the thought plus the answer, not just the answer.