Commit Graph

41 Commits

Author SHA1 Message Date
root 6b51d74e72 fix: 增加请求前限额拦截(async_pre_call_hook),修复超限滞后击穿漏洞 2026-08-10 08:07:04 +00:00
root 1e63653f52 fix: add deepseek-v4-flash-0731 alias and fix config discovery skipping commented lines
- Add MANUAL_MONITORED_MODEL_ALIASES entry for
  deepseek-v4-flash-0731 -> deepseek-v4-flash-ga-260731,
  since VolcEngine resource pack uses MMDD format while
  upstream model name uses -ga-YYMMDD (inconsistent naming).

- Fix config.yaml auto-discovery to skip lines starting with '#',
  preventing commented-out api_base lines from leaking into the
  currently-open entry and misclassifying non-VolcEngine models.
  This was causing deepseek-v4-flash (via NEWAPI) to be falsely
  detected as a monitored VolcEngine model.
2026-08-09 14:21:46 +00:00
kim 3dd97730b6 fix: default remaining to high quota for unknown models on startup and update AGENTS.md 2026-07-08 10:42:14 +08:00
kim 27324f459c fix: add doubao-seed-2-0-code alias to monitored models 2026-06-11 14:52:02 +08:00
kim 671ef1087f fix: resolve falsy effective_limit bug preventing model block on negative quota 2026-06-11 14:09:42 +08:00
kim 28c81c4816 fix: resolve volcengine package quota parsing and status filtering 2026-06-11 13:27:06 +08:00
kim f36c560bb0 fix: clarify effective limit debug output 2026-04-01 14:10:59 +08:00
kim 2f1c2642e5 fix: streamline monitored model maintenance 2026-04-01 13:29:10 +08:00
kim bdd51e8f9c feat: implement startup audit to block over-limit models on restart
- Add startup_audit() to check Redis usage against limits at startup
- Call startup_audit() in active_monitor_loop
- Add AGENTS.md for agent guidelines
2026-02-02 13:39:34 +08:00
kim 03df1d553e fix: strip volcengine prefix in limit sync to match config 2026-01-30 12:35:19 +08:00
kim f16af28dfe feat: 优化火山引擎配额同步策略
- 添加硬限制: doubao-seed-code 480w/日, 其他模型 180w/日
- 强制北京时间(UTC+8)计算日期,确保 Docker 容器时区无关
- 移除'忽略小跌'逻辑,Pool 下跌时立即接受(更保守的风控)
- 优化轮询间隔适配小时级 API 延迟(减少无效请求)
2026-01-30 00:39:06 +08:00
kim dd8cbe5f63 revert: remove hardcoded daily limits, restoring dynamic calculation only 2026-01-30 00:05:40 +08:00
kim d5b8829265 feat: add specific hard limits and log format 2026-01-29 23:54:32 +08:00
kim cd35a193b6 feat: finalize smart pool tracking with hysteresis (handle jumps, drops, and expiry) 2026-01-29 23:17:39 +08:00
kim 2d849dc62d fix: upgrade quota logic to track Total Pool (Usage + Rem) to prevent mid-day blocking 2026-01-29 22:30:42 +08:00
kim 73fe82de3b feat: enhance volcengine quota sync with hard limits and smart buffering 2026-01-29 22:21:29 +08:00
kim 0988b1fc1d optimize: increase burst traffic threshold to 300,000 tokens to handle long-context models 2026-01-29 20:54:18 +08:00
kim e6110cd9c1 optimize: adjust restore window to 07:00-13:00 Beijing time and optimize sleep logic for dead models 2026-01-29 20:27:32 +08:00
kim e21a510f0f fix: sync logic to filter non-volc models by api_base hash and add debug logs 2026-01-29 19:31:17 +08:00
kim 4a68121b3e Fix: Revert Doubao 1.6 mapping to shared list and remove hardcoded corner cases 2026-01-29 18:57:55 +08:00
kim 2d161c867e Fix: Separate Doubao 1.6 Standard and Thinking models into distinct quota keys 2026-01-29 18:52:43 +08:00
kim d66231a333 Enhance: Complete bilingual (CN/EN) log support for VolcSync 2026-01-29 18:48:03 +08:00
kim c536421410 Enhance: Format balance logs with thousands separators and add bilingual (CN/EN) descriptions 2026-01-29 18:39:55 +08:00
kim da41c569c0 Fix: Deduplicate packages based on full JSON content hash to prevent double counting 2026-01-29 18:26:38 +08:00
kim 587a005665 Fix: Remove duplicate code block causing IndentationError in process_packages_breakdown 2026-01-29 18:19:59 +08:00
kim 0e2acd85b0 Fix: Revert sync-all-models. Only sync configured VolcEngine models (Strict Whitelist) 2026-01-29 18:16:17 +08:00
kim fb77e4047c Fix: Sync ALL discovered VolcEngine models to Redis, ignoring INTERESTED_MODELS filter for cache 2026-01-29 18:11:59 +08:00
kim 2ceec7f1c6 Fix: Handle list mapping in process_packages_breakdown to resolve unhashable type error 2026-01-29 18:03:41 +08:00
kim d696c92879 Fix: Update VOLC_MODEL_MAP and suffixes to correctly normalize and map package names 2026-01-29 17:59:09 +08:00
kim ac62783fc6 Fix: Add infinite loop protection to API pagination 2026-01-29 17:32:58 +08:00
kim 76aa3d5aae Fix: config parsing logic to use upstream model names for whitelist 2026-01-29 17:13:09 +08:00
kim cc3ef9c482 fix(volc_sync): retry apply loop logging changes 2026-01-29 17:00:36 +08:00
kim 16e7170643 fix(volc_sync): restrict model discovery and enhance loop logging 2026-01-29 16:57:23 +08:00
kim dd0eb2b1ad fix(volc_sync): correct GLM-4 mapping and add raw package logging 2026-01-29 16:49:14 +08:00
kim 16e233f374 fix(volc_sync): auto-start background monitor thread on module import 2026-01-29 16:43:57 +08:00
kim dffb77d720 fix(volc_sync): add loop debug logs to trace package processing 2026-01-29 16:26:22 +08:00
kim 66f69df87e fix(volc_sync): add debug logs for balance display issues 2026-01-29 16:22:39 +08:00
kim 7c8065d162 feat(volc_sync): update frequency thresholds to strict intervals 2026-01-29 16:17:57 +08:00
kim 2cdd1a3295 feat(volc_sync): optimize frequency intervals and logging 2026-01-29 16:12:26 +08:00
kim 3156bbe431 feat: merge daily_limit functionality into volc_limit_sync for single-file dynamic rate limiting
This commit merges the interception and soft-eviction logic from daily_limit.py into volc_limit_sync.py.
It enables a unified solution where:
1. Running the script directly starts the sync daemon.
2. Importing 'proxy_handler_instance' provides the LiteLLM callback handler.
The handler now respects dynamic limits synced to Redis.
2026-01-29 15:11:14 +08:00
kim 8630f287b4 feat: add dynamic rate limiting for Volcengine models
This commit introduces a dual-layer rate limiting system:
1. volc_limit_sync.py: A daemon that adaptively syncs Volcengine API balances to Redis based on traffic and safety margins.
2. daily_limit.py: Updated to enforce dynamic limits by checking Redis (Current Usage + Remaining Balance) and handling soft evictions.
2026-01-29 14:51:55 +08:00