pub struct PricingTable {
pub models: HashMap<String, ModelPricing>,
}Expand description
Backed by pricing.json at deploy time; the canonical table is hard-coded
so the build stays self-contained.
Fields§
§models: HashMap<String, ModelPricing>Implementations§
Source§impl PricingTable
impl PricingTable
pub fn canonical() -> Self
pub fn get(&self, model: &str) -> Option<&ModelPricing>
Sourcepub fn is_free(model: &str) -> bool
pub fn is_free(model: &str) -> bool
True when this model executes on the operator’s own hardware.
Ollama Cloud tags are not free: they look local (same daemon, same API,
an ollama: prefix) but generate tokens on a paid account. See
Self::is_ollama_cloud.
Sourcepub fn is_ollama_cloud(model: &str) -> bool
pub fn is_ollama_cloud(model: &str) -> bool
True for an Ollama model whose tag ends in -cloud, which executes
remotely on a paid account.
Matching is on the tag (after the last :), so a local model merely
named cloudy-llama:7b is unaffected. Case-insensitive, as Ollama tags
are.
Trait Implementations§
Source§impl Clone for PricingTable
impl Clone for PricingTable
Source§fn clone(&self) -> PricingTable
fn clone(&self) -> PricingTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PricingTable
impl Debug for PricingTable
Source§impl Default for PricingTable
impl Default for PricingTable
Source§fn default() -> PricingTable
fn default() -> PricingTable
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PricingTable
impl<'de> Deserialize<'de> for PricingTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PricingTable
impl RefUnwindSafe for PricingTable
impl Send for PricingTable
impl Sync for PricingTable
impl Unpin for PricingTable
impl UnsafeUnpin for PricingTable
impl UnwindSafe for PricingTable
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