feat: add specific hard limits and log format

This commit is contained in:
kim
2026-01-29 23:54:32 +08:00
parent cd35a193b6
commit d5b8829265
+6 -4
View File
@@ -120,11 +120,12 @@ VOLC_MANAGED_PAIRS = set()
# Format: "clean-model-name": limit_in_tokens # Format: "clean-model-name": limit_in_tokens
# Or with hash: "clean-model-name:hash": limit_in_tokens # Or with hash: "clean-model-name:hash": limit_in_tokens
HARD_DAILY_LIMITS = { HARD_DAILY_LIMITS = {
# 示例 Examples: # 特定模型硬限额
"doubao-seed-code-preview-251028": 5_000_000, "doubao-seed-code-preview-251028": 4_800_000,
"deepseek-v3-2-251201": 1_600_000, # 通用模型硬限额
"doubao-seed-1-8-251228": 1_800_000, "doubao-seed-1-8-251228": 1_800_000,
"glm-4-7-251222": 1_800_000, "glm-4-7-251222": 1_800_000,
"deepseek-v3-2-251201": 1_800_000,
} }
# ========================================== # ==========================================
@@ -545,8 +546,9 @@ class DailyLimitHandler(CustomLogger):
print(f"DEBUG: Dynamic key not found: {dynamic_key}") print(f"DEBUG: Dynamic key not found: {dynamic_key}")
key_display = key.split(":", 2)[-1] key_display = key.split(":", 2)[-1]
limit_str = f"/{int(effective_limit):,}" if effective_limit else ""
log( log(
f"📊 [Usage] {key_display}: +{total_tokens} (Today: {current_total:,}{rem_display})", f"📊 [Usage] {key_display}: +{total_tokens} (Today: {current_total:,}{limit_str}{rem_display})",
level="INFO", level="INFO",
) )