Skip to content

fix(pricing): DeepSeek V4 static defaults stale by 4 days, off by ~1.6-2.4x - #10635

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.50from
stanleytejakusuma:fix/deepseek-v4-static-pricing-stale
Aug 20, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.50from
stanleytejakusuma:fix/deepseek-v4-static-pricing-stale

Conversation

@stanleytejakusuma

Copy link
Copy Markdown
Contributor

Description

DeepSeek switched deepseek-v4-pro/deepseek-v4-flash to peak/off-peak dynamic pricing on 2026-08-17 (off-peak = exactly half of peak; peak hours 01:00-04:00 and 06:00-10:00 UTC — pricing page). DEFAULT_PRICING_FRONTIER.deepseek in frontier-labs.ts is dated checked 2026-08-13, four days before the change, and was never updated — the compiled-in numbers are now stale by ~1.6-2.4x depending on token type.

I hit this from the consumer side (a local cost-reconciliation pipeline reading /api/pricing/defaults) and confirmed POST /api/pricing still returns non-2xx on this build — the table really is compiled-in, matching the existing pattern in sync_gateway-style write attempts. Fixing the static default is the only lever available.

Scope

Uses the off-peak values (the documented lower bound) since getPricingForModel(provider, model) has no time-of-day dimension anywhere in its resolution chain. Adding real peak-awareness would mean threading a ts/hour parameter through the resolver and every call site — a real feature, not a bugfix — so deliberately out of scope here. Off-peak-only is a strict undercount confined to the two peak windows, never wrong-direction, and is still a ~1.6-2.4x correction over what's there now.

Validation

  • Confirmed live consumers of this table: src/shared/utils/costEstimator.ts, src/lib/batches/costEstimator.ts.
  • Re-ran their test suites plus every pricing-*/catalog-pricing-* unit test (68 tests across 11 files, including tests/unit/lib/batches/costEstimator.test.ts) — all pass unchanged; none assert the specific stale values, so nothing needed updating on the test side.
  • Live-verified the new numbers against the current DeepSeek pricing page directly (not just the changelog text) before writing them in.

…6-2.4x

DeepSeek switched v4-pro/v4-flash to peak/off-peak dynamic pricing on
2026-08-17 (off-peak = exactly half of peak; peak hours 01:00-04:00 and
06:00-10:00 UTC — https://api-docs.deepseek.com/quick_start/pricing/).
The compiled-in DEFAULT_PRICING_FRONTIER.deepseek entries were last checked
2026-08-13, four days before the change, and never updated.

sync-gateway-style writes to this table are rejected on this build (POST
/api/pricing returns non-2xx — the table is compiled into the bundle), so
this static default is the only lever available for correcting it; fixing
the number here is the whole fix.

Uses the OFF-PEAK values (documented lower bound) since getPricingForModel()
has no time-of-day dimension anywhere in its resolution chain — true
peak-awareness would need a `ts`/hour parameter threaded through the
resolver and every call site, which is a real feature addition, not a
bugfix, and is out of scope here. Off-peak-only is a strict undercount
confined to the two peak windows, never wrong-direction, and is already a
~1.6-2.4x correction over the stale pre-change numbers it replaces.

Confirmed live consumers of this table (src/shared/utils/costEstimator.ts,
src/lib/batches/costEstimator.ts) and re-ran their test suites plus every
pricing-* unit test (68 tests across 11 files) — all pass unchanged; nothing
asserts the specific stale price values.
@diegosouzapw

Copy link
Copy Markdown
Owner

Reviewed — this is a clean, well-documented data fix. The rationale for using off-peak
(lower-bound) values given getPricingForModel() has no time-of-day dimension is sound and
explicitly scoped, and the source citation (DeepSeek's pricing page) is a good practice worth
keeping in future pricing PRs. One suggestion before merge: could you add a small regression
test asserting the new deepseek-v4-pro/deepseek-v4-flash values (or at least their
internal consistency, e.g. output = 3x input) so a future accidental revert gets caught by
CI? Not blocking given the low-risk, single-file, data-only nature of the change, but would
close the one gap I found. Nice catch on the LITELLM_PROVIDER_MAP alias bug in your other PR
(#10636) too — good pairing.

…ricing

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
stanleytejakusuma added a commit to stanleytejakusuma/OmniRoute that referenced this pull request Aug 19, 2026
@stanleytejakusuma
stanleytejakusuma force-pushed the fix/deepseek-v4-static-pricing-stale branch from d633658 to 3458380 Compare August 19, 2026 09:14
@stanleytejakusuma

Copy link
Copy Markdown
Contributor Author

Regression test landed on the branch (commit 3458380, co-authored with the review): tests/unit/pricing-deepseek-v4-static-regression.test.ts asserts the exact corrected off-peak values for deepseek-v4-pro/-flash AND the documented output=3x-input / reasoning=output consistency. Ran locally: 3/3 pass. Thanks for the review — ready for merge.

@diegosouzapw
diegosouzapw merged commit 998c3c2 into diegosouzapw:release/v3.8.50 Aug 20, 2026
7 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…6-2.4x (diegosouzapw#10635)

Merged — locally validated (28/28 focused pricing tests, gates green). Appreciate the conservative off-peak-only scope and the live verification against the pricing page. Thanks!
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.

2 participants