mirror of
https://github.com/BlueSkyXN/DeepAI.git
synced 2026-04-22 23:07:08 +08:00
b9fd4f7d4a
使用O1-Pro针对并发安全性进行了优化
95 lines
2.6 KiB
YAML
95 lines
2.6 KiB
YAML
# 思考链服务配置
|
|
thinking_services:
|
|
- id: 1
|
|
name: "modelscope-deepseek-thinking"
|
|
model: "deepseek-ai/DeepSeek-R1" # 模型配置
|
|
base_url: "https://api-inference.modelscope.cn"
|
|
api_path: "/v1/chat/completions"
|
|
api_key: "sk-xxxxxxxxxxxxxxxx"
|
|
timeout: 600 # 秒
|
|
retry: 2
|
|
weight: 100 # 权重越高优先级越高
|
|
proxy: "" # 可选代理设置,留空则不使用代理
|
|
|
|
- id: 2
|
|
name: "openai-thinking"
|
|
model: "o3-mini" #模型配置
|
|
base_url: "https://api.openai.com"
|
|
api_path: "/v1/chat/completions"
|
|
api_key: "sk-xxxxxxxxxxxxxxxx"
|
|
timeout: 600
|
|
retry: 2
|
|
weight: 50
|
|
proxy: "http://127.0.0.1:7890" # HTTP代理示例
|
|
|
|
# API通道配置
|
|
channels:
|
|
# modelscope 通道
|
|
"1":
|
|
name: "modelscope-channel"
|
|
base_url: "https://api-inference.modelscope.cn"
|
|
api_path: "/v1/chat/completions"
|
|
timeout: 600
|
|
proxy: "" # 不使用代理
|
|
|
|
# OpenAI 通道
|
|
"2":
|
|
name: "openai-channel"
|
|
base_url: "https://api.openai.com"
|
|
api_path: "/v1/chat/completions"
|
|
timeout: 600
|
|
proxy: "socks5://127.0.0.1:7890" # SOCKS5代理示例
|
|
|
|
|
|
|
|
# 全局配置
|
|
global:
|
|
thinking:
|
|
enabled: true # 全局启用思考链
|
|
add_to_all_requests: true # 为所有请求添加思考链
|
|
timeout: 30 # 思考链处理超时时间
|
|
# 配置文件搜索路径
|
|
config_paths:
|
|
- "./config.yaml" # 当前目录
|
|
- "./conf/config.yaml" # conf子目录
|
|
- "/etc/deepai/config.yaml" # Linux系统配置目录
|
|
- "%PROGRAMDATA%/DeepAI/config.yaml" # Windows系统配置目录
|
|
|
|
# 代理配置
|
|
proxy:
|
|
enabled: false # 是否启用全局代理
|
|
default: "" # 默认代理,留空则不使用。会被服务特定代理覆盖
|
|
allow_insecure: true # 是否允许不安全的HTTPS连接
|
|
|
|
# 重试配置
|
|
max_retries: 3
|
|
default_timeout: 300
|
|
|
|
# 需要重试的错误码
|
|
error_codes:
|
|
retry_on:
|
|
- 429 # Rate limit
|
|
- 500 # Internal server error
|
|
- 502 # Bad gateway
|
|
- 503 # Service unavailable
|
|
- 504 # Gateway timeout
|
|
|
|
# 日志配置
|
|
log:
|
|
level: "info" # debug, info, warn, error
|
|
format: "json" # text, json
|
|
output: "file" # console, file
|
|
file_path: "./logs/deepai.log"
|
|
debug:
|
|
enabled: true # 是否启用调试日志
|
|
print_request: true # 打印请求内容
|
|
print_response: true # 打印响应内容
|
|
max_content_length: 1000 # 内容打印最大长度,避免日志过大
|
|
|
|
# 服务配置
|
|
server:
|
|
port: 8888
|
|
host: "0.0.0.0"
|
|
read_timeout: 600
|
|
write_timeout: 600
|
|
idle_timeout: 600 |