tchbcb commited on
Commit
b34f2f6
·
verified ·
1 Parent(s): 78aed4b

128k context upgrade: KV q8_0/q4_0 + FA + auto fallback (rescue_restart.sh)

Browse files
Files changed (1) hide show
  1. rescue_restart.sh +21 -0
rescue_restart.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # 现场救援: 重启 128k API + aitun 公网隧道 (机器还活着、但服务/隧道掉线时用)
3
+ # 用法: AITUN_API_KEY=<你的aitun_key> bash rescue_restart.sh
4
+ # 依赖: 同目录下 start_server.sh / start_tunnel.sh
5
+ set -uo pipefail
6
+ cd "$(dirname "$0")"
7
+ PORT=${PORT:-8080}
8
+
9
+ echo "===== [1/2] 重启 llama-server @ CTX=${CTX:-131072} (128k) ====="
10
+ CTX="${CTX:-131072}" bash start_server.sh || { echo "server 启动失败, 查看 /root/llama_server.log"; exit 1; }
11
+
12
+ echo "===== [2/2] aitun 公网隧道 ====="
13
+ if [ -n "${AITUN_API_KEY:-}" ]; then
14
+ AITUN_API_KEY="$AITUN_API_KEY" PORT="$PORT" bash start_tunnel.sh
15
+ else
16
+ echo "未设置 AITUN_API_KEY, 跳过隧道 (本机 API 可用: http://127.0.0.1:$PORT)"
17
+ fi
18
+
19
+ echo "===== 验证 ====="
20
+ curl -s -m 5 -H "Authorization: Bearer ${API_KEY:-1234}" "http://127.0.0.1:$PORT/v1/models" | head -c 300; echo
21
+ echo "完成。公网地址见 /root/aitun_llm.log 中的 https://<子域名>.aitun.cc"