pub struct ModelPricing {
pub input_per_mtok: f64,
pub output_per_mtok: f64,
pub cache_write_per_mtok: f64,
pub cache_read_per_mtok: f64,
}Fields§
§input_per_mtok: f64§output_per_mtok: f64§cache_write_per_mtok: f64§cache_read_per_mtok: f64Implementations§
Source§impl ModelPricing
impl ModelPricing
Sourcepub fn for_model(model: Option<&str>) -> Self
pub fn for_model(model: Option<&str>) -> Self
Per-million-token pricing for a model id.
Missing/empty model ids preserve the historical Claude Sonnet fallback
for old Claude transcripts that did not record a model. Non-empty model
ids are only priced when we recognize a priced family. Unknown, local,
and open-weight models are treated as free unless the provider supplied
an embedded cost (see ModelSessionStats::embedded_cost). This avoids
fabricating Sonnet charges for Ollama/MLX/vLLM/OpenRouter-style models.
Auto Trait Implementations§
impl Freeze for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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