#937 LiteLLM 副 key 启用脚本 + 计划 (20260810-154721)
新增 litellm/apply_secondary_key.sh + rollback + verify + README + docs/observability/litellm-failover-activation.md. 代码层已就绪(commit 84d89ab),等用户提供 SiliconFlow 副 key 后,单次低峰会话完成切换.
This commit is contained in:
1 parent
e50d006ef4
commit
b415a0b62e
5 files changed
+186
No files matched your search
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# litellm/verify_failover.sh - 验证主副 key 都工作
|
||||
|
||||
set -euo pipefail
|
||||
LITELLM_URL="http://localhost:12900"
|
||||
MASTER_KEY="sk-litellm-master-key-aiflow-2026"
|
||||
MODEL="deepseek-ai/DeepSeek-V4-Flash"
|
||||
|
||||
echo "=== 1. health ==="
|
||||
curl -s -o /dev/null -w "%{http_code}\n" $LITELLM_URL/health/liveliness
|
||||
echo "=== 2. test primary key (should work) ==="
|
||||
curl -s -X POST $LITELLM_URL/v1/chat/completions \
|
||||
-H "Authorization: Bearer $MASTER_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"say hi\"}],\"max_tokens\":5}" \
|
||||
| head -c 200
|
||||
echo ""
|
||||
echo "=== 3. check /metrics for failover count ==="
|
||||
curl -s $LITELLM_URL/metrics | grep -E "litellm_deployment_fail" | head -3 || echo " (no fail metric yet)"
|
||||
|
||||
Reference in new issue
Block a user