Repository navigation
feat(billing): DeepSeek peak-hour pricing (rant 2026-08-20T11:58:40) - #104
Merged
Merged
Conversation
Peak hours (Beijing 9:00-12:00 / 14:00-18:00, Mon-Sun) bill at 2x the off-peak rate for DeepSeek. Config models gain optional peak_* price fields (default 0 = peak billing off), models table migration v9, billing picks prices by fixed Asia/Shanghai time, market UI shows a 'peak xN' badge + detail row, admin model form supports peak prices.
argszero
pushed a commit
that referenced
this pull request
Aug 20, 2026
…o fmt Post-rebase fixup: the models-refresh config renamed zhipu glm-5.2 to glm-5.3; the peak-pricing seed test (PR #104) referenced the old name. Also applies rustfmt to merged CNY-anchor/peak files so the tree is fmt-clean (129 passed).
argszero
pushed a commit
that referenced
this pull request
Aug 20, 2026
…or at app.js:2409 PR #104 (peak pricing) merge 时 modelsToView 残留了一段重复的 'avail/multi/success/live' 属性块(2408-2414 行),导致 modelsToView 函数体提前闭合、后续代码语法错误(Unexpected token ':')。 删除重复块,node --check 通过。
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.
Summary
Implements peak-hour pricing for DeepSeek (rant timestamp
2026-08-20T11:58:40). DeepSeek's official pricing doubles during Beijing peak hours (9:00-12:00 / 14:00-18:00); previously billing always used the off-peak price, undercharging by half during peak hours.Changes
[[models]]gains 3 optional fields —peak_input_per_m/peak_output_per_m/peak_cache_hit_input_per_m(default 0 = peak billing disabled, off-peak price applies)peak_*columns tomodels(idempotentensure_column);seed_modelsupserts them from configis_peak_hour()— fixed Asia/Shanghai (UTC+8, no DST), peak = 09:00-12:00 / 14:00-18:00 Beijing time, Mon-Sun;effective_prices()— peak-hour price selection with 0-default fallback to off-peaksettle_usagebills at peak prices when the current Beijing time falls in a peak windowGET /api/models, admin model list, and admin create/patch endpoints carry the peak fields (validated ≥ 0)Acceptance checklist (from rant)
Tests
cargo test: 128 passed (125 existing + 3 new:is_peak_hour_beijing_boundaries,effective_prices_selects_peak_or_falls_back,calc_points_uses_peak_price_in_peak_hour; db seed test extended)cargo clippy: 0 warnings;cargo fmt --check: cleannode --check) on app.js / i18n.js / data.js: OK