stakpak_shared/models/
model_pricing.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
4pub struct ContextPricingTier {
5 pub label: String,
6 pub input_cost_per_million: f64,
7 pub output_cost_per_million: f64,
8 pub upper_bound: Option<u64>, }
10
11#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
12pub struct ModelContextInfo {
13 pub max_tokens: u64,
14 pub pricing_tiers: Vec<ContextPricingTier>,
15 pub approach_warning_threshold: f64, }
17
18impl Default for ModelContextInfo {
19 fn default() -> Self {
20 Self {
21 max_tokens: 128_000,
22 pricing_tiers: vec![],
23 approach_warning_threshold: 0.8,
24 }
25 }
26}
27
28pub trait ContextAware {
29 fn context_info(&self) -> ModelContextInfo;
31
32 fn model_name(&self) -> String;
34}