# ═══════════════════════════════════════════════════════════════════════════════
# FARNSWORTH COLLECTIVE CONFIGURATION
# ═══════════════════════════════════════════════════════════════════════════════
#
# QUICK START:
# 1. Copy this file to .env: cp .env.example .env
# 2. Run setup wizard: python setup_farnsworth.py
# OR manually fill in your API keys below
# 3. Start the server: python -m farnsworth.web.server
#
# IMPORTANT: You provide YOUR OWN API keys. We don't share secrets.
#
# ═══════════════════════════════════════════════════════════════════════════════
# ═══════════════════════════════════════════════════════════════════════════════
# P2P PLANETARY MEMORY NETWORK
# ═══════════════════════════════════════════════════════════════════════════════
# Connect to the official Farnsworth collective memory network.
# This allows your instance to share learned knowledge and access collective wisdom.
#
# Privacy: Only anonymized summaries are shared, not raw data.
# Set FARNSWORTH_ISOLATED=true for 100% privacy.
# Official P2P server (provided - you can connect to this!)
FARNSWORTH_BOOTSTRAP_PEER=ws://194.68.245.145:8889
FARNSWORTH_BOOTSTRAP_PASSWORD=Farnsworth2026!
# Enable/disable P2P features
ENABLE_PLANETARY_MEMORY=true
PLANETARY_USE_P2P=true
# Your local P2P port (default 9999)
FARNSWORTH_P2P_PORT=9999
# Set to true to disable all P2P networking (complete privacy)
FARNSWORTH_ISOLATED=false
# ═══════════════════════════════════════════════════════════════════════════════
# LOCAL MODELS (Ollama)
# ═══════════════════════════════════════════════════════════════════════════════
# Local inference via Ollama - runs on your GPU/CPU.
# Install: https://ollama.ai
# Then: ollama pull phi4:latest
# ollama pull deepseek-r1:8b
# ollama pull llama3.2:3b
OLLAMA_HOST=http://localhost:11434
FARNSWORTH_PRIMARY_MODEL=phi4:latest
# ═══════════════════════════════════════════════════════════════════════════════
# CLOUD AI PROVIDERS (You provide your own API keys)
# ═══════════════════════════════════════════════════════════════════════════════
# The swarm uses multiple providers for redundancy and diverse capabilities.
# Configure at least 2-3 providers for best results.
# --- ESSENTIAL PROVIDERS (Recommended) ---
# xAI - Grok (Twitter integration, video generation, real-time knowledge)
# Get key: https://console.x.ai/
XAI_API_KEY=
GROK_API_KEY=
# Google - Gemini (Image generation, multimodal, long context)
# Get key: https://aistudio.google.com/apikey
GOOGLE_API_KEY=
GEMINI_API_KEY=
# Anthropic - Claude (Complex reasoning, safety, code review)
# Get key: https://console.anthropic.com/
ANTHROPIC_API_KEY=
# Groq - Ultra-fast inference (Free tier available!)
# Get key: https://console.groq.com/
GROQ_API_KEY=
# --- ADDITIONAL PROVIDERS (Optional) ---
# Moonshot - Kimi (256K context window, Chinese language support)
# Get key: https://platform.moonshot.cn/
MOONSHOT_API_KEY=
KIMI_API_KEY=
# DeepSeek (Code, math, reasoning at low cost)
# Get key: https://platform.deepseek.com/
DEEPSEEK_API_KEY=
# Perplexity (Web-grounded responses with citations)
# Get key: https://www.perplexity.ai/settings/api
PERPLEXITY_API_KEY=
# Mistral (European AI, efficient models)
# Get key: https://console.mistral.ai/
MISTRAL_API_KEY=
# OpenAI - GPT (GPT-4, o1, widely supported)
# Get key: https://platform.openai.com/api-keys
OPENAI_API_KEY=
OPENAI_ORG_ID=
# Cohere (RAG optimized, embeddings, reranking)
# Get key: https://dashboard.cohere.ai/api-keys
COHERE_API_KEY=
# Together AI (Open model hosting, fast inference)
# Get key: https://api.together.xyz/
TOGETHER_API_KEY=
# Fireworks AI (Fast inference)
# Get key: https://fireworks.ai/
FIREWORKS_API_KEY=
# AI21 Labs (Jamba, Jurassic)
# Get key: https://studio.ai21.com/
AI21_API_KEY=
# HuggingFace (200K+ models, specialized tasks)
# Get key: https://huggingface.co/settings/tokens
HUGGINGFACE_API_KEY=
# Replicate (Serverless GPU inference)
# Get key: https://replicate.com/account/api-tokens
REPLICATE_API_KEY=
# ═══════════════════════════════════════════════════════════════════════════════
# AVATAR/VTUBER STREAMING (D-ID + ElevenLabs)
# ═══════════════════════════════════════════════════════════════════════════════
# For AI avatar video streaming with lip-synced speech.
# D-ID generates avatar video, ElevenLabs provides voice synthesis.
# D-ID - Avatar video generation with lip sync
# Get key: https://studio.d-id.com/ (Settings > API Keys)
DID_API_KEY=
# Upload your avatar image to D-ID and get the S3 URL
DID_AVATAR_URL=
# ElevenLabs - Premium text-to-speech
# Get key: https://elevenlabs.io/app/settings/api-keys
ELEVENLABS_API_KEY=
# Voice ID for Farnsworth character (find in ElevenLabs voice library)
ELEVENLABS_VOICE_FARNSWORTH=
# Twitter/X streaming (for live broadcasts)
# Get from Twitter Media Studio > Producer > Create Broadcast
TWITTER_STREAM_KEY=
# ═══════════════════════════════════════════════════════════════════════════════
# X/TWITTER INTEGRATION (For autonomous posting)
# ═══════════════════════════════════════════════════════════════════════════════
# Enables the swarm to post tweets, reply to mentions, and share memes.
#
# Setup:
# 1. Go to https://developer.twitter.com/en/portal/dashboard
# 2. Create a Project and App
# 3. Enable OAuth 2.0 in User Authentication Settings
# 4. Set Callback URL: http://localhost:8080/callback
# 5. Copy Client ID and Client Secret below
# 6. Run: python -m farnsworth.integration.x_automation.auth
X_CLIENT_ID=
X_CLIENT_SECRET=
# ═══════════════════════════════════════════════════════════════════════════════
# CRYPTO/BLOCKCHAIN (Optional)
# ═══════════════════════════════════════════════════════════════════════════════
# Only needed for DeFi trading, token tracking, and blockchain interactions.
# Bankr Agent API (Trading engine)
BANKR_API_KEY=
BANKR_ENABLED=false
# Solana RPC
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# SOLANA_PRIVATE_KEY=your_private_key_here
# Helius (Solana metadata, rug detection)
# Get key: https://dev.helius.xyz/
HELIUS_API_KEY=
# Alchemy (EVM RPCs)
# Get key: https://dashboard.alchemy.com/
ALCHEMY_API_KEY=
# Infura (Ethereum RPC)
# Get key: https://infura.io/
INFURA_API_KEY=
# ═══════════════════════════════════════════════════════════════════════════════
# WEB INTERFACE
# ═══════════════════════════════════════════════════════════════════════════════
# The web chat interface at http://localhost:8080
# Port for web server
FARNSWORTH_WEB_PORT=8080
# Demo mode: true = anyone can access, false = token required
FARNSWORTH_DEMO_MODE=true
# Token-gated access (when DEMO_MODE=false)
# $FARNS token on Solana: 9crfy4udrHQo8eP6mP393b5qwpGLQgcxVg9acmdwBAGS
FARNSWORTH_REQUIRED_TOKEN=9crfy4udrHQo8eP6mP393b5qwpGLQgcxVg9acmdwBAGS
FARNSWORTH_MIN_TOKEN_BALANCE=1
# ═══════════════════════════════════════════════════════════════════════════════
# DATA STORAGE
# ═══════════════════════════════════════════════════════════════════════════════
# Directory for all Farnsworth data (memories, evolution, embeddings)
FARNSWORTH_DATA_DIR=./data
# ═══════════════════════════════════════════════════════════════════════════════
# ADVANCED (Usually don't need to change)
# ═══════════════════════════════════════════════════════════════════════════════
# Logging level: DEBUG, INFO, WARNING, ERROR
FARNSWORTH_LOG_LEVEL=INFO
# Enable parallel AI consensus (multiple models vote on responses)
ENABLE_PARALLEL_AI=true
# Maximum number of models to query in parallel
MAX_PARALLEL_MODELS=11