feat: 手动软踢 Redis key (manual_evict) + redis 卷固定名称

- docker-compose: redis_data 卷加 name: litellm_redis_data, 卷名不再随
  compose 项目名(目录名)漂移, 目录迁移不会新建空卷丢数据
- _check_request_block: 监控条目命中后检查 Redis manual_evict:{clean} key,
  存在即返回 (clean,-2,-2) 恒 429; key 落持久卷, 重启后仍生效,
  显式 DEL 才恢复, 幂等
- async_pre_call_hook: 识别 -2 标记, 返回 manually soft-evicted 429
- 用法: SET/DEL/KEYS manual_evict:* (docker exec litellm_redis redis-cli)
This commit is contained in:
vibe-code
2026-08-13 10:05:02 +00:00
parent 5fddea126e
commit e91e2d1d5e
2 changed files with 30 additions and 0 deletions
+3
View File
@@ -89,3 +89,6 @@ volumes:
name: litellm_postgres_data
redis_data: # 如果开启了 redis 持久化,这里也要打开
driver: local
# 固定卷名:卷名不再由 compose 项目名(目录名)派生,
# 目录改名/迁移后 up 不会新建空卷导致数据"丢失"
name: litellm_redis_data