# ===================================================================== # REQUIRED SECRETS - READ THIS FIRST # ===================================================================== # Every secret below is EMPTY on purpose. There is no default and no # working placeholder. When you turn a feature on, its secret is required: # an empty value, or a leftover template value (your_*, YOUR_*, changeme*, # <...>, example, placeholder, xxx*, dp.st.your*), makes Stream Daemon # refuse to start and name the variable. It never prints the value. # # Twitch TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET (no credentials = Twitch skipped) # YouTube YOUTUBE_API_KEY (no key = YouTube skipped) # Kick KICK_CLIENT_ID + KICK_CLIENT_SECRET (optional; public API without them) # Mastodon MASTODON_ACCESS_TOKEN (required when MASTODON_ENABLE_POSTING=True) # Bluesky BLUESKY_APP_PASSWORD (required when BLUESKY_ENABLE_POSTING=True) # Discord DISCORD_WEBHOOK_URL (or a per-platform webhook) (required when enabled) # Matrix MATRIX_PASSWORD or MATRIX_ACCESS_TOKEN (required when MATRIX_ENABLE_POSTING=True) # Gemini GEMINI_API_KEY (required when LLM_PROVIDER or # LLM_FALLBACK_PROVIDER is gemini) # Vault SECRETS_VAULT_TOKEN (required when SECRETS_MANAGER=vault) # Doppler DOPPLER_TOKEN (leave empty to not use Doppler) # Note: TWITCH_ENABLE and YOUTUBE_ENABLE are not read by the code today. # Twitch and YouTube start when their credentials are present. # ===================================================================== # Stream Daemon Environment Variables # Copy this file to .env and fill in your values # NEVER commit .env to git! # # ⚠️ CRITICAL: SECRETS MANAGER PRIORITY ⚠️ # # If you're using Doppler, AWS Secrets Manager, or HashiCorp Vault: # # PRIORITY ORDER (for secrets/webhooks): # 1. Secrets Manager (Doppler/AWS/Vault) - HIGHEST PRIORITY (overrides .env) # 2. .env file - FALLBACK (used if secret not found in secrets manager) # # This means: # ✅ Production secrets in Doppler/AWS/Vault will ALWAYS be used if available # ✅ .env values serve as fallback/defaults for development # ✅ Keep credentials in .env for local dev only; never in a shared or production file # ✅ Production environments automatically use secrets manager values # # WHAT GETS OVERRIDDEN BY SECRETS MANAGER: # - API Keys (YOUTUBE_API_KEY) # - Client IDs and Secrets (TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET, KICK_*) # - Access Tokens (MASTODON_ACCESS_TOKEN, MASTODON_CLIENT_ID, MASTODON_CLIENT_SECRET) # - App Passwords (BLUESKY_APP_PASSWORD) # - Webhook URLs (DISCORD_WEBHOOK_URL, DISCORD_WEBHOOK_TWITCH, etc.) # # WHAT STAYS IN .ENV (configuration, not secrets): # - Platform enables (TWITCH_ENABLE, MASTODON_ENABLE_POSTING) # - Usernames (TWITCH_USERNAME, YOUTUBE_USERNAME, BLUESKY_HANDLE) # - Public URLs (MASTODON_API_BASE_URL) # - App names (MASTODON_APP_NAME) # - Messages (DISCORD_ENDED_MESSAGE, DISCORD_ENDED_MESSAGE_TWITCH, etc.) # - Settings (SETTINGS_CHECK_INTERVAL) # - Secrets manager config (SECRETS_MANAGER, DOPPLER_TOKEN) # # DEVELOPMENT WORKFLOW: # 1. Set all credentials in .env for local testing # 2. Configure secrets manager for production # 3. Deploy - secrets manager automatically takes priority # 4. Remove credentials from .env once a secrets manager holds them # # See DOPPLER_GUIDE.md for complete setup instructions! # ===================================== # STREAMING PLATFORMS (At least ONE required) # ===================================== # Twitch API Credentials # HOW TO GET: # 1. Go to https://dev.twitch.tv/console/apps # 2. Click "Register Your Application" # 3. Name: "Stream Daemon" (or your choice) # 4. OAuth Redirect URL: http://localhost (required but not used by Stream Daemon) # 5. Category: Choose relevant category (e.g., "Application Integration") # 6. Click "Create" and copy your Client ID # 7. Click "New Secret" to generate Client Secret (copy immediately, can't view again!) # # Seven fucking steps to get permission to check if someone is live. # Remember when you could just... look at the website? Pepperidge Farm remembers. TWITCH_ENABLE=False # Twitch username to monitor (used for stream checks and tests) TWITCH_USERNAME=your_twitch_username # Option 1: Set credentials directly (for testing/local development) TWITCH_CLIENT_ID= TWITCH_CLIENT_SECRET= # Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md) # Comment out the credentials above and configure SECRETS section below # YouTube Live API Credentials # HOW TO GET: # 1. Go to https://console.cloud.google.com/ # 2. Create New Project → Name it "Stream Daemon" # 3. Go to "APIs & Services" → "Library" # 4. Search "YouTube Data API v3" and click "Enable" # 5. Go to "APIs & Services" → "Credentials" # 6. Click "Create Credentials" → "API Key" # 7. Copy the API key # 8. (Optional but recommended) Click "Restrict Key" → Select "YouTube Data API v3" # # Eight steps through Google's bureaucratic nightmare of a cloud console. # To check if someone is streaming. On a website. That already knows if they're streaming. # But no, you need to create a PROJECT. With CREDENTIALS. And RESTRICT the key. # Because God forbid someone steals your API key and... checks if streams are live? The horror. # # IMPORTANT: YouTube detection uses an optimized method (3 quota units per check vs 101). # This works for 99% of streamers but has one limitation: it only detects streams that are # the MOST RECENT video on your channel. If you upload VODs/Shorts during your stream, it # may not be detected. Most streamers are unaffected. See docs/platforms/streaming/youtube.md YOUTUBE_ENABLE=False # YouTube channel handle to monitor (with or without @ prefix, used for stream checks and tests) # Examples: "YourChannelHandle" or "@YourChannelHandle" both work - @ is auto-added if missing YOUTUBE_USERNAME=@YourChannelHandle # YOUTUBE_CHANNEL_ID is OPTIONAL - will be auto-resolved from username # Only set this if you want to skip the channel lookup (slightly faster) # YOUTUBE_CHANNEL_ID=YOUR_YOUTUBE_CHANNEL_ID # Option 1: Set API key directly (for testing/local development) YOUTUBE_API_KEY= # Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md) # Comment out the API key above and configure SECRETS section below # Kick.com Credentials (REQUIRED) # HOW TO GET: # 1. Login to https://kick.com # 2. Make sure 2FA is enabled (Settings → Security) # 3. Go to Settings → Developer # 4. Create a new application # 5. Scopes/Permissions: Select "Read Access" (required for stream status checks) # 6. Copy your Client ID and Client Secret # # NOTE: Kick API credentials are REQUIRED for stream monitoring. # Or they would be, if the API actually worked consistently. # Sometimes it does. Sometimes it returns 500. Sometimes it just... shrugs. # That's why we fall back to scraping the website like it's 2005. # Modern infrastructure, folks. # The public API is no longer supported and will result in 403 errors. KICK_ENABLE=False # Your Kick username to monitor (used for stream checks and tests) KICK_USERNAME=your_kick_username # Kick API credentials (REQUIRED when KICK_ENABLE=True) # Option 1: Set credentials directly (for testing/local development) KICK_CLIENT_ID= KICK_CLIENT_SECRET= # Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md) # Comment out the credentials above and configure SECRETS section below # =========================================== # MESSAGE FILES # =========================================== # MESSAGE FILES & POSTING STRATEGIES # =========================================== # Consolidated message files with platform sections # Format: Use [PLATFORM] sections for platform-specific messages, or [DEFAULT] for all # Example: # [DEFAULT] # Generic message 1 # [TWITCH] # Twitch-specific message 1 MESSAGES_MESSAGES_FILE=messages.txt MESSAGES_END_MESSAGES_FILE=end_messages.txt # Control whether to use platform-specific sections or always use [DEFAULT] # If true: Uses [TWITCH], [YOUTUBE], [KICK] sections when available, falls back to [DEFAULT] # If false: Always uses [DEFAULT] section for all platforms (same message everywhere) MESSAGES_USE_PLATFORM_SPECIFIC_MESSAGES=True # =========================================== # MULTI-PLATFORM POSTING STRATEGIES # =========================================== # LIVE_THREADING_MODE: How to handle "going live" posts when streaming to multiple platforms # Options: # - separate: Each platform gets its own standalone post (no threading) # Example: "Live on Twitch!" then "Live on YouTube!" as separate posts # # - thread: Each platform announcement is threaded to the previous one # Example: "Live on Twitch!" → "Also live on YouTube!" as a reply thread # # - combined: Single post announcing all platforms at once # Example: "Live on Twitch, YouTube, and Kick!" # Note: In this mode, the message will include all live platforms MESSAGES_LIVE_THREADING_MODE=separate # END_THREADING_MODE: How to handle "stream ended" posts # Options: # - disabled: Don't post any stream end messages # # - separate: Each platform end gets its own post (no threading to live announcement) # Example: "Twitch stream ended!" "YouTube stream ended!" as separate posts # # - thread: Each end message is threaded as a reply to that platform's live announcement # Example: "Live on Twitch!" → "Stream ended, thanks for watching!" # # - combined: Single post when each platform ends, listing that specific platform # Example: "Twitch and YouTube streams ended!" (when both end simultaneously) # # - single_when_all_end: Wait until ALL enabled streaming platforms have ended, # then post ONE final message # Example: If streaming to Twitch, YouTube, and Kick, wait until # all three have gone offline before posting "All streams ended!" # Useful when platforms might fail at different times MESSAGES_END_THREADING_MODE=thread # Legacy option for backwards compatibility (if END_THREADING_MODE=disabled, this is ignored) # Set to False to disable end messages (same as END_THREADING_MODE=disabled) MESSAGES_POST_END_STREAM_MESSAGE=True # ===================================== # SOCIAL PLATFORMS (At least ONE required) # ===================================== # Mastodon API Credentials # HOW TO GET: # 1. Login to your Mastodon instance (e.g., mastodon.social) # 2. Go to Settings → Development # 3. Click "New Application" # 4. Name: "Stream Daemon" # 5. Scopes/Permissions: # - Check "read:accounts" (REQUIRED - allows verifying your credentials) # - Check "write:statuses" (REQUIRED - allows posting status updates) # - Check "write:media" (optional - if you plan to attach images/videos) # 6. Redirect URI: Leave default or use "urn:ietf:wg:oauth:2.0:oob" # 7. Click "Submit" # 8. Copy ALL THREE credentials from the Mastodon page: # - "Client key" → Use as MASTODON_CLIENT_ID # - "Client secret" → Use as MASTODON_CLIENT_SECRET # - "Your access token" → Use as MASTODON_ACCESS_TOKEN MASTODON_ENABLE_POSTING=False MASTODON_APP_NAME=StreamDaemon MASTODON_API_BASE_URL=https://mastodon.social # Option 1: Set credentials directly (for testing/local development) MASTODON_CLIENT_ID= MASTODON_CLIENT_SECRET= MASTODON_ACCESS_TOKEN= # Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md) # Comment out the credentials above and configure SECRETS section below # Bluesky API Credentials # HOW TO GET: # 1. Login to https://bsky.app # 2. Go to Settings → App Passwords (or https://bsky.app/settings/app-passwords) # 3. Click "Add App Password" # 4. Name: "Stream Daemon" # 5. Copy the generated password # 6. IMPORTANT: This is an APP PASSWORD, NOT your main account password! # # NOTE FROM THE DEVELOPER: # Bluesky's app password approach is functional but frustrating. I eagerly await # proper OAuth 2.0 support for the masses. Currently, OAuth is only available to # those who self-host their own Personal Data Servers (PDS), which is overkill # for most users. Once Bluesky releases OAuth for everyone, we'll update to use it! BLUESKY_ENABLE_POSTING=False BLUESKY_HANDLE=yourname.bsky.social # Option 1: Set app password directly (for testing/local development) BLUESKY_APP_PASSWORD= # Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md) # Comment out the app password above and configure SECRETS section below # Discord Webhook # HOW TO GET: # 1. Go to your Discord server (you must have admin/manage webhooks permission) # 2. Right-click the channel where you want stream announcements # 3. Click "Edit Channel" → "Integrations" → "Webhooks" # 4. Click "Create Webhook" (or "New Webhook") # 5. Customize name/avatar (optional) # 6. Click "Copy Webhook URL" # # FLEXIBILITY OPTIONS: # • Single webhook for all platforms: Set only discord_webhook_url # • Per-platform webhooks: Set discord_webhook_twitch, discord_webhook_youtube, discord_webhook_kick # • Mixed: Use discord_webhook_url as default, override specific platforms with per-platform webhooks # # DOPPLER/SECRETS MANAGER: Store each as a separate secret (not JSON): # discord_webhook_url = "https://discord.com/api/webhooks/123/abc" # discord_webhook_twitch = "https://discord.com/api/webhooks/456/def" # discord_role = "1234567890" # discord_role_twitch = "9876543210" DISCORD_ENABLE_POSTING=False # Default webhook (used for all platforms unless per-platform webhook is specified) DISCORD_WEBHOOK_URL= # Per-platform webhooks (OPTIONAL - overrides default webhook for specific platforms) # Leave commented out if you want all platforms to use the same webhook #DISCORD_WEBHOOK_TWITCH=https://discord.com/api/webhooks/TWITCH_WEBHOOK_ID/TWITCH_WEBHOOK_TOKEN #DISCORD_WEBHOOK_YOUTUBE=https://discord.com/api/webhooks/YOUTUBE_WEBHOOK_ID/YOUTUBE_WEBHOOK_TOKEN #DISCORD_WEBHOOK_KICK=https://discord.com/api/webhooks/KICK_WEBHOOK_ID/KICK_WEBHOOK_TOKEN # Discord Role Mentions (OPTIONAL) # Pings specific roles when going live # HOW TO GET ROLE IDs: # 1. Enable Developer Mode: User Settings → Advanced → Developer Mode (ON) # 2. Right-click any role in Server Settings → Roles → "Copy Role ID" # # FLEXIBILITY OPTIONS: # • Single role for all platforms: Set only discord_role # • Per-platform roles: Set discord_role_twitch, discord_role_youtube, discord_role_kick # • Mixed: Use discord_role as default, override specific platforms with per-platform roles # • No mentions: Leave all commented out # Default role (used for all platforms unless per-platform role is specified) #DISCORD_ROLE=1234567890123456789 # Per-platform roles (OPTIONAL - overrides default role for specific platforms) #DISCORD_ROLE_TWITCH=1234567890123456789 #DISCORD_ROLE_YOUTUBE=9876543210987654321 #DISCORD_ROLE_KICK=5555555555555555555 # Stream Ended Messages (OPTIONAL) # Customize the message shown when a stream ends # The embed will be updated with this message while keeping the VOD link and final stats # # ⚠️ IMPORTANT: These are CONFIGURATION, not secrets - keep them in .env! # DO NOT store these in Doppler/AWS/Vault - they're not sensitive data. # # FLEXIBILITY OPTIONS: # • Single message for all platforms: Set only discord_ended_message # • Per-platform messages: Set discord_ended_message_twitch, discord_ended_message_youtube, discord_ended_message_kick # • Mixed: Use discord_ended_message as default, override specific platforms with per-platform messages # • No ended messages: Leave all commented out to skip updating when stream ends # Default stream ended message (used for all platforms unless per-platform message is specified) DISCORD_ENDED_MESSAGE=Thanks for joining! Tune in next time 💜 # Per-platform stream ended messages (OPTIONAL - overrides default message for specific platforms) #DISCORD_ENDED_MESSAGE_TWITCH=Thanks for the amazing stream! Catch the VOD below 💜 #DISCORD_ENDED_MESSAGE_YOUTUBE=Stream has ended! Watch the replay below 🎬 #DISCORD_ENDED_MESSAGE_KICK=That was epic! Check out the VOD 🎮 # Matrix Protocol # NOTE: Matrix does NOT support editing messages (unlike Discord) # Messages post once and stay static - no live viewer count updates # # HOW TO GET: # 1. Create a Matrix account at https://app.element.io or your Matrix server # 2. Create a room for stream announcements (e.g., "Stream Notifications") # 3. Get Room ID: # - Element: Room Settings → Advanced → Internal Room ID (looks like !abc123:matrix.org) # # TWO AUTHENTICATION METHODS (choose ONE): # # Method 1: Username/Password (RECOMMENDED for bot accounts) # - Daemon logs in each time and gets fresh access token # - Automatic token rotation on every startup # - Best for dedicated bot accounts # - If BOTH username/password AND access_token are set, username/password takes priority # # Method 2: Access Token (alternative - manual management) # - Get from Element: Settings → Help & About → Advanced → Access Token → "Click to reveal" # - Never expires (unless manually revoked) # - No automatic rotation # - Only used if username/password are NOT set # # AUTHENTICATION PRIORITY: # 1. Username/Password (if both are set) - generates fresh token # 2. Access Token (fallback if username/password not set) - static token # # DOPPLER/SECRETS MANAGER: Store each as a separate secret: # MATRIX_HOMESERVER = "https://matrix.org" # MATRIX_USERNAME = "@streambot:matrix.org" (Method 1 - RECOMMENDED) # MATRIX_PASSWORD = "your_password" (Method 1 - RECOMMENDED) # OR # MATRIX_ACCESS_TOKEN = "syt_abc123..." (Method 2 - only if not using username/password) # MATRIX_ROOM_ID = "!KHzbUMYDd0VnJyFqMXiPyfLipv4DKwn-stVz6RYD1VY:matrix.org" MATRIX_ENABLE_POSTING=False # Required: Homeserver and Room ID MATRIX_HOMESERVER=https://matrix.org MATRIX_ROOM_ID=!your_room_id:matrix.org # Method 1: Username/Password (RECOMMENDED - auto-generates token on each startup) # Use this for bot accounts with automatic token rotation MATRIX_USERNAME=@your_bot:matrix.org MATRIX_PASSWORD= # Method 2: Access Token (alternative - only used if username/password NOT set) # Comment out username/password above if you want to use a static access token #MATRIX_ACCESS_TOKEN=your_access_token_here # =========================================== # SECRET MANAGER (Optional) # =========================================== # Options: None, aws, vault, doppler SECRETS_MANAGER=None # AWS Secrets Manager Configuration # When enabled, credentials are loaded from AWS Secrets Manager # The secret should be JSON with keys matching the credential names # Example for Twitch: {"client_id": "abc123", "client_secret": "xyz789"} SECRETS_AWS_TWITCH_SECRET_NAME=twitch-api-keys SECRETS_AWS_YOUTUBE_SECRET_NAME=youtube-api-keys SECRETS_AWS_KICK_SECRET_NAME=kick-api-keys SECRETS_AWS_MASTODON_SECRET_NAME=mastodon-api-keys SECRETS_AWS_BLUESKY_SECRET_NAME=bluesky-api-keys SECRETS_AWS_DISCORD_SECRET_NAME=discord-webhook SECRETS_AWS_MATRIX_SECRET_NAME=matrix-credentials # HashiCorp Vault Configuration # When enabled, credentials are loaded from Vault KV v2 # The secret should have data fields matching the credential names SECRETS_VAULT_URL=https://vault.example.com SECRETS_VAULT_TOKEN= SECRETS_VAULT_TWITCH_SECRET_PATH=secret/twitch SECRETS_VAULT_YOUTUBE_SECRET_PATH=secret/youtube SECRETS_VAULT_KICK_SECRET_PATH=secret/kick SECRETS_VAULT_MASTODON_SECRET_PATH=secret/mastodon SECRETS_VAULT_BLUESKY_SECRET_PATH=secret/bluesky SECRETS_VAULT_DISCORD_SECRET_PATH=secret/discord SECRETS_VAULT_MATRIX_SECRET_PATH=secret/matrix # Doppler Configuration # When enabled, Doppler fetches secrets by name from your Doppler project/config # # IMPORTANT: Doppler Token is ENVIRONMENT-SPECIFIC # - Tokens are tied to a specific Doppler environment (dev, stg, prd) # - A 'dev' token only accesses 'dev' secrets # - Generate separate tokens for different environments # - For most users, the 'dev' environment is sufficient # # How to get your Doppler token: # 1. Go to Doppler dashboard → Access → Service Tokens # 2. Click "Generate Service Token" # 3. Select environment: 'dev' (recommended) or 'prd' for production # 4. Copy the token (starts with dp.st.) # # See DOPPLER_GUIDE.md for complete setup instructions DOPPLER_TOKEN= DOPPLER_PROJECT=stream-daemon DOPPLER_CONFIG=dev SECRETS_DOPPLER_TWITCH_SECRET_NAME=twitch SECRETS_DOPPLER_YOUTUBE_SECRET_NAME=youtube SECRETS_DOPPLER_KICK_SECRET_NAME=kick SECRETS_DOPPLER_MASTODON_SECRET_NAME=mastodon SECRETS_DOPPLER_BLUESKY_SECRET_NAME=bluesky SECRETS_DOPPLER_DISCORD_SECRET_NAME=discord SECRETS_DOPPLER_MATRIX_SECRET_NAME=matrix SECRETS_DOPPLER_LLM_SECRET_NAME=llm # =========================================== # AI MESSAGE GENERATION (LLM) # =========================================== # OPTIONAL: Use AI to generate personalized stream messages # instead of static start/end messages. # # FEATURES: # - Platform-specific character limits (Bluesky: 300, Mastodon: 500) # - Automatic hashtag generation based on stream title # - Engaging, dynamic messages for each stream # - Includes stream URL automatically # - Falls back to standard messages if API fails # # TWO PROVIDER OPTIONS: # # Option 1: Ollama (Local LLM - RECOMMENDED for privacy & cost) # - Run AI models locally on your own hardware # - No API costs, unlimited usage # - Full privacy - your data never leaves your network # - Fast response times with proper hardware # - Setup: https://ollama.com/ # - Multi-GPU setup: https://github.com/ChiefGyk3D/FrankenLLM # # Option 2: Google Gemini (Cloud API - easier setup) # - No local hardware required # - Pay-per-use API costs # - Rate limits apply (10-30 RPM depending on model) # - Setup: Get API key from https://aistudio.google.com/app/apikey # Enable/disable LLM message generation # Set to True to let a computer pretend to be excited about your streams # Set to False to manually copy-paste the same message you've used for 3 years # (At least that's honest dishonesty) LLM_ENABLE=False # Choose LLM provider: "ollama" (local) or "gemini" (cloud) LLM_PROVIDER=ollama # =========================================== # OLLAMA CONFIGURATION (LLM_PROVIDER=ollama) # =========================================== # Ollama server configuration # Replace with your Ollama server IP address (or localhost if running locally) LLM_OLLAMA_HOST=http://192.0.2.10 LLM_OLLAMA_PORT=11434 # Model to use - CHOOSE BASED ON YOUR GPU VRAM # # RECOMMENDED MODELS BY VRAM (see docs/features/llm-model-recommendations.md): # # | VRAM | Model | Quality | Speed | Notes | # |-------|----------------|--------------|---------|------------------------------| # | 4GB | gemma3:2b | ⭐⭐⭐ | ~1.5s | Entry-level | # | 6GB | gemma3:4b | ⭐⭐⭐⭐ | ~1.0s 🏆| RECOMMENDED - fast & good | # | 8GB | gemma3:4b | ⭐⭐⭐⭐⭐ | ~1.0s 🏆| RECOMMENDED - sweet spot | # | 12GB | gemma3:4b | ⭐⭐⭐⭐⭐ | ~1.0s | Fast with headroom | # | 16GB | gemma3:12b | ⭐⭐⭐⭐⭐+ | ~1.3s 🏆| PREMIUM - excellent quality | # | 24GB+ | gemma3:27b | ⭐⭐⭐⭐⭐+ | ~2s | Maximum quality | # # 🏆 JANUARY 2026 BENCHMARK WINNER: GEMMA3 # - gemma3:4b: ~1 second response time (6-10x faster than Qwen2.5!) # - gemma3:12b: ~1.3 seconds with premium quality # - No "thinking mode" overhead like Qwen3 # - Clean, single-post output # # ALTERNATIVE MODELS (good for specific use cases): # QWEN3 MODELS (EXPERIMENTAL - requires LLM_ENABLE_THINKING_MODE=True): # - qwen3:4b (2.5GB) - Rivals Qwen2.5-72B performance! But has "thinking mode" # - qwen3:8b (5.2GB) - Very capable # - qwen3:14b (9.3GB) - Premium quality # ⚠️ Qwen3 models output reasoning in a 'thinking' field before the response. # Enable LLM_ENABLE_THINKING_MODE=True and increase LLM_MAX_TOKENS if using Qwen3. # # OTHER GOOD OPTIONS: # - llama3.1:8b (Meta's model, good general purpose) # - mistral:7b (Fast, good quality) # # Browse available models: https://ollama.com/library # List installed: ollama list # Pull new model: ollama pull gemma3:12b LLM_MODEL=gemma3:4b # OLLAMA SETUP INSTRUCTIONS: # # 1. Install Ollama on your server: # curl -fsSL https://ollama.com/install.sh | sh # # Multi-GPU setup? See: https://github.com/ChiefGyk3D/FrankenLLM # # 2. Pull a model (based on your VRAM - see table above): # ollama pull gemma3:4b # For 6GB GPUs (recommended - fast!) # ollama pull gemma3:12b # For 12GB GPUs (excellent quality) # ollama pull qwen2.5:7b # For 8GB GPUs (if you prefer Qwen) # # 3. Start Ollama (if not running as service): # OLLAMA_HOST=0.0.0.0 ollama serve # # 4. Test from Stream Daemon host: # curl http://YOUR_SERVER_IP:11434/api/tags # # 5. Update LLM_OLLAMA_HOST above with your server IP # # For detailed model recommendations, see: docs/features/llm-model-recommendations.md # =========================================== # GOOGLE GEMINI CONFIGURATION (LLM_PROVIDER=gemini) # =========================================== # Google Gemini API Key # HOW TO GET: # 1. Go to https://aistudio.google.com/app/apikey # 2. Click "Create API Key" # 3. Copy the API key # 4. Store in secrets manager OR set GEMINI_API_KEY below # # SECRETS MANAGER: # Doppler: Store as GEMINI_API_KEY in "llm" config # AWS: Store in secret named by SECRETS_AWS_LLM_SECRET_NAME as {"gemini_api_key": "your-key"} # Vault: Store in path from SECRETS_VAULT_LLM_SECRET_PATH as {"gemini_api_key": "your-key"} GEMINI_API_KEY= # Gemini model to use (default: gemini-2.0-flash-lite) # Recommended: gemini-2.0-flash-lite (30 RPM, perfect for concurrent posts to multiple platforms) # Other options: gemini-2.5-flash (10 RPM), gemini-2.0-flash (15 RPM), gemini-2.5-pro (5 RPM) # Note: When using LLM_PROVIDER=gemini, set LLM_MODEL to one of the gemini models above #LLM_MODEL=gemini-2.0-flash-lite # =========================================== # LLM GENERATION PARAMETERS # =========================================== # Fine-tune AI output for better instruction following (especially for small models) # Temperature: Controls randomness (0.0 = deterministic, 1.0 = creative) # For stream messages, lower is better for following strict rules # Recommended: 0.3 for small models (gemma2:4b, phi3:mini) # Default: 0.3 LLM_TEMPERATURE=0.3 # Top P: Nucleus sampling threshold (0.0-1.0) # Controls diversity of token selection # Recommended: 0.9 (good balance) # Default: 0.9 LLM_TOP_P=0.9 # Max Tokens: Maximum length of generated output # Higher = more verbose, lower = more concise # Recommended: 150 (enough for posts + hashtags) # Range: 100-200 depending on platform # Default: 150 LLM_MAX_TOKENS=150 # =========================================== # QWEN3 THINKING MODE SUPPORT (EXPERIMENTAL) # =========================================== # Qwen3 models have a unique "thinking" mode where they output their reasoning # in a separate 'thinking' field before generating the final response. # # When enabled, Stream Daemon will: # 1. Increase token limit to allow for reasoning (multiplied by thinking_token_multiplier) # 2. Extract the actual post from the thinking output # 3. Handle cases where content field is empty but thinking field has the answer # # IMPORTANT: This is experimental and may not work perfectly with all prompts. # If you're using Qwen3 models (qwen3:4b, qwen3:8b, qwen3:14b, etc.), enable this. # For non-thinking models (gemma3, qwen2.5, llama3, etc.), leave disabled. # # Default: False LLM_ENABLE_THINKING_MODE=False # Token multiplier for thinking mode # Qwen3 needs more tokens to complete its reasoning before outputting the answer # The base max_tokens is multiplied by this value when thinking mode is enabled # Recommended: 4.0-6.0 (150 tokens * 4 = 600 tokens for thinking + response) # Default: 4.0 LLM_THINKING_TOKEN_MULTIPLIER=4.0 # =========================================== # LLM GUARDRAILS & QUALITY CONTROLS # =========================================== # Because even robots need rules, apparently. # We built machines that can think, now we need machines to watch the thinking machines. # It's supervision turtles all the way down. George would be so fucking proud. # # IMPORTANT: These guardrails control WHAT THE AI GENERATES, not the code commentary. # The AI generates normal, professional stream announcements. # George Carlin's humor is in the CODE, not in your "Going live!" posts. # We're not turning your stream bot into a profane comedian (unless you disable the profanity filter, you madman). # Message Deduplication: Prevent identical messages across platforms (True/False) # If enabled, caches recent messages and forces retry if duplicate detected # Useful when streaming to multiple platforms (Twitch + YouTube + Kick) # # "Oh no, the AI used the same words twice! Better waste CPU cycles fixing that." # Although to be fair, humans do this shit manually all the time: # "Going live on Twitch!" "Going live on YouTube!" "Going live on Kick!" # At least the robot TRIES to be creative. That's more than most streamers can say. # Default: True LLM_ENABLE_DEDUPLICATION=True # Deduplication cache size (how many recent messages to remember) # Higher = better dedup, more memory usage # Default: 20 (covers ~10 streams worth of start+end messages) LLM_DEDUP_CACHE_SIZE=20 # Quality Scoring: Rate generated messages 1-10 and retry if too low (True/False) # Checks for: generic words, poor grammar, lack of personality, too short/long # # "We're literally grading the AI's homework. In 2026. This is fine." # # Think about this: We spent billions on AI research so we could build a system # that generates social media posts, then we built ANOTHER system to grade those posts, # and if it gets a bad grade, we make it do the assignment again. # # This is peak civilization. We've automated mediocrity AND the quality control for it. # George would write a 20-minute bit about this horseshit. # Default: False (enable if you're picky about quality) LLM_ENABLE_QUALITY_SCORING=False # Minimum quality score (1-10) to accept a message # Below this = automatic retry with stricter prompt # Recommended: 6-7 (not too strict, not too lenient) # Default: 6 LLM_MIN_QUALITY_SCORE=6 # Emoji Limits: Maximum emoji count in generated messages (0-10) # Too many emojis = looks like a teenager's Instagram post # Too few = boring corporate speak # # The sweet spot: 0-1 emoji. Maybe 2 if you're feeling wild. # # We created hieroglyphics 5,000 years ago, evolved past them to alphabets, # built computers, connected the world with the internet... and now we're back # to communicating with tiny pictures. 🎮💪🔥😂 # # But sure, let's police how many the ROBOT uses. Because THAT'S the problem. # Default: 1 LLM_MAX_EMOJI_COUNT=1 # Profanity Filter: Block generated messages with profanity (True/False) # # Ironic, considering this entire fucking codebase is profane. # But hey, maybe you don't want the AI dropping F-bombs about your Minecraft stream. # # George Carlin spent his career fighting censorship and defending the seven words # you can't say on television. Now we're programming robots not to say them. # He'd either laugh his ass off or haunt us. Probably both. # # Note: This blocks GENERATED ANNOUNCEMENTS, not our beautiful Carlin commentary. # The code can curse. Your "Going live!" posts? That's between you and your audience. # Default: False (we're adults here) LLM_ENABLE_PROFANITY_FILTER=False # Profanity severity threshold (mild/moderate/severe) # mild: blocks hard profanity (f*ck, sh*t, etc.) # moderate: + sexual references, slurs # severe: + mild profanity (damn, hell, crap) # "Choose your censorship level! Democracy in action!" # Default: moderate LLM_PROFANITY_SEVERITY=moderate # Platform-Specific Validation: Extra checks per platform (True/False) # Discord: Validates mentions, embeds, markdown # Bluesky: Validates facets, link cards, AT Protocol formatting # Mastodon: Validates CW, visibility, HTML entities # # "Because one set of rules wasn't enough. Every platform needs special treatment." # # In the old days, you wrote something and people read it. Simple. # Now? Discord wants its mentions formatted JUST SO. Bluesky has "facets" (whatever # the fuck those are). Mastodon needs HTML entities validated. Matrix has its own # special snowflake requirements. # # We built a global communication network and spent the next 20 years fragmenting it # into incompatible bullshit. Congratulations, humanity. We played ourselves. # Default: True LLM_ENABLE_PLATFORM_VALIDATION=True # =========================================== # LLM RETRY CONFIGURATION (both providers) # =========================================== # Handles transient API errors like 503 overload # Maximum number of retry attempts for API calls (default: 3) LLM_MAX_RETRIES=3 # Base delay for exponential backoff in seconds (default: 2) # Actual delays: 2s, 4s, 8s for attempts 1, 2, 3 LLM_RETRY_DELAY_BASE=2 # =========================================== # OLLAMA AUTO-RECONNECT CONFIGURATION # =========================================== # When Ollama server becomes unreachable (restart, network issue), # automatically attempt to reconnect instead of staying broken. # This is especially useful for remote Ollama servers that might # restart occasionally. # Enable/disable automatic reconnection (default: True) LLM_ENABLE_AUTO_RECONNECT=True # Minimum interval between reconnection attempts in seconds (default: 60) # Prevents hammering a down server LLM_RECONNECT_INTERVAL=60 # Maximum reconnection attempts before giving up (default: 0 = unlimited) # Set to 0 for unlimited retries, or a positive number to cap attempts LLM_MAX_RECONNECT_ATTEMPTS=0 # =========================================== # SETTINGS # =========================================== # CHECK_INTERVAL: How often to check stream status when OFFLINE (in minutes) # Lower = faster detection when you go live, but more API calls # Recommended: 3-5 minutes (balance between speed and API usage) SETTINGS_CHECK_INTERVAL=5 # POST_INTERVAL: How often to check stream status when LIVE (in minutes) # Lower = faster detection when stream ends, but more API calls # Recommended: 2-5 minutes (you want to know quickly when stream ends!) # NOTE: This should typically be SAME or LOWER than CHECK_INTERVAL SETTINGS_POST_INTERVAL=5