BudgetTracker¶
gepa.optimize_anything.BudgetTracker(max_evals: int | None = None)
dataclass
¶
Thread-safe, in-process eval-call budget enforcer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_evals
|
int | None
|
Maximum number of evaluation calls allowed. |
None
|
Attributes¶
max_evals: int | None = None
class-attribute
instance-attribute
¶
used: int
property
¶
remaining: int | None
property
¶
exhausted: bool
property
¶
Methods:¶
record(score: float) -> None
¶
Record one eval call. Raises BudgetExhausted if over eval limit.
Source code in gepa/oa/budget.py
check() -> None
¶
Raise BudgetExhausted if the eval budget is used up.