# ── Primary model (OpenAI-compatible) ──────────────────────────────────────── OPENAI_BASE_URL=https://api.openai.com/v1 OPENAI_API_KEY= MODEL= # Used when the primary endpoint is unreachable or rate-limited (429/5xx). # Supports any OpenAI-compatible provider (OpenRouter, LM Studio, etc.). FALLBACK_OPENAI_BASE_URL=http://localhost:1234/v1 FALLBACK_OPENAI_API_KEY= FALLBACK_MODEL= # Tool call policy for fallback requests: required, auto, none FALLBACK_TOOL_CHOICE=required # Optional headers FALLBACK_OPENAI_REFERER= FALLBACK_OPENAI_TITLE= # Context window enforcement for fallback. Defaults to true for localhost, false otherwise. FALLBACK_ENFORCE_CONTEXT_LIMIT= FALLBACK_N_CTX=4096 FALLBACK_CONTEXT_MARGIN=256 FALLBACK_HARD_OVERFLOW_TOKENS=1024 # Set to "local" to skip the primary model and route all requests to the fallback. NIRI_ENV=default # Must match the user created in the Dockerfile and the volume mount in docker-compose.yml. NIRI_USER=niri NIRI_CONTAINER=niri # UID/GID the container process runs as — match your host user to avoid permission issues. AGENT_UID=1001 AGENT_GID=1001 PORT=3000 # Used by the chat CLI to connect. Include the scheme, exclude the port. NIRI_HOST=http://localhost # ── Context & token limits ──────────────────────────────────────────────────── TOKEN_NUDGE_THRESHOLD=120000 FALLBACK_TOKEN_NUDGE_THRESHOLD=50000 CONTEXT_COMPACT_TARGET_TOKENS=65000 CONTEXT_COMPACT_TRIGGER_TOKENS=90000 CONTEXT_COMPACT_RECENT_MESSAGES=80 CONTEXT_COMPACT_CHUNK_MESSAGES=32 CONTEXT_COMPACT_SUMMARY_MAX_CHARS=16000 # ── Tools ───────────────────────────────────────────────────────────────────── # Max bytes accepted by image_tool before rejecting the file. IMAGE_TOOL_MAX_BYTES=150000 # Override the image directory exposed to the agent (default: /home/$NIRI_USER/images). IMAGE_ROOT= # ── Discord ─────────────────────────────────────────────────────────────────── DISCORD_BOT_TOKEN= # Optional — auto-detected from the gateway on first connect if left blank. DISCORD_BOT_USER_ID= # Enable the built-in gateway listener (messageCreate → ingest pipeline). DISCORD_GATEWAY_ENABLED=true # Log every ingest decision (verbose, for debugging). DISCORD_GATEWAY_TRACE=false # Also ingest raw MESSAGE_CREATE packets — recommended for DM reliability. DISCORD_GATEWAY_RAW_FALLBACK=true # Comma-separated channel IDs scanned by discord_scan when no channel_ids arg is passed. DISCORD_SCAN_CHANNEL_IDS= # Wake the agent immediately on any new Discord event (leave false to avoid spam). DISCORD_WAKE_ON_EVENT=false # Wake immediately on DMs even when DISCORD_WAKE_ON_EVENT is false. DISCORD_WAKE_ON_DM=true # How often to batch pending Discord events into a single harness message. DISCORD_BATCH_INTERVAL_MS=60000 # Restrict batch digests to configured scan channels + DMs (recommended). DISCORD_BATCH_ONLY_CONFIGURED=true # Auto-demote pending inbox items to seen after N minutes (0 = disabled). DISCORD_PENDING_AUTO_SEEN_MINUTES=10 # Include a channel scan snapshot in each batch payload. DISCORD_BATCH_SCAN=true # Max messages included in a single batch digest. DISCORD_BATCH_MAX_MESSAGES=40