-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
226 lines (195 loc) · 8.34 KB
/
.env.example
File metadata and controls
226 lines (195 loc) · 8.34 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# ConduitLLM Environment Variables
# Copy this file to .env and configure for your environment
# ===========================================
# Core Database Configuration
# ===========================================
DATABASE_URL=postgresql://conduit:conduitpass@postgres:5432/conduitdb
CONDUIT_SKIP_DATABASE_INIT=false
# ===========================================
# Redis Configuration
# ===========================================
# Option 1: Redis URL format (recommended)
REDIS_URL=redis://redis:6379
# Option 2: Legacy connection string format
# CONDUIT_REDIS_CONNECTION_STRING=redis:6379
CONDUIT_REDIS_INSTANCE_NAME=conduit:
# ===========================================
# RabbitMQ Configuration
# ===========================================
CONDUITLLM__RABBITMQ__HOST=rabbitmq
CONDUITLLM__RABBITMQ__PORT=5672
CONDUITLLM__RABBITMQ__USERNAME=conduit
CONDUITLLM__RABBITMQ__PASSWORD=conduitpass
CONDUITLLM__RABBITMQ__VHOST=/
CONDUITLLM__RABBITMQ__PREFETCHCOUNT=10
CONDUITLLM__RABBITMQ__PARTITIONCOUNT=10
CONDUITLLM__RABBITMQ__REQUESTEDHEARTBEAT=60
CONDUITLLM__RABBITMQ__PUBLISHERCONFIRMATION=true
CONDUITLLM__RABBITMQ__CHANNELMAX=50
CONDUITLLM__RABBITMQ__CONCURRENTMESSAGELIMIT=50
# ===========================================
# API-to-API Authentication
# ===========================================
CONDUIT_API_TO_API_BACKEND_AUTH_KEY=your-secure-key-here
# ===========================================
# Service URLs (Internal Docker Network)
# ===========================================
CONDUIT_API_BASE_URL=http://api:8080
CONDUIT_ADMIN_API_BASE_URL=http://admin:8080
# ===========================================
# External Service URLs (For WebAdmin/Clients)
# ===========================================
CONDUIT_API_EXTERNAL_URL=http://localhost:5000
CONDUIT_ADMIN_API_EXTERNAL_URL=http://localhost:5002
# ===========================================
# Media Storage Configuration
# ===========================================
# ⚠️ CRITICAL FOR PRODUCTION: Without proper S3 configuration, media files are NEVER
# cleaned up when virtual keys are deleted, leading to unbounded storage costs!
# See docs/operations/deployment/media-cleanup-configuration.md for details.
# Storage provider: InMemory (dev only), S3 (production)
CONDUIT_MEDIA_STORAGE_TYPE=InMemory
CONDUITLLM__MEDIA_BASE_URL=http://localhost:5000
# IMPORTANT: Admin API needs the SAME storage configuration as Gateway API
# to enable automatic media cleanup when virtual keys are deleted.
# ===========================================
# S3 Storage Configuration (Production)
# ===========================================
# Both Gateway API and Admin API must have these settings for media cleanup to work!
# Option 1: Simplified format (recommended for Docker)
# CONDUIT_MEDIA_STORAGE_TYPE=S3
# CONDUIT_S3_ENDPOINT=https://YOUR-ENDPOINT
# CONDUIT_S3_ACCESS_KEY_ID=your-access-key
# CONDUIT_S3_SECRET_ACCESS_KEY=your-secret-key
# CONDUIT_S3_BUCKET_NAME=conduit-media
# CONDUIT_S3_REGION=auto
# Option 2: Hierarchical format (for direct .NET configuration)
# CONDUITLLM__STORAGE__PROVIDER=S3
# CONDUITLLM__STORAGE__S3__SERVICEURL=https://YOUR-ENDPOINT
# CONDUITLLM__STORAGE__S3__ACCESSKEY=your-access-key
# CONDUITLLM__STORAGE__S3__SECRETKEY=your-secret-key
# CONDUITLLM__STORAGE__S3__BUCKETNAME=conduit-media
# CONDUITLLM__STORAGE__S3__REGION=auto
# ===========================================
# S3 Provider Examples
# ===========================================
# Cloudflare R2 (recommended - free egress, optimized multipart uploads)
# CONDUIT_MEDIA_STORAGE_TYPE=S3
# CONDUIT_S3_ENDPOINT=https://YOUR-ACCOUNT-ID.r2.cloudflarestorage.com
# CONDUIT_S3_ACCESS_KEY_ID=your-r2-access-key
# CONDUIT_S3_SECRET_ACCESS_KEY=your-r2-secret-key
# CONDUIT_S3_BUCKET_NAME=conduit-media
# CONDUIT_S3_REGION=auto
# AWS S3
# CONDUIT_MEDIA_STORAGE_TYPE=S3
# CONDUIT_S3_ENDPOINT=https://s3.amazonaws.com
# CONDUIT_S3_ACCESS_KEY_ID=your-access-key
# CONDUIT_S3_SECRET_ACCESS_KEY=your-secret-key
# CONDUIT_S3_BUCKET_NAME=conduit-media
# CONDUIT_S3_REGION=us-east-1
# ===========================================
# Media Lifecycle Management
# ===========================================
# ⚠️ CRITICAL: Enable these for automatic cleanup of orphaned media files
# Auto-cleanup when virtual keys are deleted (recommended for production)
# CONDUITLLM__MEDIAMANAGEMENT__ENABLEAUTOCLEANUP=true
# Periodic cleanup of orphaned media files (recommended for production)
# CONDUITLLM__MEDIAMANAGEMENT__ORPHANCLEANUPENABLED=true
# Verification: Check Admin API logs on startup for:
# ✅ "[MediaLifecycleService] Deleted {Count} media files for virtual key {VirtualKeyId}"
# ❌ "[AdminVirtualKeyService] Media lifecycle service not available" = cleanup NOT working!
# ===========================================
# Performance Tracking
# ===========================================
Conduit__PerformanceTracking__Enabled=true
Conduit__PerformanceTracking__IncludeInResponse=true
Conduit__PerformanceTracking__TrackStreamingMetrics=true
# ===========================================
# Logging Configuration
# ===========================================
Logging__LogLevel__Default=Information
Logging__LogLevel__ConduitLLM=Information
Logging__LogLevel__Microsoft=Warning
Logging__LogLevel__Microsoft.Hosting.Lifetime=Information
Logging__LogLevel__Microsoft.EntityFrameworkCore=Warning
# ===========================================
# CORS Configuration
# ===========================================
AdminApi__AllowedOrigins__0=http://localhost:3000
AdminApi__AllowedOrigins__1=http://localhost:8080
# ===========================================
# Health Monitoring Configuration
# ===========================================
# Check intervals and thresholds
HealthMonitoring__CheckIntervalSeconds=30
HealthMonitoring__ConsecutiveFailureThreshold=3
HealthMonitoring__CpuWarningThreshold=70
HealthMonitoring__CpuCriticalThreshold=90
HealthMonitoring__MemoryWarningThreshold=70
HealthMonitoring__MemoryCriticalThreshold=90
# API endpoint health checks (array format for environment variables)
HealthMonitoring__ApiEndpoints__0__Name=AdminAPI
HealthMonitoring__ApiEndpoints__0__Url=http://admin:8080/health
HealthMonitoring__ApiEndpoints__0__TimeoutMs=5000
HealthMonitoring__ApiEndpoints__0__WarningThresholdMs=1000
# System resource monitoring
HealthMonitoring__SystemResources__CpuWarningThreshold=70
HealthMonitoring__SystemResources__CpuCriticalThreshold=90
HealthMonitoring__SystemResources__MemoryWarningThreshold=70
HealthMonitoring__SystemResources__MemoryCriticalThreshold=90
HealthMonitoring__SystemResources__DiskWarningThreshold=80
HealthMonitoring__SystemResources__DiskCriticalThreshold=95
HealthMonitoring__SystemResources__ThreadCountThreshold=500
HealthMonitoring__SystemResources__HandleCountThreshold=10000
HealthMonitoring__SystemResources__DiskPath=/
# ===========================================
# Security Configuration
# ===========================================
# Admin API Security
CONDUIT_ADMIN_RATE_LIMITING_ENABLED=true
CONDUIT_ADMIN_RATE_LIMITING_MAX_REQUESTS=100
CONDUIT_ADMIN_RATE_LIMITING_WINDOW_SECONDS=60
CONDUIT_ADMIN_IP_FILTERING_ENABLED=false
CONDUIT_ADMIN_IP_BANNING_ENABLED=false
CONDUIT_ADMIN_FAILED_AUTH_MAX_ATTEMPTS=5
CONDUIT_ADMIN_FAILED_AUTH_BAN_DURATION_MINUTES=30
# Gateway API Security
CONDUIT_CORE_RATE_LIMITING_ENABLED=true
CONDUIT_CORE_IP_FILTERING_ENABLED=false
CONDUIT_CORE_SECURITY_HEADERS_ENABLED=true
# ===========================================
# WebAdmin Configuration (Next.js)
# ===========================================
NODE_ENV=production
PORT=3000
NEXT_TELEMETRY_DISABLED=1
# Clerk Authentication (replace with your keys)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your-key-here
CLERK_SECRET_KEY=sk_test_your-secret-here
# ===========================================
# Development Environment Overrides
# ===========================================
# Set these for development mode
# ASPNETCORE_ENVIRONMENT=Development
# NODE_ENV=development
# WATCHPACK_POLLING=true
# CHOKIDAR_USEPOLLING=true
# CHOKIDAR_INTERVAL=1000
# FAST_REFRESH=true
# ===========================================
# Provider Credentials (Examples)
# ===========================================
# These should be configured via Admin API, not environment variables
# Shown here for documentation purposes only
#
# OpenAI
# OPENAI_API_KEY=sk-...
#
# Anthropic
# ANTHROPIC_API_KEY=sk-ant-...
#
# Azure OpenAI
# AZURE_OPENAI_API_KEY=...
# AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
#
# Add other providers as needed