forked from laowang74152/gpt2api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
73 lines (63 loc) · 1.65 KB
/
Copy pathconfig.example.yaml
File metadata and controls
73 lines (63 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
app:
name: gpt2api
env: dev # dev | prod
listen: ":8080"
base_url: "http://localhost:8080"
log:
level: info # debug | info | warn | error
format: console # console | json
output: stdout # stdout | /var/log/gpt2api.log
mysql:
dsn: "gpt2api:gpt2api@tcp(127.0.0.1:3306)/gpt2api?parseTime=true&loc=Local&charset=utf8mb4&collation=utf8mb4_unicode_ci"
# 开发期 100 够用;生产目标 2000 chat SSE + 1000 图,推荐 500,MySQL 侧 max_connections>=1000
max_open_conns: 100
max_idle_conns: 20
conn_max_lifetime_sec: 3600
redis:
addr: "127.0.0.1:6379"
password: ""
db: 0
# 开发期 100;生产推荐 500(锁 + 队列 + 令牌桶并发高)
pool_size: 100
jwt:
secret: "CHANGE_ME_TO_RANDOM_32_BYTES_SECRET"
access_ttl_sec: 86400
refresh_ttl_sec: 2592000
issuer: "gpt2api"
crypto:
# 32 字节 hex(64 字符),用于 AES-256-GCM 加密账号 AT / cookies
aes_key: "CHANGE_ME_TO_64_HEX_CHARS_AES_256_KEY_000000000000000000000000"
security:
bcrypt_cost: 10
cors_origins:
- "http://localhost:5173"
- "http://localhost:5174"
# 账号池调度
scheduler:
min_interval_sec: 60
daily_usage_ratio: 0.6 # 单号日消耗熔断阈值
lock_ttl_sec: 1200
cooldown_429_sec: 600 # 连续 429 冷却
warned_pause_hours: 24
# 上游 chatgpt.com
upstream:
base_url: "https://chatgpt.com"
request_timeout_sec: 60
sse_read_timeout_sec: 300
# 支付(易支付)
epay:
gateway_url: ""
pid: ""
key: ""
notify_url: ""
return_url: ""
sign_type: "MD5"
expires_min: 30
smtp:
host: ""
port: 465
username: ""
password: ""
from: ""
from_name: "GPT2API"
use_tls: true