|
| 1 | +# ============================================================================= |
| 2 | +# Warehouse Operational Assistant - Environment Configuration |
| 3 | +# ============================================================================= |
| 4 | +# |
| 5 | +# Copy this file to .env and update with your actual values: |
| 6 | +# cp .env.example .env |
| 7 | +# nano .env # or your preferred editor |
| 8 | +# |
| 9 | +# For Docker Compose deployments, place .env in deploy/compose/ directory |
| 10 | +# ============================================================================= |
| 11 | + |
| 12 | +# ============================================================================= |
| 13 | +# ENVIRONMENT |
| 14 | +# ============================================================================= |
| 15 | +# Set to 'production' for production deployments, 'development' for local dev |
| 16 | +ENVIRONMENT=development |
| 17 | + |
| 18 | +# ============================================================================= |
| 19 | +# DATABASE CONFIGURATION (PostgreSQL/TimescaleDB) |
| 20 | +# ============================================================================= |
| 21 | +# Database connection settings |
1 | 22 | POSTGRES_USER=warehouse |
2 | | -POSTGRES_PASSWORD=warehousepw |
| 23 | +POSTGRES_PASSWORD=changeme # ⚠️ CHANGE IN PRODUCTION! |
3 | 24 | POSTGRES_DB=warehouse |
| 25 | +DB_HOST=localhost |
| 26 | +DB_PORT=5435 |
4 | 27 |
|
5 | | -# Database Configuration |
6 | | -PGHOST=127.0.0.1 |
7 | | -PGPORT=5435 |
8 | | - |
9 | | -# Redis Configuration |
10 | | -REDIS_HOST=127.0.0.1 |
11 | | -REDIS_PORT=6379 |
| 28 | +# Alternative database URL format (overrides individual settings above) |
| 29 | +# DATABASE_URL=postgresql://warehouse:changeme@localhost:5435/warehouse |
12 | 30 |
|
13 | | -# Kafka Configuration |
14 | | -KAFKA_BROKER=kafka:9092 |
| 31 | +# ============================================================================= |
| 32 | +# SECURITY |
| 33 | +# ============================================================================= |
| 34 | +# JWT Secret Key - REQUIRED for production, optional for development |
| 35 | +# Generate a strong random key: openssl rand -hex 32 |
| 36 | +# Minimum 32 characters recommended |
| 37 | +JWT_SECRET_KEY=your-strong-random-secret-minimum-32-characters-change-this-in-production |
15 | 38 |
|
16 | | -# Milvus Configuration |
17 | | -MILVUS_HOST=127.0.0.1 |
18 | | -MILVUS_PORT=19530 |
| 39 | +# Admin user default password (change in production!) |
| 40 | +DEFAULT_ADMIN_PASSWORD=changeme |
19 | 41 |
|
20 | | -# NVIDIA NIM Configuration |
21 | | -NVIDIA_API_KEY=your_nvidia_ngc_api_key_here |
22 | | -LLM_NIM_URL=https://integrate.api.nvidia.com/v1 |
23 | | -EMBEDDING_NIM_URL=https://integrate.api.nvidia.com/v1 |
| 42 | +# ============================================================================= |
| 43 | +# REDIS CONFIGURATION |
| 44 | +# ============================================================================= |
| 45 | +REDIS_HOST=localhost |
| 46 | +REDIS_PORT=6379 |
| 47 | +REDIS_PASSWORD= # Leave empty for development |
| 48 | +REDIS_DB=0 |
24 | 49 |
|
25 | | -# Optional: NeMo Guardrails Configuration |
26 | | -RAIL_API_KEY=your_nvidia_ngc_api_key_here |
27 | | -DATABASE_URL=postgresql://warehouse:warehousepw@localhost:5435/warehouse |
| 50 | +# ============================================================================= |
| 51 | +# VECTOR DATABASE (Milvus) |
| 52 | +# ============================================================================= |
| 53 | +MILVUS_HOST=localhost |
| 54 | +MILVUS_PORT=19530 |
| 55 | +MILVUS_USER=root |
| 56 | +MILVUS_PASSWORD=Milvus |
28 | 57 |
|
29 | | -# GPU Acceleration Configuration |
| 58 | +# GPU Acceleration for Milvus |
30 | 59 | MILVUS_USE_GPU=true |
31 | 60 | MILVUS_GPU_DEVICE_ID=0 |
32 | 61 | CUDA_VISIBLE_DEVICES=0 |
33 | 62 | MILVUS_INDEX_TYPE=GPU_CAGRA |
34 | 63 | MILVUS_COLLECTION_NAME=warehouse_docs_gpu |
35 | 64 |
|
| 65 | +# ============================================================================= |
| 66 | +# MESSAGE QUEUE (Kafka) |
| 67 | +# ============================================================================= |
| 68 | +KAFKA_BOOTSTRAP_SERVERS=localhost:9092 |
| 69 | +# Alternative: KAFKA_BROKER=kafka:9092 |
| 70 | + |
| 71 | +# ============================================================================= |
| 72 | +# NVIDIA NIM LLM CONFIGURATION |
| 73 | +# ============================================================================= |
| 74 | +# |
| 75 | +# IMPORTANT: Different models use different endpoints! |
| 76 | +# |
| 77 | +# For the 49B model (llama-3.3-nemotron-super-49b-v1): |
| 78 | +# - Use: https://api.brev.dev/v1 |
| 79 | +# - This is the correct endpoint for the 49B model |
| 80 | +# |
| 81 | +# For other NVIDIA NIM models: |
| 82 | +# - Use: https://integrate.api.nvidia.com/v1 |
| 83 | +# - This is the standard NVIDIA NIM endpoint |
| 84 | +# |
| 85 | +# For self-hosted NIM instances: |
| 86 | +# - Use your own endpoint URL (e.g., http://localhost:8000/v1 or https://your-nim-instance.com/v1) |
| 87 | +# - Ensure your NIM instance is accessible and properly configured |
| 88 | +# |
| 89 | +# Your NVIDIA API key (same key works for both endpoints) |
| 90 | +NVIDIA_API_KEY=your-nvidia-api-key-here |
| 91 | + |
| 92 | +# LLM Service Endpoint |
| 93 | +# For 49B model: https://api.brev.dev/v1 |
| 94 | +# For other NIMs: https://integrate.api.nvidia.com/v1 |
| 95 | +# For self-hosted: http://your-nim-host:port/v1 |
| 96 | +LLM_NIM_URL=https://api.brev.dev/v1 |
| 97 | + |
| 98 | +# LLM Model Identifier |
| 99 | +# Example for 49B model: |
| 100 | +LLM_MODEL=nvcf:nvidia/llama-3.3-nemotron-super-49b-v1:dep-36ZiLbQIG2ZzK7gIIC5yh1E6lGk |
| 101 | + |
| 102 | +# LLM Generation Parameters |
| 103 | +LLM_TEMPERATURE=0.1 |
| 104 | +LLM_MAX_TOKENS=2000 |
| 105 | +LLM_TOP_P=1.0 |
| 106 | +LLM_FREQUENCY_PENALTY=0.0 |
| 107 | +LLM_PRESENCE_PENALTY=0.0 |
| 108 | +LLM_CLIENT_TIMEOUT=120 # Timeout in seconds |
| 109 | + |
| 110 | +# LLM Caching |
| 111 | +LLM_CACHE_ENABLED=true |
| 112 | +LLM_CACHE_TTL_SECONDS=300 # Cache TTL in seconds (5 minutes) |
| 113 | + |
| 114 | +# ============================================================================= |
| 115 | +# EMBEDDING SERVICE CONFIGURATION |
| 116 | +# ============================================================================= |
| 117 | +# Embedding service endpoint (typically uses NVIDIA endpoint) |
| 118 | +EMBEDDING_NIM_URL=https://integrate.api.nvidia.com/v1 |
| 119 | +# Embedding API key (usually same as NVIDIA_API_KEY) |
| 120 | +# EMBEDDING_API_KEY=your-embedding-api-key # Defaults to NVIDIA_API_KEY if not set |
| 121 | + |
| 122 | +# ============================================================================= |
| 123 | +# CORS CONFIGURATION |
| 124 | +# ============================================================================= |
| 125 | +# Allowed origins for CORS (comma-separated) |
| 126 | +# Add your frontend URLs here |
| 127 | +CORS_ORIGINS=http://localhost:3001,http://localhost:3000,http://127.0.0.1:3001,http://127.0.0.1:3000 |
| 128 | + |
| 129 | +# ============================================================================= |
| 130 | +# UPLOAD & REQUEST LIMITS |
| 131 | +# ============================================================================= |
| 132 | +# Maximum request size in bytes (default: 10MB) |
| 133 | +MAX_REQUEST_SIZE=10485760 |
| 134 | + |
| 135 | +# Maximum upload size in bytes (default: 50MB) |
| 136 | +MAX_UPLOAD_SIZE=52428800 |
| 137 | + |
| 138 | +# ============================================================================= |
| 139 | +# NeMo Guardrails Configuration |
| 140 | +# ============================================================================= |
| 141 | +# RAIL_API_KEY=your_nvidia_ngc_api_key_here |
| 142 | + |
| 143 | +# ============================================================================= |
36 | 144 | # Document Extraction Agent - NVIDIA NeMo API Keys |
37 | | -NEMO_RETRIEVER_API_KEY=your_nvidia_ngc_api_key_here |
38 | | -NEMO_OCR_API_KEY=your_nvidia_ngc_api_key_here |
39 | | -NEMO_PARSE_API_KEY=your_nvidia_ngc_api_key_here |
40 | | -LLAMA_NANO_VL_API_KEY=your_nvidia_ngc_api_key_here |
41 | | -LLAMA_70B_API_KEY=your_nvidia_ngc_api_key_here |
| 145 | +# ============================================================================= |
| 146 | +# NEMO_RETRIEVER_API_KEY=your_nvidia_ngc_api_key_here |
| 147 | +# NEMO_OCR_API_KEY=your_nvidia_ngc_api_key_here |
| 148 | +# NEMO_PARSE_API_KEY=your_nvidia_ngc_api_key_here |
| 149 | +# LLAMA_NANO_VL_API_KEY=your_nvidia_ngc_api_key_here |
| 150 | +# LLAMA_70B_API_KEY=your_nvidia_ngc_api_key_here |
| 151 | + |
| 152 | +# ============================================================================= |
| 153 | +# EXTERNAL SERVICE INTEGRATIONS |
| 154 | +# ============================================================================= |
| 155 | +# WMS_API_KEY=your-wms-api-key |
| 156 | +# ERP_API_KEY=your-erp-api-key |
| 157 | + |
| 158 | +# ============================================================================= |
| 159 | +# NOTES FOR DEVELOPERS |
| 160 | +# ============================================================================= |
| 161 | +# |
| 162 | +# 1. LLM Endpoint Configuration: |
| 163 | +# - The 49B model REQUIRES https://api.brev.dev/v1 |
| 164 | +# - Other NIM models use https://integrate.api.nvidia.com/v1 |
| 165 | +# - Both endpoints use the same NVIDIA_API_KEY |
| 166 | +# - You can deploy NIMs on your own instances and consume them via endpoint |
| 167 | +# (e.g., http://localhost:8000/v1 or https://your-nim-instance.com/v1) |
| 168 | +# - For self-hosted NIMs, ensure the endpoint is accessible and properly configured |
| 169 | +# |
| 170 | +# 2. Security: |
| 171 | +# - NEVER commit .env files to version control |
| 172 | +# - Change all default passwords in production |
| 173 | +# - Use strong, unique JWT_SECRET_KEY in production |
| 174 | +# - JWT_SECRET_KEY is REQUIRED in production (app will fail to start without it) |
| 175 | +# |
| 176 | +# 3. Database: |
| 177 | +# - Default port 5435 is used to avoid conflicts with standard PostgreSQL (5432) |
| 178 | +# - Ensure Docker containers are running before starting the backend |
| 179 | +# |
| 180 | +# 4. Testing: |
| 181 | +# - View logs in real-time: ./scripts/view_logs.sh |
| 182 | +# - Restart backend: ./restart_backend.sh |
| 183 | +# - Check health: curl http://localhost:8001/api/v1/health |
| 184 | +# |
| 185 | +# 5. Getting NVIDIA API Keys: |
| 186 | +# - Sign up at: https://build.nvidia.com/ |
| 187 | +# - Get your API key from the NVIDIA dashboard |
| 188 | +# - The same key works for both brev.dev and integrate.api.nvidia.com endpoints |
| 189 | +# |
| 190 | +# ============================================================================= |
0 commit comments