pub struct ModelReferenceCard {
pub provider: String,
pub provider_kind: Option<ProviderKind>,
pub model_id: String,
pub canonical_model: Option<String>,
pub family: Option<String>,
pub context_window: Option<u64>,
pub max_output: Option<u64>,
pub modality: Modality,
pub pricing: Option<OfferingPricing>,
pub source: CatalogSource,
}Expand description
A factual reference card for one provider offering.
Every field is either a stated fact or an explicit unknown. This is a labels-only projection: it carries no routing, tier, or selection concept.
Fields§
§provider: StringProvider id serving this offering, exactly as the catalog row states it.
provider_kind: Option<ProviderKind>Resolved built-in provider kind, when the provider id maps to one.
None for an unrecognized / user-named custom provider — an unknown
kind, not a guess.
model_id: StringThe provider wire model id, verbatim. Never normalized or prefixed.
canonical_model: Option<String>Canonical model identity, only when the row carried an explicit join.
family: Option<String>Model family / series, when stated.
context_window: Option<u64>Context-window tokens, when stated.
max_output: Option<u64>Max-output tokens, when stated.
modality: ModalityText vs multimodal, or unknown.
pricing: Option<OfferingPricing>Per-token pricing facts, when priced. None is unknown, never free.
source: CatalogSourceProvenance of the underlying catalog row (bundled / live / override).
Implementations§
Source§impl ModelReferenceCard
impl ModelReferenceCard
Sourcepub fn from_offering(offering: &CatalogOffering) -> Self
pub fn from_offering(offering: &CatalogOffering) -> Self
Project a catalog offering into its factual reference card.
Sourcepub fn provider_kind_label(&self) -> &'static str
pub fn provider_kind_label(&self) -> &'static str
Label for the resolved provider kind, or "unknown".
Sourcepub fn context_window_label(&self) -> String
pub fn context_window_label(&self) -> String
Human context-window label such as "1M", "131K", "512", or
"unknown". The exact token count remains on Self::context_window.
Sourcepub fn max_output_label(&self) -> String
pub fn max_output_label(&self) -> String
Human max-output label, same shape as Self::context_window_label.
Sourcepub fn price_label(&self) -> String
pub fn price_label(&self) -> String
Short factual price label, e.g. "$0.30 / $1.20 per Mtok", or
"unknown" when no per-token input/output rate is sourced.
A ? in one slot means that single rate is unknown while the other is
stated; a fully unknown price collapses to "unknown" rather than a
fabricated zero.
Trait Implementations§
Source§impl Clone for ModelReferenceCard
impl Clone for ModelReferenceCard
Source§fn clone(&self) -> ModelReferenceCard
fn clone(&self) -> ModelReferenceCard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more