v2.1.0: 能力路由体系 + 模型管理 + 生图/语音/视频端点 + 大量修复
- 提供商重构: Local Qwen(文本+视觉) / SiliconFlow LLM(文本) / Autodl(文本+视觉) / Autodl Image(生图) - 能力标签: text/vision/audio_out/audio_in/image_gen/video_gen,模型级可配 - AUTO配置绑定能力: auto/auto-text/auto-vision/auto-image/auto-voice-out/auto-voice-in/auto-video - 新端点: /v1/images/generations /v1/audio/speech /v1/audio/transcriptions /v1/video/generations - 模型管理页: 能力切换/增删改/设默认/别名管理 - 修复: 失败切换不再替换用户模型; 熔断冷却后自动恢复; 重试不再白等; embeddings按模型路由 - 修复: 后台模板API路径(/api/admin); 删除v1旧admin目录与双端口混乱 - 修复: run.sh硬编码路径; 死配置RETRY/LOG接线; engine_completions空body防护 - 端口: 16003(16001-16100白名单区间); debug关闭; start.sh部署脚本
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# 大模型API中转系统 启动/停止/状态脚本
|
||||
# 用法: ./start.sh [start|stop|restart|status] 默认 start
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
PORT=16003
|
||||
APP=app.py
|
||||
PYTHON=/home/hz1/miniconda3/envs/openclaw/bin/python3
|
||||
PID_FILE=data/proxy.pid
|
||||
mkdir -p data logs
|
||||
|
||||
if [ ! -x "$PYTHON" ]; then
|
||||
PYTHON=python3
|
||||
fi
|
||||
|
||||
start() {
|
||||
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
||||
echo "LLM Proxy 已在运行 (PID $(cat "$PID_FILE"), 端口 $PORT)"
|
||||
return 0
|
||||
fi
|
||||
nohup "$PYTHON" "$APP" > logs/start.log 2>&1 &
|
||||
echo $! > "$PID_FILE"
|
||||
sleep 1.5
|
||||
if kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
||||
echo "✅ LLM Proxy 已启动 (PID $(cat "$PID_FILE"))"
|
||||
echo " 前台API: http://<IP>:$PORT/v1/chat/completions"
|
||||
echo " 后台管理: http://<IP>:$PORT/admin"
|
||||
else
|
||||
echo "❌ 启动失败,查看日志: logs/start.log"
|
||||
tail -20 logs/start.log
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
||||
kill "$(cat "$PID_FILE")"
|
||||
rm -f "$PID_FILE"
|
||||
echo "🛑 LLM Proxy 已停止"
|
||||
else
|
||||
echo "LLM Proxy 未在运行"
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
||||
echo "✅ LLM Proxy 运行中 (PID $(cat "$PID_FILE"), 端口 $PORT)"
|
||||
else
|
||||
echo "❌ LLM Proxy 未运行"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-start}" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; sleep 1; start ;;
|
||||
status) status ;;
|
||||
*) echo "用法: $0 [start|stop|restart|status]"; exit 1 ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user