Bake in AihubMix DeepSeek V4 pro/flash pricing until catalogs catch up - #131
Conversation
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>
| // 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, | ||
| }; |
There was a problem hiding this comment.
📝 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.
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>
| // 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)), |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
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. |
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.
Cache Read: $0.004 /M tokens. It's the vendor's number; a test comment pins this.deepseek-v4-pro-0813) strip to the base entry; the trimmer is scoped todeepseek-slugs with an all-digit ≥4-char tail sodeepseek-v4/deepseek-v3.2are untouched.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 aboutaihubmix/-prefixed spellings.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