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