Skip to content

Bake in AihubMix DeepSeek V4 pro/flash pricing until catalogs catch up - #131

Merged
ItsJazii merged 2 commits into
mainfrom
deepseek-v4-pricing
Aug 13, 2026
Merged

Bake in AihubMix DeepSeek V4 pro/flash pricing until catalogs catch up#131
ItsJazii merged 2 commits into
mainfrom
deepseek-v4-pricing

Conversation

@ItsJazii

@ItsJazii ItsJazii commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

Second half of the #129 split (Grok half merged as #130): Hermes sessions on DeepSeek V4 models showed the unpriced ⚠ because no public catalog carries the family yet. Bakes in the vendor rate cards, self-retiring the moment a catalog learns the slugs.

  • Rates are AihubMix's own headline cards (aihubmix.com/model/deepseek-v4-pro-0813 and /deepseek-v4-flash), not the cheaper Baidu/Tencent provider rows shown on the same pages: pro $0.464 / $0.928 with $0.004 cache read, flash $0.154 / $0.308 with $0.003 cache read. No cache-write rate is published, so writes bill at the input rate.
  • On the pro cache read: Devin flagged $0.004 (~1/116 of input) as a possible dropped digit on Grok 4.6 launch pricing, Cursor slug handling, DeepSeek v4 builtins #129 — verified against the page, which literally lists Cache Read: $0.004 /M tokens. It's the vendor's number; a test comment pins this.
  • The earlier draft's flash entry ($0.142/$0.284/$0.0284) matched the Baidu/Tencent rows, not AihubMix's route — corrected here.
  • Dated snapshots (deepseek-v4-pro-0813) strip to the base entry; the trimmer is scoped to deepseek- slugs with an all-digit ≥4-char tail so deepseek-v4 / deepseek-v3.2 are untouched.
  • Slug shapes verified against a real Hermes state.db: it logs bare (deepseek-v4-flash, deepseek-v4-pro-0813), no gateway prefix — which also answers Devin's Grok 4.6 launch pricing, Cursor slug handling, DeepSeek v4 builtins #129 question about aihubmix/-prefixed spellings.
  • CORRECTIONS_REV bumped so persisted spend re-prices.

Testing

New unit test covers bare, dated, and deepseek/-prefixed spellings, the corrected flash rates, and trimmer non-targets. Full suite 58/58.

🤖 Generated with Claude Code


Open in Devin Review

Hermes sessions on deepseek-v4-pro-0813 / deepseek-v4-flash showed the
unpriced warning: no public catalog carries the family. Rates are the
gateway''s own headline cards (aihubmix.com/model/...), NOT the cheaper
Baidu/Tencent provider rows on the same pages: pro $0.464/$0.928 with
$0.004 cache read (vendor''s real number), flash $0.154/$0.308/$0.003.
Dated snapshots strip to the base entry (deepseek- scoped, >=4-digit
tails only); slug shapes verified against a real Hermes state.db
(logs are bare, no gateway prefix). CORRECTIONS_REV bumped so
persisted spend re-prices.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread src-tauri/src/pricing.rs Outdated
Comment on lines +674 to +683
// DeepSeek ships dated snapshots ("deepseek-v4-pro-0813"); price them as
// the base model so a new date doesn't silently go unpriced. Scoped to
// deepseek- slugs whose trailing dash-segment is all digits (≥4), so
// "deepseek-v4" or version-bearing names elsewhere never lose a tail.
let bare = match bare.strip_suffix(|c: char| c.is_ascii_digit()) {
Some(_) if bare.starts_with("deepseek-") => bare.rsplit_once('-').map_or(bare, |(h, t)| {
if t.chars().all(|c| c.is_ascii_digit()) && t.len() >= 4 { h } else { bare }
}),
_ => bare,
};

@devin-ai-integration devin-ai-integration Bot Aug 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Trim placement relative to the 0/0 reconsideration and suffix peel is consistent

I walked the resolution order for dated slugs: the retry sits after every real-rate source and after builtin_price, but before the 0/0 reconsideration and the effort/mode suffix peel. That means (a) a catalog that learns the base slug with real rates outranks the baked table for dated spellings (as the new test asserts), and (b) a dated slug carrying a 0/0 placeholder in a catalog still resolves to the base's real rates rather than $0.00. Composed names like deepseek-v4-pro-0813-high still work because the suffix peel recurses and the trim runs on the peeled name. Recursion is bounded by the existing depth cap of 4, and each trim strictly shortens the slug, so no unbounded recursion is possible.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

The trim inside builtin_price meant a dated snapshot could never see
catalog entries for its base slug — once a catalog learned
deepseek-v4-pro, sessions logged as -0813 would have stayed on the
baked rates forever. The trim now runs as a resolve() fallback that
retries the base slug through the whole source chain, so catalogs
outrank the baked table for dated spellings too. Test pins the
self-retirement property.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread src-tauri/src/pricing.rs
// against a real state.db); public catalogs don't carry them yet.
// Dated snapshots reach these arms via resolve()'s date-trim
// retry, so a catalog that learns the base slug outranks them.
"deepseek-v4-pro" => Some(Price::flat(0.464, 0.928, 0.004, 0.464)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Pro cache-read rate is ~1/116 of input — worth an external re-verification

deepseek-v4-pro is baked at $0.004/MTok cache read against $0.464 input, an unusually large ratio (typical vendor cache reads are 1/4–1/10 of input). The PR explains this was verified against AihubMix's page and Devin previously flagged it, and the code/test comments pin it. Nothing in the repo can confirm the vendor number; if it is actually $0.04 or $0.046, cached-heavy DeepSeek V4 pro sessions would under-report spend by roughly 10x on the cache-read component until a catalog learns the slug. Worth one more look at the source page before merge.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ItsJazii

Copy link
Copy Markdown
Owner Author

Re-verified against aihubmix.com/model/deepseek-v4-pro-0813 (fresh load today): the headline pricing block lists Cache Read: $0.004 /M tokens, and the DeepSeek provider row on the same page lists $0.0038512/M — two independent figures on the page agreeing on ~$0.004. Not a truncated $0.04/$0.046; DeepSeek's cache-read is genuinely priced near 1/100 of input on this gateway. Keeping the vendor number; the test comment pins the receipt. If the page ever changes, a catalog entry outranks this table anyway.

@ItsJazii
ItsJazii merged commit 9e69b09 into main Aug 13, 2026
1 check passed
@ItsJazii
ItsJazii deleted the deepseek-v4-pricing branch August 13, 2026 10:28
@ItsJazii ItsJazii mentioned this pull request Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant