Files
gpt-load/.env.example
2025-06-07 11:45:19 +08:00

96 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ===========================================
# OpenAI 多密钥代理服务器配置文件 (Go版本)
# ===========================================
# ===========================================
# 服务器配置
# ===========================================
# 服务器端口
PORT=3000
# 服务器主机地址
HOST=0.0.0.0
# ===========================================
# 密钥管理配置
# ===========================================
# 密钥文件路径
KEYS_FILE=keys.txt
# 起始密钥索引
START_INDEX=0
# 黑名单阈值(错误多少次后拉黑密钥)
BLACKLIST_THRESHOLD=1
# 最大重试次数换key重试
MAX_RETRIES=3
# ===========================================
# OpenAI API 配置
# ===========================================
# 上游 API 地址
OPENAI_BASE_URL=https://api.openai.com
# 请求超时时间(毫秒)
REQUEST_TIMEOUT=30000
# ===========================================
# 性能优化配置
# ===========================================
# 最大连接数
MAX_SOCKETS=100
# 最大空闲连接数
MAX_FREE_SOCKETS=20
# 启用 Keep-Alive
ENABLE_KEEP_ALIVE=true
# 禁用压缩减少CPU开销
DISABLE_COMPRESSION=true
# 缓冲区大小字节建议流式响应使用64KB或更大
BUFFER_SIZE=65536
# 流式传输缓冲区大小字节默认64KB
STREAM_BUFFER_SIZE=65536
# 流式请求响应头超时毫秒默认10秒
STREAM_HEADER_TIMEOUT=10000
# ===========================================
# 日志配置
# ===========================================
# 日志级别 (debug, info, warn, error)
LOG_LEVEL=info
# 日志格式 (text, json)
LOG_FORMAT=text
# 启用文件日志
LOG_ENABLE_FILE=false
# 日志文件路径
LOG_FILE_PATH=logs/app.log
# 启用请求日志(生产环境可设为 false 以提高性能)
LOG_ENABLE_REQUEST=true
# ===========================================
# 认证配置
# ===========================================
# 项目认证密钥(可选,如果设置则启用认证)
# AUTH_KEY=your-secret-key
# ===========================================
# CORS 配置
# ===========================================
# 是否启用 CORS
ENABLE_CORS=true
# 允许的来源(逗号分隔,* 表示允许所有)
ALLOWED_ORIGINS=*