Phase 1: Add SiliconFlow provider + DeepSeek-V4-Flash, optimize Dockerfile with Tsinghua mirrors
This commit is contained in:
1 parent
bd3b0df4f0
commit
70dd2b69af
4 files changed
+30
-7
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
# Qihu-AIFlow 环境配置
|
# Qihu-AIFlow Environment Configuration
|
||||||
# 注:MYSQL_HOST/REDIS_HOST 由 Docker 环境变量传入,本地默认 localhost
|
# Docker Compose uses environment variables directly, local dev uses .env
|
||||||
|
|
||||||
MYSQL_PORT=3306
|
MYSQL_PORT=3306
|
||||||
MYSQL_USER=root
|
MYSQL_USER=root
|
||||||
@@ -10,8 +10,13 @@ REDIS_PORT=6379
|
|||||||
REDIS_PASSWORD=pwd2026
|
REDIS_PASSWORD=pwd2026
|
||||||
|
|
||||||
SECRET_KEY=aiflow-secret-key-change-in-production-2026
|
SECRET_KEY=aiflow-secret-key-change-in-production-2026
|
||||||
APP_ACCESS_URL=https://bot.qihuyun.com
|
APP_ACCESS_URL=http://210.16.161.218:12888
|
||||||
DEBUG=false
|
DEBUG=false
|
||||||
|
|
||||||
# 知识库文件存储目录
|
# Knowledge file storage directory
|
||||||
KNOWLEDGE_STORAGE_DIR=/data/share/project/data/knowledge
|
KNOWLEDGE_STORAGE_DIR=/data/share/project/data/knowledge
|
||||||
|
|
||||||
|
# SiliconFlow API (default LLM provider)
|
||||||
|
SILICONFLOW_API_KEY=sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz
|
||||||
|
SILICONFLOW_BASE_URL=https://api.siliconflow.cn
|
||||||
|
DEFAULT_MODEL=deepseek-ai/DeepSeek-V4-Flash
|
||||||
@@ -3,6 +3,8 @@ FROM python:3.11-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 安装系统依赖(含编译bcrypt/cryptography所需的build-essential)
|
# 安装系统依赖(含编译bcrypt/cryptography所需的build-essential)
|
||||||
|
# Use Tsinghua mirror for faster downloads in China
|
||||||
|
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -24,6 +26,8 @@ COPY frontend/package-lock.json /app/frontend/package-lock.json
|
|||||||
RUN pip install --no-cache-dir -r /app/backend/python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
RUN pip install --no-cache-dir -r /app/backend/python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
||||||
# 安装Node.js (用于前端构建) 并构建前端
|
# 安装Node.js (用于前端构建) 并构建前端
|
||||||
|
# Use Tsinghua mirror for faster downloads in China
|
||||||
|
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
|
|||||||
+13
-1
@@ -27,8 +27,20 @@ services:
|
|||||||
- REDIS_PORT=6379
|
- REDIS_PORT=6379
|
||||||
- REDIS_PASSWORD=pwd2026
|
- REDIS_PASSWORD=pwd2026
|
||||||
- SECRET_KEY=aiflow-secret-key-change-in-production-2026
|
- SECRET_KEY=aiflow-secret-key-change-in-production-2026
|
||||||
- APP_ACCESS_URL=https://bot.qihuyun.com
|
- APP_ACCESS_URL=http://210.16.161.218:12888
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
|
- SILICONFLOW_API_KEY=sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz
|
||||||
|
- SILICONFLOW_BASE_URL=https://api.siliconflow.cn
|
||||||
|
- DEFAULT_MODEL=deepseek-ai/DeepSeek-V4-Flash
|
||||||
|
- SILICONFLOW_API_KEY=sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz
|
||||||
|
- SILICONFLOW_BASE_URL=https://api.siliconflow.cn
|
||||||
|
- DEFAULT_MODEL=deepseek-ai/DeepSeek-V4-Flash
|
||||||
|
- SILICONFLOW_API_KEY=sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz
|
||||||
|
- SILICONFLOW_BASE_URL=https://api.siliconflow.cn
|
||||||
|
- DEFAULT_MODEL=deepseek-ai/DeepSeek-V4-Flash
|
||||||
|
- SILICONFLOW_API_KEY=sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz
|
||||||
|
- SILICONFLOW_BASE_URL=https://api.siliconflow.cn
|
||||||
|
- DEFAULT_MODEL=deepseek-ai/DeepSeek-V4-Flash
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ INSERT IGNORE INTO risk_rules (id, name, type, threshold, duration, is_enabled)
|
|||||||
INSERT IGNORE INTO model_providers (id, name, protocol, api_key, api_base_url) VALUES
|
INSERT IGNORE INTO model_providers (id, name, protocol, api_key, api_base_url) VALUES
|
||||||
('prov-001', 'DeepSeek', 'openai_compatible', '', 'https://api.deepseek.com'),
|
('prov-001', 'DeepSeek', 'openai_compatible', '', 'https://api.deepseek.com'),
|
||||||
('prov-002', 'OpenAI', 'openai_compatible', '', 'https://api.openai.com'),
|
('prov-002', 'OpenAI', 'openai_compatible', '', 'https://api.openai.com'),
|
||||||
('prov-003', '通义千问', 'openai_compatible', '', 'https://dashscope.aliyuncs.com');
|
('prov-003', '通义千问', 'openai_compatible', '', 'https://dashscope.aliyuncs.com'),
|
||||||
|
('prov-004', 'SiliconFlow', 'openai_compatible', 'sk-idsplzeccvmbtyqxcrbhaiwmkzwajmicliunkjkouivepaaz', 'https://api.siliconflow.cn');
|
||||||
|
|
||||||
-- ============================================================
|
-- ============================================================
|
||||||
-- 初始化模型
|
-- 初始化模型
|
||||||
@@ -63,7 +64,8 @@ INSERT IGNORE INTO models (id, provider_id, name, api_key, endpoint, capabilitie
|
|||||||
('model-002', 'prov-002', 'GPT-4o', '', 'https://api.openai.com/v1/chat/completions', '["text", "vision", "tool"]', 60, 'paid', 10.0000, 1, 0, 0),
|
('model-002', 'prov-002', 'GPT-4o', '', 'https://api.openai.com/v1/chat/completions', '["text", "vision", "tool"]', 60, 'paid', 10.0000, 1, 0, 0),
|
||||||
('model-003', 'prov-003', 'Qwen-Max', '', 'https://dashscope.aliyuncs.com/compatible-mode/v1', '["text", "tool"]', 60, 'free', 0.0000, 1, 0, 0),
|
('model-003', 'prov-003', 'Qwen-Max', '', 'https://dashscope.aliyuncs.com/compatible-mode/v1', '["text", "tool"]', 60, 'free', 0.0000, 1, 0, 0),
|
||||||
('model-004', 'prov-001', 'DeepSeek-R1', '', 'https://api.deepseek.com/v1/chat/completions', '["text", "thinking"]', 120, 'paid', 4.0000, 1, 0, 0),
|
('model-004', 'prov-001', 'DeepSeek-R1', '', 'https://api.deepseek.com/v1/chat/completions', '["text", "thinking"]', 120, 'paid', 4.0000, 1, 0, 0),
|
||||||
('model-005', 'prov-003', 'Qwen-Plus', '', 'https://dashscope.aliyuncs.com/compatible-mode/v1', '["text"]', 60, 'free', 0.0000, 0, 0, 0);
|
('model-005', 'prov-003', 'Qwen-Plus', '', 'https://dashscope.aliyuncs.com/compatible-mode/v1', '["text"]', 60, 'free', 0.0000, 0, 0, 0),
|
||||||
|
('model-006', 'prov-004', 'DeepSeek-V4-Flash', '', 'https://api.siliconflow.cn/v1/chat/completions', '["text", "thinking", "tool"]', 60, 'free', 0.0000, 1, 0, 0);
|
||||||
|
|
||||||
-- ============================================================
|
-- ============================================================
|
||||||
-- 初始化会员套餐
|
-- 初始化会员套餐
|
||||||
|
|||||||
Reference in new issue
Block a user