Download .env.example from StillWorking/sentinel-face-recognition: direct link, hf CLI and curl.
- Browser
- Download file 8.24 kB
-
https://huggingface.co/StillWorking/sentinel-face-recognition/resolve/main/.env.example
- Command line
-
hf download hf://StillWorking/sentinel-face-recognition/.env.example
-
curl -L -o .env.example https://huggingface.co/StillWorking/sentinel-face-recognition/resolve/main/.env.example
8.24 kB
| # ββ Copy this file to .env and fill in the values ββββββββββββββββββββββββββββ | |
| # | |
| # cp .env.example .env | |
| # # then edit .env and set your API key | |
| # | |
| # NEVER commit the real .env file. If a key was ever committed or shared, | |
| # rotate it in the provider console. | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Google Gemini API key (required for alerts / query parsing) | |
| # Obtain from: https://aistudio.google.com/app/apikey | |
| # Either variable name is accepted; GEMINI_API_KEY takes precedence. | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| GEMINI_API_KEY=your_gemini_api_key_here | |
| # GOOGLE_API_KEY=your_gemini_api_key_here # legacy alias, also accepted | |
| # Gemini model to use for reasoning (change to test different models) | |
| GEMINI_MODEL=gemini-2.5-flash | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Optional cloud fallbacks (tried in order after Gemini) | |
| # Leave blank to skip a provider; the server degrades to the local keyword | |
| # matcher / offline alert instead of crashing. | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| GROQ_API_KEY= | |
| GROQ_MODEL=openai/gpt-oss-120b | |
| COHERE_API_KEY= | |
| COHERE_MODEL=command-r-plus-08-2024 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # cascadeflow guardrail budgets | |
| # These cap per-call LLM spend and latency. Adjust for your workload. | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| CASCADEFLOW_ALERT_BUDGET=0.01 # USD cap for generate_alert() | |
| CASCADEFLOW_SEARCH_BUDGET=0.005 # USD cap for extract_attributes_from_query() | |
| CASCADEFLOW_LATENCY_LIMIT_MS=2000 # advisory target recorded by cascadeflow | |
| # cascadeflow does not abort slow providers, so the API enforces its own hard | |
| # deadlines. The whole Gemini β Groq β Cohere chain is bounded by | |
| # LLM_HARD_TIMEOUT_MS; each provider attempt is bounded by | |
| # LLM_PROVIDER_TIMEOUT_MS. Raise these if you prefer answer quality over the | |
| # 2 s target (for example 8000/4000). | |
| LLM_HARD_TIMEOUT_MS=2000 | |
| LLM_PROVIDER_TIMEOUT_MS=1200 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # API security (shared / networked deployments) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Leave SENTINEL_API_KEY empty for the open local demo. When set, every | |
| # /api/v1 request must send either: | |
| # Authorization: Bearer <key> or X-API-Key: <key> | |
| # Set the matching VITE_API_KEY in frontend/.env. Use a demo key here, not a | |
| # provider key: VITE_ variables are visible in the browser bundle. | |
| SENTINEL_API_KEY= | |
| # Per-client token bucket. RATE_LIMIT_PER_MINUTE=0 disables it. | |
| RATE_LIMIT_PER_MINUTE=60 | |
| RATE_LIMIT_BURST=20 | |
| # Only enable behind a trusted reverse proxy that overwrites X-Forwarded-For. | |
| TRUST_PROXY_HEADERS=0 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Hardware / performance | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Set to "cuda" for GPU inference, "cpu" for CPU-only fallback | |
| TORCH_DEVICE=cuda | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Face detection / matching | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # MTCNN minimum face size in pixels and minimum detection probability | |
| MTCNN_MIN_FACE_SIZE=20 | |
| DETECTION_CONFIDENCE=0.6 | |
| # If the first MTCNN pass finds no face, retry once with these relaxed values. | |
| MTCNN_RETRY_MIN_FACE_SIZE=12 | |
| MTCNN_RETRY_CONFIDENCE=0.45 | |
| # Context margin around the detected face (CelebA-like framing). 1.5 measured | |
| # best on the bundled dataset; lower crops tighter, higher adds more background. | |
| FACE_CROP_MARGIN=1.5 | |
| # Cosine similarity required to report a database match. With both the index | |
| # and the query using MTCNN landmark alignment, correct identities scored | |
| # ~0.98 (min 0.90 over a 48-image sample); unrelated portraits stayed < 0.35. | |
| MATCH_SIMILARITY_THRESHOLD=0.50 | |
| # Hard upload size cap for /analyze-frame (bytes) | |
| MAX_UPLOAD_BYTES=10485760 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # /generate-person image model (optional endpoint) | |
| # Imagen 4 was retired from the Gemini API on 17 Aug 2026. The replacement is | |
| # an image-capable Gemini model called through generate_content(). | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| IMAGE_MODEL=gemini-3.1-flash-image | |
| IMAGE_COST_USD=0.067 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # CORS β comma-separated origins, or "*" to allow all (not recommended) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173,http://localhost:8080,http://127.0.0.1:8080,http://localhost:4173,http://127.0.0.1:4173 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Paths (relative paths are resolved against backend/, then the project root) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| CELEBA_IMAGES_DIR=../Data/img_align_celeba | |
| CELEBA_ATTR_CSV=../Data/list_attr_celeba.csv | |
| FAISS_INDEX_PATH=./index_artifacts/celeb_index.faiss | |
| METADATA_PATH=./index_artifacts/metadata.json | |
| ADAFACE_WEIGHTS=./models_cache/adaface_ir50_ms1mv2.ckpt | |