# ============================================================================ # HiMe — Environment Configuration # Copy this to .env, fill the REQUIRED block; all else has sensible defaults. # ============================================================================ # ---------------------------------------------------------------------------- # Required # ---------------------------------------------------------------------------- # Pick your provider, then put its key in §LLM provider keys below. DEFAULT_LLM_PROVIDER=gemini # For IM chat (Telegram/Feishu) also fill the relevant gateway section below. # ---------------------------------------------------------------------------- # LLM provider keys # ---------------------------------------------------------------------------- # Primary GEMINI_API_KEY= # Google Gemini (recommended) GOOGLE_API_KEY= # Google AI key (Gemini/Google providers fallback) OPENAI_API_KEY= # OpenAI (GPT-4.5 / GPT-5) ANTHROPIC_API_KEY= # Anthropic (Claude 3.5 / 4.x) DEEPSEEK_API_KEY= # DeepSeek (V4 — flash / pro, 1M ctx) # OpenAI-compatible GROQ_API_KEY= # Groq MISTRAL_API_KEY= # Mistral AI MINIMAX_API_KEY= # MiniMax XAI_API_KEY= # x.AI (Grok) OPENROUTER_API_KEY= # OpenRouter (multi-provider router) PERPLEXITY_API_KEY= # Perplexity ZHIPUAI_API_KEY= # ZhipuAI (GLM family) # Cloud-hosted # Azure OpenAI — endpoint URL + key + API version AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= AZURE_OPENAI_API_VERSION=2024-12-01-preview # Google Cloud Vertex AI — uses ADC; set GOOGLE_CLOUD_API_KEY for API-key auth GOOGLE_CLOUD_PROJECT= GOOGLE_CLOUD_LOCATION=us-central1 GOOGLE_CLOUD_API_KEY= # Amazon Bedrock — IAM credentials AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION=us-east-1 # Local # vLLM — locally-served OpenAI-compatible endpoint VLLM_BASE_URL=http://localhost:8421/v1 VLLM_MODEL=gemma-4-26b-a4b # ---------------------------------------------------------------------------- # Agent behavior # ---------------------------------------------------------------------------- #DEFAULT_MODEL=gemini-3-flash-preview # overrides DEFAULT_MODEL_ # Capacity fallback: re-issues call after 3 consecutive 503/529/overloaded FALLBACK_LLM_PROVIDER= FALLBACK_LLM_MODEL= AGENT_MAX_ITERATIONS=100 # hard safety limit per analysis/chat AGENT_CONTEXT_WINDOW_SIZE=20 # turn groups kept in full (rest auto-summarized) AGENT_MAX_TOKENS=8192 # max tokens per LLM response (0 = no limit) #AGENT_MAX_CONTEXT_TOKENS=180000 # token-budget for compression #AGENT_CONTEXT_WINDOW_HOURS=24 # how far back agent reads on startup #CHAT_MAX_TURNS=20 # hard cap for chat loop turns CHAT_HISTORY_SIZE=20 # sliding window per gateway chat (messages) AUTO_RESTORE_AGENT=false # restart last agent on backend startup # OpenAI/Azure reasoning (gpt-5*, o1-o4): minimal|low|medium|high|xhigh|none # Empty = server default ("medium"). "minimal" disables parallel tools. OPENAI_REASONING_EFFORT= # Fact verification LLM (empty = reuse agent's provider/model) FACT_VERIFY_LLM_PROVIDER= FACT_VERIFY_LLM_MODEL= # IANA timezone name. Cron expressions in scheduled_tasks and the # wall-clock shown in agent prompts are interpreted in this zone, so # scheduling is independent of the container's system clock. # Examples: UTC, Europe/London, America/New_York, Asia/Shanghai. TIMEZONE=UTC # ---------------------------------------------------------------------------- # Per-provider default models (April 2026 lineup) # ---------------------------------------------------------------------------- # Dashboard placeholders + create_provider(model=None) fallbacks. Each block # shows the provider's small / medium / large variants — uncomment one to # override the built-in default (= medium tier). # DEFAULT_MODEL_AZURE_OPENAI = your Azure *deployment name* (not model name). # vLLM is excluded — it always uses VLLM_MODEL above. # Anthropic Claude 4.x: small | medium | large # claude-haiku-4-5 | claude-sonnet-4-6 | claude-opus-4-7 #DEFAULT_MODEL_ANTHROPIC=claude-sonnet-4-6 # OpenAI GPT-5.4 family: small | medium | large # gpt-5.4-nano | gpt-5.4-mini | gpt-5.4 #DEFAULT_MODEL_OPENAI=gpt-5.4-mini # Azure OpenAI — values are your *deployment names*; deploy these models first # gpt-5-nano | gpt-5-mini | gpt-5 #DEFAULT_MODEL_AZURE_OPENAI=gpt-5-mini # Google Gemini 3 family: small | medium | large # gemini-3.1-flash-lite-preview | gemini-3-flash-preview | gemini-3.1-pro-preview #DEFAULT_MODEL_GEMINI=gemini-3-flash-preview # Google Vertex AI (same Gemini lineup, hosted on Vertex) #DEFAULT_MODEL_GOOGLE_VERTEX=gemini-3-flash-preview # DeepSeek V4 (April 2026, 1M ctx, 384K max output): flash | pro # deepseek-v4-flash (284B / 13B active — fast, cheap default) # deepseek-v4-pro (1.6T / 49B active — frontier; 75% off until 2026/05/31) # Legacy ``deepseek-chat`` / ``deepseek-reasoner`` route to V4-Flash and are # fully retired after 2026-07-24 15:59 UTC. #DEFAULT_MODEL_DEEPSEEK=deepseek-v4-flash # DeepSeek thinking-mode toggle. HIME default = "disabled" (fast/cheap for # agentic tool-calling loops). Set to "enabled" for deep reasoning, or leave # empty to fall back to the DeepSeek server default (thinking on). DEEPSEEK_THINKING=disabled # DeepSeek reasoning depth (only meaningful when thinking is enabled): high | max #DEEPSEEK_REASONING_EFFORT= # Mistral 3 family: small | medium | large # mistral-small-latest | mistral-medium-latest | mistral-large-latest #DEFAULT_MODEL_MISTRAL=mistral-medium-latest # Groq (open-weight hosted; format / for Llama 4 / others): # meta-llama/llama-4-scout-17b-16e-instruct # llama-3.3-70b-versatile # meta-llama/llama-4-maverick-17b-128e-instruct #DEFAULT_MODEL_GROQ=llama-3.3-70b-versatile # xAI Grok 4 family: small (coding) | medium (fast) | large (frontier) # grok-code-fast-1 | grok-4-1-fast-reasoning | grok-4.20-reasoning #DEFAULT_MODEL_XAI=grok-4-1-fast-reasoning # OpenRouter (router; use /): small | medium | large # google/gemini-3-flash | anthropic/claude-sonnet-4-6 | anthropic/claude-opus-4-7 #DEFAULT_MODEL_OPENROUTER=anthropic/claude-sonnet-4-6 # Perplexity Sonar: search | reasoning | grounded-pro # sonar | sonar-reasoning | sonar-pro #DEFAULT_MODEL_PERPLEXITY=sonar-pro # Amazon Bedrock — Nova: small | mid | large # amazon.nova-micro-v1:0 | amazon.nova-lite-v1:0 | amazon.nova-pro-v1:0 # (Or use Anthropic on Bedrock: anthropic.claude-sonnet-4-6 / anthropic.claude-opus-4-7) #DEFAULT_MODEL_AMAZON_BEDROCK=amazon.nova-pro-v1:0 # MiniMax: legacy | M2 | M2.5 # abab6.5s-chat | MiniMax-M2 | MiniMax-M2.5 #DEFAULT_MODEL_MINIMAX=MiniMax-M2 # ZhipuAI / Z.AI GLM: small | flash | flagship # glm-4-air | glm-4.7-flash | glm-4.7 (glm-5 = preview) #DEFAULT_MODEL_ZHIPUAI=glm-4.7 # ---------------------------------------------------------------------------- # Storage # ---------------------------------------------------------------------------- DATA_STORE_PATH=./data/data_stores # wearable sensor data (parquet, DBs) AGENT_LOGS_PATH=./logs # all logs (backend, frontend, LLM CSV) MEMORY_DB_PATH=./memory # agent memory (SQLite, state JSON) #DATA_RETENTION_DAYS=30 # rolling retention window (days) # ---------------------------------------------------------------------------- # Networking & domain # ---------------------------------------------------------------------------- #API_HOST=0.0.0.0 #API_PORT=8000 # CORS origins (JSON array string). Add your public domain when deploying. CORS_ORIGINS='["http://localhost:5173", "http://localhost:3000"]' # Public URLs shown in logs/scripts (leave blank for local-only) DASHBOARD_URL= API_URL= WATCH_URL= # ---------------------------------------------------------------------------- # API authentication # ---------------------------------------------------------------------------- # When set, /api/* requires `Authorization: Bearer `; WebSocket clients # may pass `?token=`. Empty = disabled (unsafe for public deployments). API_AUTH_TOKEN= # ---------------------------------------------------------------------------- # Telegram gateway # ---------------------------------------------------------------------------- # Telegram is one of two supported IM gateways. CHAT_ID= # default chat for autonomous pushes TELEGRAM_TOKEN= # bot token from @BotFather TELEGRAM_GATEWAY_ENABLED=false # true = enable two-way (long-poll) TELEGRAM_POLL_TIMEOUT=30 # long-poll timeout (seconds) TELEGRAM_GROUP_LINK= # group link (iOS app jump) TELEGRAM_ALLOWED_CHAT_IDS= # csv; empty = only CHAT_ID (default-deny) # ---------------------------------------------------------------------------- # Feishu (Lark) gateway # ---------------------------------------------------------------------------- # Feishu is the second IM gateway; pick this OR Telegram, not usually both. FEISHU_GATEWAY_ENABLED=false FEISHU_APP_ID= # from Feishu developer console FEISHU_APP_SECRET= FEISHU_TRANSPORT=ws # "ws" (lark_oapi WebSocket) or "webhook" FEISHU_WEBHOOK_PATH=/api/feishu/webhook # Required when FEISHU_TRANSPORT=webhook FEISHU_VERIFICATION_TOKEN= FEISHU_ENCRYPT_KEY= FEISHU_DEFAULT_CHAT_ID= # open_chat_id for outbound pushes FEISHU_ALLOWED_CHAT_IDS= # csv open_chat_ids; empty = default-deny # ---------------------------------------------------------------------------- # WeChat (Weixin ClawBot / iLink) gateway # ---------------------------------------------------------------------------- # Third IM gateway, talks to the iLink bot API. One-time setup: # 1. enable here, set the user-id allowlist below, restart the backend # 2. on the host, run: python -m backend.weixin.qr_login # 3. in WeChat, open Settings → Plugins → ClawBot, scan the QR # The bot_token is cached at WEIXIN_BOT_TOKEN_PATH; re-run step 2 only if # getupdates starts returning 401. Note: outbound replies require a recent # context_token from the user, so proactive pushes only work after the user # has messaged the bot at least once. WEIXIN_GATEWAY_ENABLED=false WEIXIN_BOT_TOKEN_PATH=./data/weixin_bot_token.json # WEIXIN_DEFAULT_USER_ID — outbound push target, e.g. xxx@im.wechat. # Only needed for autonomous pushes initiated by the agent (e.g. scheduled # reports). For chat replies it is filled automatically from the inbound # message, so you can leave this blank until you actually want pushes. WEIXIN_DEFAULT_USER_ID= # WEIXIN_ALLOWED_USER_IDS — csv of user_ids. Empty = trust whoever scanned # the QR (the only person who can reach the bot anyway, since ClawBot has # no shareable handle). Fill this only if you scanned with one account but # want a different account to talk to the bot. WEIXIN_ALLOWED_USER_IDS= # ---------------------------------------------------------------------------- # In-app iOS channel (native chat — alternative to the IM gateways above) # ---------------------------------------------------------------------------- # When enabled, the iOS app talks to the agent directly (POST /api/agent/chat # in, replies stream over the /api/stream/agent WebSocket out), authenticated # by the API bearer token (if API_AUTH_TOKEN is set). No bot binding required. # Set to false if you only want the IM gateways. IOS_GATEWAY_ENABLED=true # Accept user→agent image uploads (needs a vision-capable LLM: anthropic / # gemini / openai). Off by default; turn on once a vision model is in use. IOS_VISION_ENABLED=false # Max accepted inbound image size in bytes (default 5 MiB). IOS_MAX_IMAGE_BYTES=5242880 # --- APNs (Apple Push Notification service) — proactive push to a closed app. # Disabled by default: replies/reports are delivered when the app next opens. # To enable real background push: create an APNs Auth Key (.p8) in your Apple # Developer account, set the fields below, and `pip install aioapns`. APNS_ENV # must match your build (sandbox for debug/dev builds, production for TestFlight # / App Store). APNS_ENABLED=false APNS_KEY_PATH= APNS_KEY_ID= APNS_TEAM_ID= APNS_BUNDLE_ID= APNS_ENV=production # ---------------------------------------------------------------------------- # Skills subsystem # ---------------------------------------------------------------------------- # os.pathsep-separated skill-package dirs. Registry also auto-scans # ~/.hime/skills and ./skills on every agent start. HIME_SKILLS_DIR=./skills # ---------------------------------------------------------------------------- # Code-tool sandbox # ---------------------------------------------------------------------------- # Runs agent-generated Python in Docker (--network none, limited). # Requires Docker daemon (Engine / Desktop) running. CODE_TOOL_DOCKER_SANDBOX=false CODE_TOOL_DOCKER_IMAGE=python:3.12-slim # ---------------------------------------------------------------------------- # Data source # ---------------------------------------------------------------------------- # Keep `live` unless using historic dataset playback. DATA_SOURCE=live # ---------------------------------------------------------------------------- # Localization # ---------------------------------------------------------------------------- # Affects backend reply language. Unknown values fall back to 'en'. DEFAULT_USER_LANGUAGE=en