Swap canonical model from openrouter to models.dev (#6625)
This commit is contained in:
@@ -482,17 +482,17 @@ pub async fn get_pricing(
|
||||
|
||||
let mut pricing_data = Vec::new();
|
||||
|
||||
if let (Some(input_cost), Some(output_cost)) = (
|
||||
canonical_model.pricing.prompt,
|
||||
canonical_model.pricing.completion,
|
||||
) {
|
||||
if let (Some(input_cost), Some(output_cost)) =
|
||||
(canonical_model.cost.input, canonical_model.cost.output)
|
||||
{
|
||||
pricing_data.push(PricingData {
|
||||
provider: query.provider.clone(),
|
||||
model: query.model.clone(),
|
||||
input_token_cost: input_cost,
|
||||
output_token_cost: output_cost,
|
||||
// Canonical model costs are per million tokens, convert to per-token
|
||||
input_token_cost: input_cost / 1_000_000.0,
|
||||
output_token_cost: output_cost / 1_000_000.0,
|
||||
currency: "$".to_string(),
|
||||
context_length: Some(canonical_model.context_length as u32),
|
||||
context_length: Some(canonical_model.limit.context as u32),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user