-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
182 lines (153 loc) · 6.36 KB
/
.env.example
File metadata and controls
182 lines (153 loc) · 6.36 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
# Arctic Text2SQL Agent - Environment Configuration
# Copy this file to .env and fill in your values
# DO NOT commit .env to version control!
# =============================================================================
# HuggingFace Configuration
# =============================================================================
# Get your token from: https://huggingface.co/settings/tokens
HUGGINGFACE_TOKEN=your_huggingface_token_here
# Model configuration
TEXT2SQL_MODEL=Snowflake/Arctic-Text2SQL-R1-7B
MODEL_DEVICE=auto # Options: auto, cuda, cpu, mps
ENABLE_8BIT_QUANTIZATION=false
ENABLE_4BIT_QUANTIZATION=false
# =============================================================================
# Database Configuration
# =============================================================================
# Primary database URL (supports PostgreSQL, MySQL, SQLite)
# PostgreSQL: postgresql://user:password@localhost:5432/dbname
# MySQL: mysql://user:password@localhost:3306/dbname
# SQLite: sqlite:///./data/text2sql.db
DATABASE_URL=sqlite:///./data/text2sql.db
# Connection pool settings
DB_POOL_SIZE=5
DB_MAX_OVERFLOW=10
DB_POOL_TIMEOUT=30
# =============================================================================
# API Configuration
# =============================================================================
API_HOST=0.0.0.0
API_PORT=8000
API_DEBUG=false
# CORS settings (comma-separated origins)
CORS_ORIGINS=http://localhost:3000,http://localhost:8080
# Rate limiting
RATE_LIMIT_PER_MINUTE=60
RATE_LIMIT_BURST=10
# =============================================================================
# Agent Configuration
# =============================================================================
# Maximum steps for agent reasoning loop
AGENT_MAX_STEPS=5
# Minimum confidence score to return results (0.0 - 1.0)
AGENT_MIN_CONFIDENCE=0.7
# Enable output validation
AGENT_ENABLE_VALIDATION=true
# Agent model backend (local or hf_inference)
AGENT_MODEL_BACKEND=local
# Inference Providers settings (used when AGENT_MODEL_BACKEND=hf_inference)
AGENT_INFERENCE_PROVIDER=hf-inference
AGENT_INFERENCE_TIMEOUT=120
# AGENT_INFERENCE_BASE_URL=https://your-endpoint.example.com
# AGENT_INFERENCE_BILL_TO=your-org
# AGENT_INFERENCE_MAX_TOKENS=512
# AGENT_INFERENCE_TEMPERATURE=0.1
# AGENT_INFERENCE_TOP_P=0.95
# =============================================================================
# Security Configuration (Phase 2.2: Security Implementation)
# =============================================================================
# CRITICAL: Change these values in production!
# Secret key for JWT tokens
# Generate a secure key with: openssl rand -hex 32
# Or with Python: python -c "import secrets; print(secrets.token_hex(32))"
SECRET_KEY=your-secret-key-change-in-production-MUST-BE-CHANGED
# JWT settings
JWT_ALGORITHM=HS256
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30
# Authentication toggles
AUTH_ENABLED=true
JWT_AUTH_ENABLED=true
API_KEY_AUTH_ENABLED=true
# API Key Authentication
# Format: key:scope1|scope2, key2:scope1|scope2
# For production, use separate API keys per client/service
API_KEYS=your-api-key-change-in-production:read|write
# Default scopes for keys without an explicit scope list
API_KEY_SCOPES=read
# Optional user credentials for issuing JWTs
# Format: username:password:scope1|scope2;username2:password:scope1|scope2
AUTH_USERS=admin:change_me:admin|write|read
# JWT claims
JWT_SCOPES_CLAIM=scopes
JWT_ROLE_CLAIM=role
# Mutation scopes required for write/management endpoints
MUTATION_SCOPES=write,admin
# Rate limiting storage (Redis recommended in production)
# RATE_LIMIT_STORAGE_URL=redis://localhost:6379/1
RATE_LIMIT_HEADERS_ENABLED=true
# =============================================================================
# Logging Configuration
# =============================================================================
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO
# Log format: json, console
LOG_FORMAT=json
# Enable request logging
LOG_REQUESTS=true
# =============================================================================
# Monitoring Configuration
# =============================================================================
# Enable Prometheus metrics
ENABLE_METRICS=true
METRICS_PORT=9090
# =============================================================================
# Cache Configuration (Issue #8: Performance Optimization)
# =============================================================================
# Redis URL for caching (optional - falls back to in-memory if not set)
# REDIS_URL=redis://localhost:6379/0
# Default cache TTL in seconds
CACHE_TTL=3600
# TTL for different cache types
CACHE_QUERY_TTL=3600 # Query result cache (1 hour)
CACHE_MODEL_TTL=7200 # Model output cache (2 hours)
CACHE_SCHEMA_TTL=86400 # Schema cache (24 hours)
# Enable/disable caching globally
CACHE_ENABLED=true
# Maximum in-memory cache entries (when Redis unavailable)
CACHE_MAX_MEMORY_ENTRIES=1000
# =============================================================================
# Few-Shot Learning (Issue #16)
# =============================================================================
FEWSHOT_ENABLED=true
FEWSHOT_MAX_EXAMPLES=3
FEWSHOT_MIN_SIMILARITY=0.2
FEWSHOT_EMBEDDING_STRATEGY=hash # Options: hash, model
FEWSHOT_EMBEDDING_DIM=256
FEWSHOT_EMBEDDING_MAX_LENGTH=256
FEWSHOT_INCLUDE_DEFAULT_EXAMPLES=false
FEWSHOT_VERIFIED_ONLY=true
FEWSHOT_USE_ON_FIRST_ATTEMPT=true
FEWSHOT_USE_ON_RETRY=true
# =============================================================================
# Feedback Collection (Issue #16)
# =============================================================================
FEEDBACK_ENABLED=true
FEEDBACK_AUTO_PROMOTE_TO_EXAMPLES=false
FEEDBACK_MIN_RATING_FOR_PROMOTION=4
# =============================================================================
# Fine-Tuning Pipeline (Issue #16)
# =============================================================================
FINETUNE_ENABLED=false
FINETUNE_OUTPUT_DIR=./data/fine_tuning
FINETUNE_DATASET_NAME=text2sql_finetune
FINETUNE_MAX_EXAMPLES=5000
FINETUNE_INCLUDE_FEEDBACK=true
FINETUNE_TRAIN_EPOCHS=3
FINETUNE_BATCH_SIZE=2
FINETUNE_LEARNING_RATE=2e-5
FINETUNE_MAX_SEQ_LENGTH=1024
# =============================================================================
# Model Versioning (Issue #16)
# =============================================================================
MODEL_VERSION_ENABLED=true
MODEL_VERSION_ACTIVE_VERSION_ID=