pub struct ModelCost {
pub input_per_mtok: f64,
pub output_per_mtok: f64,
pub cache_read_per_mtok: Option<f64>,
}Expand description
Per-token pricing for a model, so a run can attach an estimated cost to
crate::RunEvent::Usage. Register with
OpenHarness::with_model_cost. Rates are USD per million tokens.
Fields§
§input_per_mtok: f64USD per million input (prompt) tokens.
output_per_mtok: f64USD per million output (completion) tokens.
cache_read_per_mtok: Option<f64>USD per million cache-read tokens (often ~0.1x input); None falls back
to the input rate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelCost
impl RefUnwindSafe for ModelCost
impl Send for ModelCost
impl Sync for ModelCost
impl Unpin for ModelCost
impl UnsafeUnpin for ModelCost
impl UnwindSafe for ModelCost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more