# Nextcraft AI Service — environment template (copy values, never commit real keys) # Real keys live in .ciagent/.env.secrets (gitignored) and are exported by scripts/dev.sh AI_PORT=8420 # Network mode (v0.3.5, D-038): dev server binds 0.0.0.0 so remote machines can # reach the stack. Set to 127.0.0.1 to revert to loopback-only. AI_HOST=0.0.0.0 # CORS + WS-origin policy: '*' (default) admits any origin — safe because # credentials are never enabled. Restrict with a comma list, e.g.: # AI_CORS_ORIGINS=http://nextcraft-1:3000 AI_CORS_ORIGINS=* AI_PROVIDER=ollama-cloud AI_MODEL=gemma4:31b AI_OLLAMA_CLOUD_BASE_URL=https://ollama.com/v1 AI_OLLAMA_CLOUD_API_KEY= AI_LOCAL_BASE_URL=http://localhost:11434/v1 AI_JSON_MODE=auto # Sandbox fabric (v0.3) AI_SANDBOX_DIR=sandboxes AI_SANDBOX_MAX_CONCURRENT=5 AI_SANDBOX_TIMEOUT_S=900 AI_SANDBOX_MAX_WORKDIR_MB=512 # G-5 abuse control (NOT auth — KYC/identity deferred): # comma-separated learner allowlist; unknown ids can't create sandboxes (403) AI_LEARNER_ALLOWLIST=pilot-learner # max ACTIVE sandboxes per learner → 429 when exceeded AI_SANDBOX_MAX_PER_LEARNER=1 # global creates per rolling 60s window (in-memory) → 429 when exceeded AI_SANDBOX_CREATES_PER_MIN=10 # Persistence (SQLite) AI_DB_PATH=ai_service/data/nextcraft.db # --- v0.3 Voice (REQ-3-006, D-030) --- # 'mock' (default; no key needed — tests/dev) or 'browser' (client-native SR/TTS). # Real server STT/TTS ('openai-audio' + AI_VOICE_BASE_URL/AI_VOICE_API_KEY) # is deferred to v0.4 per GRILL CUT-1/G-7 — keys never in code or commits. AI_VOICE_PROVIDER=mock