Thinking Budgets

Configure extended thinking token budgets

The thinking command manages thinking token budgets for complex reasoning.

Quick Start

bash
# Show current thinking budget
praisonai thinking status

Usage

Show Status

bash
praisonai thinking status

Expected Output:

╭─ Thinking Budget ────────────────────────────────────────────────────────────╮
│  Level: medium                                                               │
│  Max Tokens: 8,000                                                           │
│  Adaptive: enabled                                                           │
╰──────────────────────────────────────────────────────────────────────────────╯

Set Budget Level

bash
praisonai thinking set high

Available levels: minimal, low, medium, high, maximum

Use from code / run

For a single invocation without persisting a global default, pass --thinking on praisonai code or praisonai run:

bash
praisonai code --thinking high "Refactor src/utils.py for readability"
praisonai run --thinking medium "Plan a release checklist"

The --thinking flag is applied after the agent is constructed. It takes effect on the very next request whether the LLM instance has been materialised yet or not (fixed in PR #4479).

Diagram

one-off call

every session

Need extended thinking?

–thinking on code/run

praisonai thinking set

off / minimal / low / medium / high

minimal / low / medium / high / maximum

per-invocation, not persisted

persisted to .praison/thinking.json

SurfaceLevelsPersisted?
--thinking on code / runoff, minimal, low, medium, highNo — per invocation
praisonai thinking setminimal, low, medium, high, maximumYes — .praison/thinking.json

Unknown --thinking values fail closed with exit code 1 before any work runs.

Show Usage Stats

bash
praisonai thinking stats

Python API

python
from praisonaiagents.thinking import ThinkingBudget, ThinkingTracker

# Use predefined levels
budget = ThinkingBudget.high()  # 16,000 tokens

# Track usage
tracker = ThinkingTracker()
session = tracker.start_session(budget_tokens=16000)
tracker.end_session(session, tokens_used=12000)

summary = tracker.get_summary()
print(f"Utilization: {summary['average_utilization']:.1%}")

See Also