Fix: Revert sync-all-models. Only sync configured VolcEngine models (Strict Whitelist)
This commit is contained in:
+11
-7
@@ -785,18 +785,23 @@ def active_monitor_loop():
|
||||
targets = [model_name]
|
||||
|
||||
for target in targets:
|
||||
# Optimization: Sync ALL balances found in the VolcEngine account
|
||||
# Reason: Some models might be used via aliases (e.g. NewAPI) or not explicitly in config
|
||||
# but belong to the same account. We should cache their quota regardless.
|
||||
# STRICT FILTER: Only sync models explicitly configured with VolcEngine Base URL
|
||||
# User Requirement: Do NOT sync or limit models that share names but use other providers (e.g. NewAPI)
|
||||
if target not in INTERESTED_MODELS:
|
||||
if DEBUG_MODE:
|
||||
print(
|
||||
f"DEBUG: Skipping {target} (Not in INTERESTED_MODELS)",
|
||||
flush=True,
|
||||
)
|
||||
continue
|
||||
|
||||
# Use normalized key for storage
|
||||
# Format: limit:dynamic:volcengine:remaining:{model_name}
|
||||
dynamic_key = f"limit:dynamic:volcengine:remaining:{target}"
|
||||
|
||||
if DEBUG_MODE:
|
||||
is_interested = " (Configured)" if target in INTERESTED_MODELS else " (Auto-Found)"
|
||||
print(
|
||||
f"DEBUG: Checking {target}{is_interested} (Bal: {int(balance)}, Rem: {int(remaining)})",
|
||||
f"DEBUG: Checking {target} (Configured) (Bal: {int(balance)}, Rem: {int(remaining)})",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
@@ -808,8 +813,7 @@ def active_monitor_loop():
|
||||
flush=True,
|
||||
)
|
||||
|
||||
# Only count INTERESTED models for global min tracking (frequency control)
|
||||
if target in INTERESTED_MODELS:
|
||||
# Track min remaining for frequency control
|
||||
configured_models_found = True
|
||||
if remaining < temp_min_remaining:
|
||||
temp_min_remaining = remaining
|
||||
|
||||
Reference in New Issue
Block a user