# Generation limits (llmcpp) **Generation limits** bound the effort spent implementing one body. The numbered examples give a score-counting function two rejected submissions and a 120-second deadline: ```cpp __llm__(max_attempts(2), timeout(120)) int passing(const std::vector &scores) { Count scores greater than or equal to 60. } ``` These function settings override the corresponding driver defaults. A failed `submit` consumes an attempt; a failed `try_compile` uses a tool call but not a submission attempt. Other limits cap compiler-tool calls and tokens per model response. Supported settings are passed with the task, and the compiler enforces its budgets. The bundled CLI adapters reject explicit output-token limits they cannot enforce. Limits control build cost and duration; they do not establish correctness. Source: [17_generation_limits.cpp](https://github.com/yanevskiv/llmcpp/blob/main/examples/17_generation_limits.cpp).