Derives the USD cost of an eval run from its token usage.
An eval run has two priced components — the agent under test and the LLM
judge — each with its own token usage and (possibly different) model. This
module resolves each model URI to the id SkillKit.LLM.Pricing keys on,
prices each component, and combines them.
A component with no tokens is free regardless of its model, so a skipped
judge never makes a run unpriceable. A component with real usage on a model
with no known rate is genuinely unknown, so total/1 reports nil rather
than an understated figure.
Summary
Functions
Renders a cost as a dollar amount, or "cost unknown" for nil.
Prices usage at model's rate. Returns 0.0 for zero usage, the USD cost
for a model with a known rate, or nil when a non-empty usage has no rate.
Sums the cost of each {usage, model} component. Returns nil when any
component with real usage can't be priced.
Types
@type component() :: {SkillKit.Eval.Transcript.usage(), String.t() | nil}
Functions
Renders a cost as a dollar amount, or "cost unknown" for nil.
@spec price(SkillKit.Eval.Transcript.usage(), String.t() | nil) :: float() | nil
Prices usage at model's rate. Returns 0.0 for zero usage, the USD cost
for a model with a known rate, or nil when a non-empty usage has no rate.
Sums the cost of each {usage, model} component. Returns nil when any
component with real usage can't be priced.