Skip to content

Commit 5ecdff1

Browse files
committed
test(hermes): derive DeepSeek provider pricing from embedded snapshot
The precedence regression pinned deepseek/deepseek-v4-flash at the old $0.14/M models.dev rate, so the scheduled models.dev refresh failed once upstream repriced the retired alias to V4.1 Flash ($0.15/M). Compare against the embedded provider entry instead and assert it differs from the raw model's timestamp-aware schedule so the precedence check stays meaningful.
1 parent 06347d3 commit 5ecdff1

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎rust/adapters/hermes/src/parser.rs‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,21 @@ mod tests {
413413
"deepseek-v4-flash".to_string()
414414
]
415415
);
416-
assert!((calculate_hermes_cost(&entry, &pricing) - 0.14).abs() < 1e-12);
416+
let provider_cost = pricing
417+
.find_exact_with_fallback("deepseek/deepseek-v4-flash")
418+
.unwrap()
419+
.input
420+
* 1_000_000.0;
421+
let raw_model_cost = calculate_cost_for_usage_at(
422+
Some("deepseek-v4-flash"),
423+
entry.usage,
424+
None,
425+
Some(entry.timestamp),
426+
CostMode::Calculate,
427+
Some(&pricing),
428+
);
429+
assert!((provider_cost - raw_model_cost).abs() > 1e-12);
430+
assert!((calculate_hermes_cost(&entry, &pricing) - provider_cost).abs() < 1e-12);
417431
}
418432

419433
#[test]

0 commit comments

Comments
 (0)