# `Imp.Optimizer.Budget`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/optimizer/budget.ex#L1)

Prospective request, token, and cost limits for live optimizer work.

A budget reserves the worst-case input, output, and price envelope before an
LM request begins, records provider-reported usage, and exposes a portable
snapshot suitable for an experiment Result or Artifact. Resuming from a
snapshot conservatively charges unresolved reservations once, so a crash
cannot silently restore spend capacity.

Use `Imp.budgeted_lm/3` to wrap every task and proposal LM participating in
the workflow. The wrapper disables hidden transport retries, counts the
actual Req transport attempt, and records provider telemetry in the calling
process, keeping a logical request from escaping the declared ceilings.

# `limit`

```elixir
@type limit() :: non_neg_integer() | number() | :infinity
```

# `attach_req_llm`

# `authorize_transport_attempt`

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `record_usage`

# `release`

# `reserve`

# `snapshot`

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
