Skip to content

fix: update modelPrice default setting - #3064

Closed
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/26f33929be9337acc2964ceca9342de88a33e294
Closed

fix: update modelPrice default setting#3064
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/26f33929be9337acc2964ceca9342de88a33e294

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Feb 28, 2026

Copy link
Copy Markdown
Member

未配置固定价格的视频模型使用后台默认预扣费值而不是固定0.1

Summary by CodeRabbit

  • Bug Fixes
    • Updated model pricing calculation to use dynamic quota-based computation instead of fixed default values when explicit model prices are unavailable, ensuring more accurate pricing calculations throughout the system.

@coderabbitai

coderabbitai Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21cfc1c and 084f00f.

📒 Files selected for processing (1)
  • relay/helper/price.go

Walkthrough

The change modifies the fallback pricing logic in ModelPriceHelperPerCall function, replacing a hard-coded price value of 0.1 with a computed calculation based on PreConsumedQuota and QuotaPerUnit constants. This affects how model prices are determined when no explicit price configuration exists.

Changes

Cohort / File(s) Summary
Price Fallback Logic
relay/helper/price.go
Modified the default modelPrice assignment when no explicit model price is found, changing from fixed value 0.1 to computed value float64(common.PreConsumedQuota) / common.QuotaPerUnit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

🐰 A price so fixed at point-one bright,
Now dances with quotas, a dynamic sight,
PreConsumed wisdom guides the way,
Fairer pricing starts today! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the default modelPrice calculation from a fixed 0.1 to a computed value based on backend default pre-deduction fee.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@feitianbubu feitianbubu closed this Mar 3, 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