From 45556c961f2bcbc6586ebfc10c18dafb44b68171 Mon Sep 17 00:00:00 2001 From: CaIon Date: Tue, 2 Dec 2025 22:09:48 +0800 Subject: [PATCH] fix(price): adjust pre-consume quota logic for free models based on group ratio --- relay/helper/price.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/relay/helper/price.go b/relay/helper/price.go index 2a774e40..c310220f 100644 --- a/relay/helper/price.go +++ b/relay/helper/price.go @@ -99,7 +99,10 @@ func ModelPriceHelper(c *gin.Context, info *relaycommon.RelayInfo, promptTokens // check if free model pre-consume is disabled if !operation_setting.GetQuotaSetting().EnableFreeModelPreConsume { // if model price or ratio is 0, do not pre-consume quota - if usePrice { + if groupRatioInfo.GroupRatio == 0 { + preConsumedQuota = 0 + freeModel = true + } else if usePrice { if modelPrice == 0 { preConsumedQuota = 0 freeModel = true