feat(billing): add fallback pricing for MiniMax M2.5, GLM-4.7/5, Kimi…#970
Open
wucm667 wants to merge 1 commit intoWei-Shaw:mainfrom
Open
feat(billing): add fallback pricing for MiniMax M2.5, GLM-4.7/5, Kimi…#970wucm667 wants to merge 1 commit intoWei-Shaw:mainfrom
wucm667 wants to merge 1 commit intoWei-Shaw:mainfrom
Conversation
… K2.5, Qwen3.5-Plus - Add MiniMax M2.5 pricing: $0.27/MTok input, $0.95/MTok output - Add 智谱 GLM-4.7 pricing: $0.38/MTok input, $1.98/MTok output - Add 智谱 GLM-5 pricing: $0.72/MTok input, $2.30/MTok output - Add Kimi K2.5 pricing: $0.45/MTok input, $2.20/MTok output - Add Qwen3.5-Plus pricing: $0.26/MTok input, $1.56/MTok output - Add family matching rules for the above model series - Add unit tests covering all new models and variants
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.
变更概述
为计费服务新增多个国内主流 AI 模型的兜底(fallback)定价,确保这些模型在
model_pricing.json数据文件中没有精确匹配时,仍能正确计算费用。新增模型及定价
变更详情
billing_service.goinitFallbackPricing()中为上述 5 个模型注册兜底定价getFallbackPricing()中新增对应的模型系列匹配规则,支持大小写不敏感匹配及常见变体(如m2.5/m2-5、4.7/4-7等分隔符差异)billing_service_test.goqwen-max的expectNilPricing: true测试用例调整为llama-3-70b,更准确地代表"不支持的模型系列"测试
go test -tags=unit ./backend/internal/service/...所有单元测试通过。
Checklist