Browse Source

fix(price): adjust pre-consume quota logic for free models based on group ratio

CaIon 4 tuần trước cách đây
mục cha
commit
45556c961f
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      relay/helper/price.go

+ 4 - 1
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