fix(catalog): give DeepSeek V4 its own window and price - #249
Merged
Zongwei9888 merged 1 commit intoSep 27, 2026
Merged
Conversation
Every DeepSeek V4 id used to miss the seed table and fall through to the ``deepseek`` family rule, i.e. inherit the deepseek-v3 row. Two numbers were wrong as a result: * window: V4 is 1M with 384K max output, not V3's 128K / 8K, so anything sizing a prompt against this catalog budgeted ~8x too small; * price: V3's 0.27/1.10 was applied to both tiers, so a pro/flash split was invisible to any accounting keyed on model id. Numbers come from the vendor's published table, read 2026-09-27: https://api-docs.deepseek.com/quick_start/pricing Two details on that page shape the rows: * ``deepseek-flash`` is the vendor's current name for V4.1-Flash. The id ``deepseek-v4-flash`` is a retired alias that still resolves and is still billed at the Flash price (page footnote 1), so both ids carry one row. * V4 is priced by time of day and a catalog row holds a single number, so the peak rate is seeded: it is the upper bound, which is the safe direction for a budget guard. Off-peak is exactly half of it. A ``deepseek-flash`` family rule is added as well, so a future ``deepseek-flash-*`` point release cannot fall back to V3 either. tests/test_catalog.py gains coverage for the current and retired Flash ids resolving to the vendor row, for the tiers staying priced apart, for gateway spelling folding, and for unseen point releases not inheriting V3.
Collaborator
|
Merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
deepseek-v4-flash/deepseek-v4-prowere missing from the model catalog's seed table, so both fell through to thedeepseekfamily rule and inherited the deepseek-v3 row. Two numbers were wrong as a result: the context window (128K / 8K instead of 1M / 384K) and the price (V3's rate applied to both tiers, so a pro/flash split was invisible to anything that accounts by model id). This seeds the V4 ids from the vendor's published table and adds focused regression tests.Changes
core/providers/catalog.py(+29)deepseek-flash(the vendor's current name for V4.1-Flash),deepseek-v4-flash(a retired alias that still resolves and is still billed at the Flash price) anddeepseek-v4-pro- 1M context / 384K max output;("deepseek-flash", ...)and("deepseek-v4", ...)family rules ahead of thedeepseekrule, so an unseen point release inherits the cheapest V4 tier instead of V3's rate.tests/test_catalog.py(+65) - 4 tests / 8 parametrized cases.Notes on the numbers
deepseek-flashanddeepseek-v4-flashdeliberately point at the same numbers: both spellings occur in real traffic, and separate rows would fragment cost accounting by spelling rather than by model.Test Plan
python -m pytest tests/test_catalog.py -q-> 18 passedruff checkandruff format --checkclean on both files (ruff 0.15.21, the version pinned in.pre-commit-config.yaml)Dependency note
None. Stdlib-only change; the only new import is
pytestin the test file.