Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
105 lines (95 loc) · 4.72 KB
/
Copy path.env.example
File metadata and controls
105 lines (95 loc) · 4.72 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# FreeDeepseekAPI — example configuration.
# All variables are optional; the defaults shown below are what the code uses.
# Copy this file to .env and override as needed (a real .env is gitignored).
# server.js, npm run auth and npm run doctor load .env automatically; variables
# already set in the environment take precedence over the file.
# ── HTTP server ──
PORT=9655
# Loopback-only by default. Use 0.0.0.0 only when remote access is intentional.
HOST=127.0.0.1
# Optional bearer token required by every non-health endpoint. Strongly
# recommended whenever HOST is not a loopback address.
# PROXY_API_KEY=replace-with-a-long-random-value
# Read the bearer token from a mounted secret instead of the environment.
# PROXY_API_KEY_FILE=/run/secrets/proxy-api-key
# Fail startup when neither key source is set (enabled by Containerfile).
REQUIRE_PROXY_API_KEY=0
# Browser requests are accepted from loopback origins. Add exact remote UI
# origins as a comma-separated allowlist when needed.
# PROXY_CORS_ORIGINS=https://ui.example.com,http://192.168.1.20:3000
# ── Account auth source ──
# The pool loads DeepSeek accounts from files. Use either a single file or a
# directory of *.json files (one account per file).
# Default: deepseek-auth.json next to server.js. Relative paths resolve
# against the directory npm start runs in.
# DEEPSEEK_AUTH_PATH=./deepseek-auth.json
# DEEPSEEK_AUTH_DIR=./data/accounts
# ── Account pool ──
# Cooldown in milliseconds applied to an account after HTTP 401/403/429
# (default: 600000 = 10 minutes). A Retry-After header wins when present.
DEEPSEEK_ACCOUNT_COOLDOWN_MS=600000
# Shorter cooldown after DeepSeek's "Too many messages" throttling.
DEEPSEEK_RATE_LIMIT_COOLDOWN_MS=60000
# ── Long agent sessions ──
# Maximum characters sent to DeepSeek Web after compacting old context.
# Lower this if the Web endpoint reports that the content is too long.
DEEPSEEK_MAX_PROMPT_CHARS=80000
# Fresh-session retries for an empty/context-too-long response (default: 2).
DEEPSEEK_MAX_RETRIES=2
# Everything one remote DeepSeek chat may accumulate before the proxy starts a
# fresh chat with a compacted prompt (default: 3 x DEEPSEEK_MAX_PROMPT_CHARS).
DEEPSEEK_MAX_SESSION_CHARS=240000
# ── DeepSeek Web API ──
# model_type sent to the Web API. DeepSeek merged Instant/Expert/Vision into a
# single mode on 2026-09-10, so every alias uses this one value. Leave it empty
# (DEEPSEEK_MODEL_TYPE=) to omit the field.
DEEPSEEK_MODEL_TYPE=default
# x-client-version / x-app-version headers of the emulated web client.
DEEPSEEK_CLIENT_VERSION=2.0.0
# Upstream base URL (only change it for a mirror or offline testing).
DEEPSEEK_BASE_URL=https://chat.deepseek.com
# ── Images (live-verified flow; DeepSeek Web API may change) ──
# Upload inline images (data: URLs / base64) to DeepSeek and reference them in
# the completion. Enabled by default; set to 0 to disable image uploads.
DEEPSEEK_IMAGE_UPLOAD=1
# Most recent images sent into a new chat, and the size cap per image.
DEEPSEEK_MAX_IMAGES=4
DEEPSEEK_MAX_IMAGE_BYTES=7340032
# How long to wait for DeepSeek to process an uploaded image, and poll interval.
DEEPSEEK_FILE_TIMEOUT_MS=60000
DEEPSEEK_FILE_POLL_MS=1000
# ── Timeouts and limits ──
# Connect/response-header timeout for each DeepSeek request.
DEEPSEEK_FETCH_TIMEOUT_MS=60000
# A streaming answer fails after this long without any data...
DEEPSEEK_STREAM_IDLE_TIMEOUT_MS=60000
# ...or after this long in total (thinking answers often exceed one minute).
DEEPSEEK_STREAM_MAX_MS=600000
# stream=true clients get an SSE ": keep-alive" comment after this much silence
# (e.g. while a tool-call answer is buffered).
DEEPSEEK_STREAM_KEEPALIVE_MS=10000
# Wall-clock budget for retry/continuation loops of one inbound request.
DEEPSEEK_REQUEST_DEADLINE_MS=120000
# Maximum concurrent completions before the proxy answers 503.
DEEPSEEK_MAX_CONCURRENT=24
# ── Startup (deploy / CI) ──
# Set either to 1/true to start the proxy immediately and skip the menu.
NON_INTERACTIVE=0
SKIP_ACCOUNT_MENU=0
# ── Chrome auth helper (scripts/deepseek_chrome_auth.js) ──
# Path to a Chrome / Chrome-for-Testing binary (auto-detected when empty).
CHROME_PATH=
# Remote-debugging port for the auth browser (default: 9334).
DEEPSEEK_CHROME_PORT=
# Chrome profile directory (default: ./.chrome-for-testing-profile-deepseek,
# recreated on every run unless DEEPSEEK_KEEP_CHROME_PROFILE=1).
DEEPSEEK_CHROME_PROFILE=
# Keep the Chrome profile between runs (1/true).
DEEPSEEK_KEEP_CHROME_PROFILE=0
# Reuse an already-running Chrome instance (1/true).
DEEPSEEK_REUSE_CHROME=0
# ── Misc ──
# Pre-set a token for non-interactive auth import.
# DEEPSEEK_TOKEN=
# Run scripts/doctor.js without network checks (1/true).
# DOCTOR_OFFLINE=0