# ── Public API auth ─────────────────────────────────────────────────────────
# LMDB file used for fast API key validation (read-only for this service).
PUBLIC_API_KEYS_LMDB_PATH=/var/lib/vectordb/apikeys.lmdb
# Fixed-window rate limit per API key.
PUBLIC_API_RATE_LIMIT_PER_MINUTE=120
# Rate-limit window size in seconds.
PUBLIC_API_RATE_LIMIT_WINDOW_SECONDS=60

# ── Internal admin auth ─────────────────────────────────────────────────────
# Exclusive key for internal-only administrative operations.
ADMIN_KEY=development-admin-key-change-me
ADMIN_PERSIST_TIMEOUT_SECONDS=300

# ── Persistent deletion audit ───────────────────────────────────────────────
DELETE_AUDIT_LMDB_PATH=/app/vector_data_storage/delete-audit.lmdb
DELETE_AUDIT_LMDB_MAP_SIZE_BYTES=268435456

# ── Helper script defaults ──────────────────────────────────────────────────
# Optional defaults for scripts/insert_test_data.py.
VECTRA_PUBLIC_API_KEY=
VECTRA_API_BASE_URL=http://127.0.0.1:8888
VECTRA_COLLECTION=TESTS
VECTRA_TOTAL=100000
VECTRA_BATCH=1000
VECTRA_DIM=128
VECTRA_TIMEOUT_SECONDS=60

# ── Embedding cache (per-request, keyed by texts + model) ────────────────────
# Maximum number of distinct (texts, model) calls to keep in memory.
EMBEDDING_CACHE_SIZE=1024
# How long cached embedding results are kept (minutes). 0 = no expiry.
EMBEDDING_CACHE_MINUTES=60.0

# ── Sentence-transformer model loader cache ──────────────────────────────────
# Maximum number of loaded model objects kept in memory (across all ST models).
# EMBEDDING_MODEL_CACHE_SIZE is fixed at 4 in code.
# How long a loaded model is kept before being evicted (minutes). Default = 24 h.
EMBEDDING_MODEL_CACHE_MINUTES=1440

# ── Vacuum maintenance window ────────────────────────────────────────────────
# Set to "0" to disable the maintenance window and allow vacuum to run anytime.
VACUUM_MAINTENANCE_WINDOW=1
# Vacuum runs when either the collection deletion ratio reaches 10%
# or the absolute deleted item count reaches 10,000.
VACUUM_DELETION_RATIO_THRESHOLD=0.10
VACUUM_DELETION_COUNT_THRESHOLD=10000
# Hour of day (UTC, 0-23) when the maintenance window opens.
VACUUM_WINDOW_START_H=0
# Hour of day (UTC, 0-23) when the maintenance window closes (exclusive).
VACUUM_WINDOW_END_H=6
