# LLM API — environment (copy to /.env or export before `llm-api serve`) APP_ENV=production DOMAIN=www.llm-api.io PUBLIC_URL=https://www.llm-api.io # Bind address of the API gateway (the public reverse proxy talks to this) HOST=127.0.0.1 PORT=8300 # Where the Next.js dashboard runs (proxied by the API for non-/api, non-/v1 paths) WEB_URL=http://127.0.0.1:8301 # Data root: models/, data/ (SQLite + secrets), logs/ LLM_API_ROOT=/Users/USERNAME/llm-api # Override the model directory (e.g. an external SSD) # MODEL_ROOT=/Volumes/LLM/models # Memory policy (GB). 64 GB machine: 8 macOS + 3 app + 4 KV + 4 safety = 45 GB for models MAX_MODEL_MEMORY_GB=45 ABSOLUTE_MAX_MEMORY_GB=50 MACOS_RESERVE_GB=8 MIN_FREE_DISK_GB=100 MAX_SIMULTANEOUS_MODELS=1 MODEL_IDLE_TIMEOUT_MINUTES=30 SMALL_MODEL_RESIDENT_GB=3 LOAD_TIMEOUT_SECONDS=900 GENERATION_TIMEOUT_SECONDS=1800 PRELOAD_MODEL=none ENABLE_MLX=true ENABLE_GGUF=true ALLOW_DOWNLOADS=true LOG_PROMPTS=false DEFAULT_MAX_TOKENS=2048 DEFAULT_CONTEXT=16384 # Hugging Face token for gated repositories (never exposed to the frontend) HF_TOKEN= LLAMA_SERVER_BIN=llama-server # Sessions/CSRF secret (auto-generated into data/.secret when empty) SECRET_KEY= # First-run admin (used only when no user exists) ADMIN_EMAIL= ADMIN_PASSWORD= SESSION_HOURS=336 SECURE_COOKIES=true METRICS_INTERVAL_SECONDS=15 METRICS_RETENTION_DAYS=30