|
1 | | -# Chart2CSV API Environment |
| 1 | +# Chart2CSV Environment Configuration |
| 2 | +# Copy this file to .env and fill in your values |
| 3 | +# Never commit .env files to version control! |
| 4 | + |
| 5 | +# ============================================ |
| 6 | +# API Keys |
| 7 | +# ============================================ |
| 8 | + |
| 9 | +# Mistral AI API Key (required for LLM extraction and Mistral OCR) |
| 10 | +# Get your API key at: https://console.mistral.ai/ |
| 11 | +# Used for: LLM-based chart extraction (default mode) |
2 | 12 | MISTRAL_API_KEY=your_mistral_api_key_here |
| 13 | + |
| 14 | + |
| 15 | +# ============================================ |
| 16 | +# CORS Configuration (Production) |
| 17 | +# ============================================ |
| 18 | + |
| 19 | +# Comma-separated list of allowed origins for CORS |
| 20 | +# Example: ALLOWED_ORIGINS=https://example.com,https://app.example.com |
| 21 | +# Leave empty to use defaults: |
| 22 | +# - https://kiku-jw.github.io |
| 23 | +# - https://chart2csv.kikuai.dev |
| 24 | +# - http://localhost:3000 |
| 25 | +ALLOWED_ORIGINS= |
| 26 | + |
| 27 | + |
| 28 | +# ============================================ |
| 29 | +# Application Settings |
| 30 | +# ============================================ |
| 31 | + |
| 32 | +# Environment: development | staging | production |
| 33 | +# Affects logging level and error detail exposure |
| 34 | +ENV=production |
| 35 | + |
| 36 | +# API Host and Port (for local development) |
| 37 | +# Production deployments typically use reverse proxy |
| 38 | +API_HOST=0.0.0.0 |
| 39 | +API_PORT=8000 |
| 40 | + |
| 41 | +# Log Level: DEBUG | INFO | WARNING | ERROR | CRITICAL |
| 42 | +LOG_LEVEL=INFO |
| 43 | + |
| 44 | + |
| 45 | +# ============================================ |
| 46 | +# Rate Limiting |
| 47 | +# ============================================ |
| 48 | + |
| 49 | +# Maximum requests per minute per IP |
| 50 | +# Default: 20 |
| 51 | +RATE_LIMIT_PER_MINUTE=20 |
| 52 | + |
| 53 | + |
| 54 | +# ============================================ |
| 55 | +# File Upload Limits |
| 56 | +# ============================================ |
| 57 | + |
| 58 | +# Maximum file size in MB |
| 59 | +# Default: 10 |
| 60 | +MAX_FILE_SIZE_MB=10 |
| 61 | + |
| 62 | +# Maximum image dimensions (width or height in pixels) |
| 63 | +# Default: 10000 |
| 64 | +MAX_IMAGE_DIMENSION=10000 |
| 65 | + |
| 66 | + |
| 67 | +# ============================================ |
| 68 | +# OCR Configuration |
| 69 | +# ============================================ |
| 70 | + |
| 71 | +# OCR Backend: tesseract | mistral | auto |
| 72 | +# - tesseract: Use Tesseract OCR (offline, faster) |
| 73 | +# - mistral: Use Mistral Vision API (online, more accurate) |
| 74 | +# - auto: Try Tesseract first, fallback to Mistral if available |
| 75 | +# Default: auto |
| 76 | +OCR_BACKEND=auto |
| 77 | + |
| 78 | +# Tesseract executable path (optional, auto-detected if in PATH) |
| 79 | +# TESSERACT_CMD=/usr/bin/tesseract |
| 80 | + |
| 81 | + |
| 82 | +# ============================================ |
| 83 | +# Extraction Defaults |
| 84 | +# ============================================ |
| 85 | + |
| 86 | +# Default extraction mode: llm | cv | auto |
| 87 | +# - llm: Use LLM vision (Pixtral) - fastest, most accurate |
| 88 | +# - cv: Use computer vision pipeline - works offline |
| 89 | +# - auto: Try LLM first, fall back to CV |
| 90 | +# Default: llm |
| 91 | +DEFAULT_EXTRACTION_MODE=llm |
| 92 | + |
| 93 | +# Enable overlay image generation |
| 94 | +# Helps debug extraction quality |
| 95 | +# Default: false (for performance) |
| 96 | +GENERATE_OVERLAY=false |
| 97 | + |
| 98 | + |
| 99 | +# ============================================ |
| 100 | +# Cache Configuration |
| 101 | +# ============================================ |
| 102 | + |
| 103 | +# Enable OCR result caching |
| 104 | +# Speeds up repeated extractions of same image |
| 105 | +# Default: true |
| 106 | +ENABLE_OCR_CACHE=true |
| 107 | + |
| 108 | +# Cache directory |
| 109 | +# Default: .cache/ocr |
| 110 | +CACHE_DIR=.cache/ocr |
| 111 | + |
| 112 | +# Cache TTL in days (0 = no expiration) |
| 113 | +# Default: 7 |
| 114 | +CACHE_TTL_DAYS=7 |
| 115 | + |
| 116 | + |
| 117 | +# ============================================ |
| 118 | +# Development / Debugging |
| 119 | +# ============================================ |
| 120 | + |
| 121 | +# Enable debug mode (verbose logging, detailed errors) |
| 122 | +# WARNING: Do not enable in production! |
| 123 | +# Default: false |
| 124 | +DEBUG=false |
| 125 | + |
| 126 | +# Preserve temporary files for debugging |
| 127 | +# Temp images normally deleted after processing |
| 128 | +# Default: false |
| 129 | +KEEP_TEMP_FILES=false |
| 130 | + |
| 131 | +# Enable FastAPI auto-reload (development only) |
| 132 | +# Default: false |
| 133 | +RELOAD=false |
0 commit comments