jeevesagent.governance.budget

Token / call / cost budgets.

StandardBudget enforces hard limits on tokens, cost, and wall clock; emits a soft warning at a configurable threshold. NoBudget is the always-allow stub used when the user has opted out of governance entirely.

Classes

BudgetConfig

NoBudget

Never blocks, never warns.

StandardBudget

Hard-limited, thread-safe budget tracker.

Module Contents

class jeevesagent.governance.budget.BudgetConfig[source]
max_cost_usd: float | None = None
max_input_tokens: int | None = None
max_output_tokens: int | None = None
max_tokens: int | None = None
max_wall_clock: datetime.timedelta | None = None
soft_warning_at: float = 0.8
class jeevesagent.governance.budget.NoBudget[source]

Never blocks, never warns.

async allows_step() jeevesagent.core.types.BudgetStatus[source]
async consume(*, tokens_in: int, tokens_out: int, cost_usd: float) None[source]
class jeevesagent.governance.budget.StandardBudget(cfg: BudgetConfig | None = None)[source]

Hard-limited, thread-safe budget tracker.

async allows_step() jeevesagent.core.types.BudgetStatus[source]
async consume(*, tokens_in: int, tokens_out: int, cost_usd: float) None[source]