feat: 备用大模型接口管理功能

- 新增 BackupLLMConfig 数据模型存储备用大模型配置
- 支持手动新增、编辑、删除备用大模型接口
- 支持测试连接功能
- 大模型配置页面静态表格改为动态管理的备用接口链接
- 默认初始化5个常用大模型服务商配置
This commit is contained in:
2026-04-16 14:36:13 +08:00
parent 9a36b9245a
commit 8ef9df65d2
5 changed files with 613 additions and 15 deletions

View File

@@ -90,20 +90,17 @@
</div>
<div class="card mt-3">
<div class="card-header"><h6 class="mb-0"><i class="bi bi-info-circle"></i> 常用模型配置参考</h6></div>
<div class="card-header d-flex justify-content-between align-items-center">
<h6 class="mb-0"><i class="bi bi-cloud"></i> 备用大模型接口</h6>
<a href="{{ url_for('admin.backup_llm_list') }}" class="btn btn-sm btn-outline-primary">
<i class="bi bi-gear"></i> 管理备用接口
</a>
</div>
<div class="card-body">
<table class="table table-sm">
<thead class="table-light">
<tr><th>服务商</th><th>API地址</th><th>模型示例</th></tr>
</thead>
<tbody>
<tr><td>本地LM Studio</td><td>http://localhost:1234/v1</td><td>根据加载的模型</td></tr>
<tr><td>OpenAI</td><td>https://api.openai.com/v1</td><td>gpt-4, gpt-3.5-turbo</td></tr>
<tr><td>DeepSeek</td><td>https://api.deepseek.com/v1</td><td>deepseek-chat</td></tr>
<tr><td>阿里百炼</td><td>https://dashscope.aliyuncs.com/compatible-mode/v1</td><td>qwen-turbo, qwen-plus</td></tr>
<tr><td>SiliconFlow</td><td>https://api.siliconflow.cn/v1</td><td>Qwen/Qwen2.5-72B-Instruct</td></tr>
</tbody>
</table>
<p class="text-muted">备用大模型接口用于主接口不可用时切换备用服务。支持手动新增、编辑、测试连接。</p>
<a href="{{ url_for('admin.backup_llm_list') }}" class="btn btn-outline-secondary">
<i class="bi bi-list"></i> 查看所有备用接口
</a>
</div>
</div>
</main>