Portable aggregate budget owned by an Instance for one logical inference.
Reservations happen before dispatch and settlements are keyed by attempt id, making duplicate terminal receipts idempotent. Ambiguous attempts retain their reservation until a reconciliation result is committed.
Summary
Types
@type t() :: %Spectre.Inference.Budget{ consumed: Spectre.Inference.Usage.t(), deadline_at: integer() | nil, estimation_policy: :provider | :conservative | :unavailable, inference_id: String.t(), limits: map(), pricing_ref: String.t() | nil, reservations: %{optional(String.t()) => Spectre.Inference.Usage.t()}, settlements: %{optional(String.t()) => map()} }
Functions
@spec reserve(t(), String.t(), Spectre.Inference.Usage.t() | map() | keyword()) :: {:ok, t(), Spectre.Inference.BudgetSnapshot.t()} | {:error, term()}