Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
116 lines (102 loc) · 5.01 KB
/
Copy path.env.example
File metadata and controls
116 lines (102 loc) · 5.01 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
106
107
108
109
110
111
112
113
114
115
116
# Copy to .env and fill in the secrets, then (local, all-in-one):
# docker compose -f docker-compose.yaml -f docker-compose.postgres.yml -f docker-compose.traefik.yml up -d --build
# --- Environment ---
ENV=production
# Log verbosity: DEBUG | INFO | WARNING | ERROR
LOG_LEVEL=INFO
# --- Reverse proxy (bundled Traefik) ---
# Host ports the bundled Traefik (docker-compose.traefik.yml) publishes. Locally the dashboard is at
# http://localhost:${HTTP_PORT} and the API at http://localhost:${HTTP_PORT}/api. For a real deployment set
# HTTP_PORT=80 and HTTPS_PORT=443 (see the production block at the bottom).
HTTP_PORT=8080
HTTPS_PORT=8443
# --- Public domain ---
# Host the proxy is served on. Leave as localhost for the local setup; set it to your domain for a real deployment
# (dashboard at https://${DOMAIN}/, API at https://${DOMAIN}/api). Also used as the CORS origin.
DOMAIN=localhost
# --- Database ---
# With the bundled Postgres (docker-compose.postgres.yml), leave POSTGRES_HOST=postgres (the compose service name).
# To use your own Postgres, point it there and omit docker-compose.postgres.yml from the up command.
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=codex_proxy
POSTGRES_PASSWORD=change-me-postgres
POSTGRES_DB=codex_proxy
# --- Secrets (REQUIRED; the backend refuses to start with empty/placeholder/weak values) ---
# Encrypts pooled-account OAuth tokens at rest.
# Generate: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
FERNET_KEY=
# Dashboard admin login.
ADMIN_USERNAME=admin
ADMIN_PASSWORD=
# Signs admin session JWTs (must be >= 32 chars).
# Generate: python -c "import secrets; print(secrets.token_urlsafe(48))"
JWT_SECRET=
# Rotation policy (per-account threshold, cooldown, failover budget) is configured per account in the dashboard,
# Requests wait up to 150 seconds for a cooling/refreshing account before a 503.
POOL_WAIT_TIMEOUT_SECONDS=150
POOL_WAIT_POLL_INTERVAL_SECONDS=2
# Short circuit for transient upstream failures; this is not a quota reset.
TRANSIENT_UPSTREAM_COOLDOWN_SECONDS=5
# not here. New accounts start at 1.0 / 60s / 3.
# How often the quota-refresher sidecar re-probes each account's usage + subscription tier (seconds).
QUOTA_REFRESH_INTERVAL_SECONDS=60
# Demand-triggered account-window warm-up. No synthetic traffic is sent while
# idle; after real traffic pushes aggregate five-hour pool usage to this
# threshold, all other eligible cold accounts are warmed in one batch.
WARMUP_ENABLED=true
FALLBACK_GENERATION_CANARY_ENABLED=true
FALLBACK_CANARY_MAX_OUTPUT_TOKENS=1
MODEL_CONCURRENCY_LIMITS_JSON={}
TIER_CONCURRENCY_LIMITS_JSON={}
WARMUP_TRIGGER_POOL_USAGE_PCT=0.20
WARMUP_WEEKLY_RESERVE_PCT=0.90
WARMUP_MODEL=gpt-6-luna
# Comma-separated model IDs exposed by the local catalog and dashboard.
# Defaults shown here; remove an entry or add a model ID to change the catalog.
ALLOWED_MODELS=gpt-5.5,gpt-5.6-luna,gpt-5.6-sol,gpt-5.6-terra,gpt-6-astra,gpt-6-sol,gpt-6-luna,gpt-6.1-sol,codex-auto-review
# Default proxy rate limit (requests/minute) for API keys with no explicit override; 0 = unlimited.
DEFAULT_KEY_RATE_LIMIT_PER_MINUTE=0
# Version sent to Codex's model catalog when an OpenAI-compatible client omits it.
CODEX_CLIENT_VERSION=0.157.0
MODEL_CATALOG_REFRESH_INTERVAL_SECONDS=21600
# Approved outbound egress paths. The first enabled target is the default.
# Each proxy target is an object with a stable id, a dashboard label, the
# internal relay URL, and the EC2 private/public mapping. `relay_auth` makes
# the relay require EGRESS_RELAY_USERNAME/EGRESS_RELAY_TOKEN.
EGRESS_TARGETS_JSON=
DEFAULT_EGRESS_MAX_CONCURRENCY=32
EGRESS_RELAY_USERNAME=recallr
EGRESS_RELAY_TOKEN=
# --- Raw request/response archive (S3-compatible, e.g. MinIO) ---
# The proxy writes raw request.json and response.json per interaction. Keep
# ARCHIVE_REQUIRED=true when every body
# must be retained; an unavailable bucket then returns 503 instead of losing data.
ARCHIVE_ENABLED=false
ARCHIVE_REQUIRED=true
ARCHIVE_S3_ENDPOINT_URL=http://minio:9000
ARCHIVE_S3_REGION=us-east-1
ARCHIVE_S3_BUCKET=codex-proxy
ARCHIVE_S3_PREFIX=
ARCHIVE_S3_ACCESS_KEY_ID=
ARCHIVE_S3_SECRET_ACCESS_KEY=
# Optional read-only credentials for the admin request explorer.
ARCHIVE_S3_READ_ACCESS_KEY_ID=
ARCHIVE_S3_READ_SECRET_ACCESS_KEY=
ARCHIVE_S3_FORCE_PATH_STYLE=true
ARCHIVE_S3_MAX_ATTEMPTS=4
ARCHIVE_HOT_RETENTION_DAYS=2
ARCHIVE_RETENTION_ENABLED=false
ARCHIVE_RETENTION_INTERVAL_SECONDS=3600
ARCHIVE_BORG_HOST_DIR=/srv/codex-proxy/borg
ARCHIVE_BORG_REPOSITORY=/borg/repository
ARCHIVE_RETENTION_WORK_DIR=/borg/work
ARCHIVE_RETENTION_BATCH_BYTES=536870912
ARCHIVE_RETENTION_MIN_FREE_GIB=10
ARCHIVE_RETENTION_DELETE_MINIO=false
# --- Production HTTPS (bundled Traefik + Let's Encrypt) ---
# For a real deployment, set DOMAIN above to your host, then uncomment these and set HTTP_PORT=80 / HTTPS_PORT=443.
# TRAEFIK_ENTRYPOINT switches the routers from plain HTTP (`web`) to TLS (`websecure`); ACME_EMAIL is the contact
# Let's Encrypt registers for the certificate.
# TRAEFIK_ENTRYPOINT=websecure
# ACME_EMAIL=you@example.com