pub enum CostSource {
Litellm,
OpenCodeStored(f64),
CursorStored(f64),
HermesStored(f64),
GrokGauge,
}Expand description
How a model’s USD cost is resolved.
Different providers carry different authoritative cost sources, so the cost resolver branches on which one applies.
Variants§
Litellm
File-based providers: the full LiteLLM lookup (exact → normalized → substring → fuzzy).
OpenCodeStored(f64)
OpenCode: an exact LiteLLM match prices from tokens, otherwise the
stored assistant-message cost is used verbatim. No fuzzy guessing, so a
novel model like deepseek-v4-pro reports OpenCode’s own cost instead of
being priced against a loosely-similar name.
CursorStored(f64)
Caller-supplied Cursor cost used verbatim. Retained for source compatibility; VCT’s local Cursor reader now returns zero stored cost and its display path accepts only exact LiteLLM matches.
HermesStored(f64)
Hermes: same basis as [OpenCodeStored] — an exact LiteLLM match
prices from tokens, otherwise Hermes’s own stored cost is used. Hermes
often bills novel models LiteLLM can’t price, so its own number is the
safest fallback; the map is kept separate so a colliding bare model name
can’t cross-contaminate another provider’s cost.
GrokGauge
Grok: the full LiteLLM lookup, but the context-gauge estimate lives
entirely in the cache-read bucket, so a matched model whose LiteLLM
entry publishes no cache-read price (null for several xai/grok-*
variants) falls back to the input rate instead of silently costing $0.
Trait Implementations§
Source§impl Clone for CostSource
impl Clone for CostSource
Source§fn clone(&self) -> CostSource
fn clone(&self) -> CostSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CostSource
Auto Trait Implementations§
impl Freeze for CostSource
impl RefUnwindSafe for CostSource
impl Send for CostSource
impl Sync for CostSource
impl Unpin for CostSource
impl UnsafeUnpin for CostSource
impl UnwindSafe for CostSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more