Expand description
BP-7 (catalog §4a “Turn/budget caps” — the spend cap; “Per-turn cost/usage accounting” — the cost half): token→dollars on the request path.
Until BP-7 the only pricing in the workspace was
crate::pricing_ref, whose own module doc says it is “not used
anywhere on the request path” — which is exactly why the ledger’s
turn-budget-caps row read “no spend/budget cap at all — no pricing
exists on the request path”. This module is that missing piece, and
nothing more: a per-million-token price pair for a model id, resolved
from (1) the config’s explicit override
(crate::Config::price_input_per_mtok /
crate::Config::price_output_per_mtok) or (2) a small built-in table
of published list prices for the model families the parity presets pin.
Deliberately fails closed. resolve returns None for a model it
cannot price rather than guessing, and crate::Agent::new refuses to
build an agent that arms core.max_budget_usd against an unpriceable
model. A spend cap that silently never bites is worse than no cap: the
caller believes they are protected.
Structs§
- Model
Price - Per-million-token prices for one model, in US dollars.