# ============================================================================= # AI Consultants - Environment Variables # ============================================================================= # Copy this file to .env and customize as needed. # All variables have sensible defaults - only override what you need. # # IMPORTANT: At least 2 consultants must be enabled for the system to work. # # Export variables before running, or source this file: # source .env && ./scripts/consult_all.sh "Your question" # # For detailed setup instructions, see: docs/SETUP.md # ============================================================================= # API KEYS & AUTHENTICATION # ============================================================================= # Each CLI tool requires its own authentication. Set the appropriate API keys # or use the CLI's built-in auth flow. # Google Gemini API key (only needed for API mode; the agy CLI uses OAuth) # Get yours at: https://makersuite.google.com/app/apikey # CLI mode uses the Antigravity CLI (agy); sign in by running `agy` once. # GEMINI_API_KEY=your-google-api-key # OpenAI API Key (required for Codex) # Get yours at: https://platform.openai.com/api-keys # OPENAI_API_KEY=sk-your-openai-api-key # Mistral API Key # Get yours at: https://console.mistral.ai/api-keys/ # MISTRAL_API_KEY=your-mistral-api-key # Anthropic API Key (for Claude API mode or synthesis) # Get yours at: https://console.anthropic.com/settings/keys # ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key # ============================================================================= # API-BASED CONSULTANT KEYS # ============================================================================= # These are required for API transports and API-only consultants. # Qwen3 (Alibaba DashScope) - The Analyst # Get yours at: https://dashscope.console.aliyun.com/ # QWEN3_API_KEY=your_dashscope_api_key # GLM (Zhipu AI) - The Methodologist # Get yours at: https://open.z.ai/ # GLM_API_KEY=your_zhipu_api_key # Grok API fallback (the Grok Build CLI normally uses its own login) # Official docs call this XAI_API_KEY; GROK_API_KEY remains the project setting. # Get yours at: https://console.x.ai/ # GROK_API_KEY=your_xai_api_key # DeepSeek - The Code Specialist # Get yours at: https://platform.deepseek.com/ # DEEPSEEK_API_KEY=your_deepseek_api_key # MiniMax - The Pragmatic Optimizer (v2.10) # Get yours at: https://platform.minimax.io/user-center/basic-information/interface-key # MINIMAX_API_KEY=your_minimax_api_key # ============================================================================= # ENABLED CONSULTANTS # ============================================================================= # Set to "false" to disable a consultant you haven't configured. # MINIMUM 2 consultants must be enabled for a useful coverage panel. # CLI-based consultants (default: enabled) ENABLE_GEMINI=true ENABLE_CODEX=true ENABLE_MISTRAL=true ENABLE_KIMI=true ENABLE_QWEN3=true ENABLE_GROK=true ENABLE_MINIMAX=true ENABLE_CLAUDE=true # API-only consultants (default: disabled - require API keys) ENABLE_GLM=false ENABLE_DEEPSEEK=false # ============================================================================= # CLI/API MODE SWITCHING (v2.6+) # ============================================================================= # 7 agents support switching: Gemini, Codex, Claude, Mistral, Qwen3, Grok, MiniMax # When API mode is enabled, CLI mode is automatically disabled. # GEMINI_USE_API is auto-resolved when left UNSET (v2.15.1): API mode if # GEMINI_API_KEY is present (no CLI install / OAuth needed — best for npm/npx), # else the agy CLI. Leave it commented to keep auto-resolution; uncomment only # to force a specific mode (an explicit value disables auto-detection). # GEMINI_USE_API=false # Force Google AI API (true) or agy CLI (false) # Leave the following commented to keep CLI-first auto-resolution (CLI wins # when installed; API is the fallback for a key with no CLI). Uncomment only # to force a specific transport for that agent. # CODEX_USE_API=false # Use OpenAI API instead of codex CLI # CLAUDE_USE_API=false # Use Anthropic API instead of claude CLI # MISTRAL_USE_API=false # Use Mistral API instead of vibe CLI # QWEN3_USE_API=false # Use qwen CLI (default) or DashScope API (v2.7) # MINIMAX_USE_API=false # Unset = API for legacy key users, otherwise mmx CLI # API endpoints (override if using custom endpoints) # GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models # CODEX_API_URL=https://api.openai.com/v1/chat/completions # CLAUDE_API_URL=https://api.anthropic.com/v1/messages # MISTRAL_API_URL=https://api.mistral.ai/v1/chat/completions # QWEN3_API_URL=https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation # Token Plan alternative (OpenAI-compatible, needs QWEN3_FORMAT=openai and a # Token Plan key in QWEN3_API_KEY; pass the FULL path, it is used verbatim): # https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions # ============================================================================= # MODEL CONFIGURATION (August 2026 premium defaults) # ============================================================================= # Gemini - The Architect (CLI mode via Antigravity CLI: agy) GEMINI_MODEL="Gemini 3.7 Flash (High)" GEMINI_TIMEOUT=180 GEMINI_CMD=agy # API-mode model ID (only used when GEMINI_USE_API=true) GEMINI_API_MODEL=gemini-3.1-pro-preview # Gemini 3.1 Pro and 3.6 Flash remain valid CLI pins. API mode stays on the # separately verified 3.1 Pro ID; gemini-3.7-flash is an API-only opt-in until # that transport completes its own authenticated smoke. # Reasoning effort for the agy CLI. Passed as --effort . Accepts only # low|medium|high; anything else is rejected by the provider and surfaces as a # diagnosed error (provider owns the enum — same stance as QWEN3_REASONING_EFFORT). # GEMINI_REASONING_EFFORT= # Codex - The Pragmatist CODEX_MODEL=gpt-6-astra CODEX_API_MAX_TOKENS=16384 CODEX_TIMEOUT=180 CODEX_CMD=codex # Reasoning effort for the codex CLI (and API mode). Passed as # -c model_reasoning_effort=. The provider owns the accepted enum; # an unsupported value is rejected rather than silently ignored. # CODEX_REASONING_EFFORT= # Mistral Vibe - The Devil's Advocate # API model ID. Vibe uses the separate CLI alias below. Mistral Medium 3.5, # Large 3, and Small 4 API IDs are documented opt-ins until an API smoke passes. MISTRAL_MODEL=mistral-large-3 MISTRAL_CLI_MODEL=mistral-medium-3.5 MISTRAL_API_MAX_TOKENS=4096 # Official API opt-ins: use mistral-medium-3-5, mistral-large-2512, or # mistral-small-2603 for MISTRAL_MODEL after an authenticated API smoke. MISTRAL_TIMEOUT=180 MISTRAL_CMD=vibe MISTRAL_MAX_TURNS=4 # Kimi - The Eastern Sage (K3 via Kimi Code CLI) KIMI_MODEL=kimi-code/k3 # max_quality selects the inventory-probed kimi-code/k3-256k target. KIMI_TIMEOUT=180 KIMI_CMD=kimi # Claude - The Synthesizer CLAUDE_MODEL=claude-fable-5-1 # ai-consultants:default # For the lower-cost standard/medium Claude tier, set CLAUDE_MODEL to # claude-opus-5 (or apply_model_tier standard for a single run). CLAUDE_TIMEOUT=240 CLAUDE_CMD=claude CLAUDE_API_MAX_TOKENS=16384 # Reasoning effort for the claude CLI (and API mode). Passed as --effort . # The provider owns the accepted enum; an unsupported value is rejected rather # than silently ignored. # CLAUDE_REASONING_EFFORT= # Qwen3 - The Analyst (CLI/API switchable v2.7) QWEN3_MODEL=qwen3.7-max QWEN3_TIMEOUT=180 QWEN3_MAX_QUALITY_TIMEOUT=600 QWEN3_API_MAX_TOKENS=16384 QWEN3_CMD=qwen # Reasoning effort. API mode ONLY - the qwen CLI has no effort flag, so in CLI # mode this is ignored (with a warning); set model.reasoningEffort in # ~/.qwen/settings.json instead. Accepted: none|minimal|low|medium|high|xhigh|max # (the provider's own enum). The valid subset depends on the model: # qwen3.8-max takes all of them EXCEPT 'none' - thinking cannot be # disabled on it - and defaults to xhigh. An unsupported combination is # rejected by the provider with a 400, not silently ignored. # QWEN3_REASONING_EFFORT= # GROK_USE_API is auto-resolved CLI-first: Grok Build is used whenever `grok` # is installed; the xAI API is selected when the CLI is unavailable and a key # exists. A failed CLI launch also falls back to the API at runtime. # GROK_USE_API=false # Grok OAuth concurrency: shared keeps one runner-owned credential generation # so parallel consultants can safely reuse refresh rotation. serialized holds # the adapter lock for the full CLI call and is intended for diagnostics. # GROK_OAUTH_MODE=shared # ============================================================================= # API-ONLY AND FALLBACK CONFIGURATION # ============================================================================= # GLM - The Methodologist GLM_MODEL=glm-5.3-flash GLM_TIMEOUT=180 GLM_API_MAX_TOKENS=16384 GLM_API_URL=https://api.z.ai/api/coding/paas/v4/chat/completions # GLM_REASONING_EFFORT= # max_quality sets max # Grok Build CLI + xAI API fallback - The Provocateur GROK_CMD=grok GROK_MODEL=grok-4.6 GROK_TIMEOUT=180 GROK_MAX_TURNS=4 GROK_OAUTH_MODE=shared GROK_API_MAX_TOKENS=4096 GROK_API_URL=https://api.x.ai/v1/chat/completions # GROK_REASONING_EFFORT= # max_quality sets xhigh (Grok Build maximum) # DeepSeek - The Code Specialist DEEPSEEK_MODEL=deepseek-flash DEEPSEEK_TIMEOUT=180 DEEPSEEK_MAX_QUALITY_TIMEOUT=600 DEEPSEEK_API_MAX_TOKENS=16384 DEEPSEEK_API_URL=https://api.deepseek.com/v1/chat/completions # DEEPSEEK_REASONING_EFFORT= # max_quality sets max # MiniMax - The Pragmatic Optimizer (CLI via mmx by default, v2.21; API opt-in) MINIMAX_CMD=mmx MINIMAX_MODEL=MiniMax-M2.7 # max_quality selects the smoke-tested MiniMax-M3 target. MINIMAX_TIMEOUT=180 MINIMAX_API_MAX_TOKENS=4096 MINIMAX_MAX_TOKENS=4096 MINIMAX_MAX_QUALITY_TOKENS=16384 MAX_QUALITY_API_MAX_TOKENS=16384 MINIMAX_API_URL=https://api.minimax.io/v1/chat/completions # Wire format for a consultant's API mode. Honored since v2.25 (previously # declared but never read). Values: google_ai|anthropic|qwen|openai; an # unrecognized value falls back to the consultant's default with a warning. # Change this only to reach an endpoint that speaks a different protocol than # the provider's own - e.g. QWEN3_FORMAT=openai for Qwen Cloud Token Plan, # which is OpenAI-compatible while DashScope is not. See docs/RECIPES.md. QWEN3_FORMAT=qwen GLM_FORMAT=openai GROK_FORMAT=openai DEEPSEEK_FORMAT=openai MINIMAX_FORMAT=openai # ============================================================================= # FEATURES v2.8 # ============================================================================= # Defaults used when --preset / --strategy are omitted # DEFAULT_PRESET=balanced DEFAULT_STRATEGY=coverage # The invoking integration normally sets this per run for self-exclusion. INVOKING_AGENT=unknown # Personas: specialized roles for each consultant ENABLE_PERSONA=true # Auto-synthesis: automatic synthesis of all responses ENABLE_SYNTHESIS=true SYNTHESIS_CMD=claude # Optional synthesis-specific model. Empty delegates model selection to the CLI. SYNTHESIS_MODEL= SYNTHESIS_EXTRACT_FIELDS=true SYNTH_MAX=10 SYNTH_DETAIL_MAX_CHARS=4000 SYNTHESIS_TIMEOUT=240 SYNTHESIS_TOTAL_TIMEOUT=480 # Health gate and quorum: validate the live panel before spending on a full run ENABLE_HEALTH_GATE=false # Adds one small ping per selected consultant HEALTH_GATE_TIMEOUT=30 QUORUM_MIN=2 QUORUM_ACTION=warn # warn or stop # ============================================================================= # SEMANTIC CACHING (v2.3) # ============================================================================= ENABLE_SEMANTIC_CACHE=true CACHE_TTL_HOURS=24 # CACHE_DIR=/custom/cache/path # API retry and rate-limit controls API_BASE_BACKOFF=2 API_MAX_BACKOFF=60 API_RATE_LIMIT=30 # Optional response limits by question category ENABLE_RESPONSE_LIMITS=false MAX_RESPONSE_TOKENS_BY_CATEGORY=QUICK_SYNTAX:200,CODE_REVIEW:800,BUG_DEBUG:800,ARCHITECTURE:1000,SECURITY:1000,DATABASE:600,GENERAL:500 # ============================================================================= # BUDGET ENFORCEMENT (v2.4, opt-in) # ============================================================================= ENABLE_BUDGET_LIMIT=false BUDGET_ACTION=warn # warn or stop MAX_SESSION_COST=1.00 # ============================================================================= # SMART ROUTING # ============================================================================= # Question classification (required for smart routing) ENABLE_CLASSIFICATION=true CLASSIFICATION_MODE=pattern # pattern (fast) or llm (accurate) # Smart routing: select consultants based on question category ENABLE_SMART_ROUTING=false MIN_AFFINITY=7 # Minimum affinity score (1-10) to include # Cost-aware routing (v2.3) ENABLE_COST_AWARE_ROUTING=false USE_ECONOMIC_MODELS_FOR_SIMPLE=true COMPLEXITY_THRESHOLD_SIMPLE=3 COMPLEXITY_THRESHOLD_MEDIUM=6 FALLBACK_CONFIDENCE_THRESHOLD=7 # ============================================================================= # COST MANAGEMENT # ============================================================================= ENABLE_COST_TRACKING=true WARN_AT_COST=0.50 # Warning threshold (USD) ENABLE_RELIABILITY_TRACKING=true # COST_TRACKING_FILE=/custom/data/costs.json # RELIABILITY_FILE=/custom/data/reliability.json # COST_RATES_FILE=/custom/config/cost_rates.json # ============================================================================= # SESSION MANAGEMENT # ============================================================================= SESSION_CLEANUP_DAYS=7 # Deprecated no-op; retained for v4.x compatibility # SESSION_DIR=/custom/state/sessions # Deprecated no-ops; retained for v4.x compatibility ENABLE_PROGRESS_BARS=true ENABLE_EARLY_TERMINATION=true # ============================================================================= # PRE-FLIGHT CHECKS # ============================================================================= ENABLE_PREFLIGHT=false # Run health check before each consultation PREFLIGHT_QUICK=true # Quick mode: CLI check only, skip API test # ============================================================================= # RETRY & TIMEOUT # ============================================================================= MAX_RETRIES=2 # Max retry attempts on failure RETRY_DELAY_SECONDS=5 # Pause between retries LAUNCH_STAGGER_MAX_SECONDS=2 # Output directory base # DEFAULT_OUTPUT_DIR_BASE=/custom/cache/consultations # Live doctor probe timeout DOCTOR_LIVE_TIMEOUT=45 # ============================================================================= # CONTEXT HANDOFF & TOKEN OPTIMIZATION # ============================================================================= TOKEN_OPTIMIZATION_MODE=ast MAX_CONTEXT_FILE_BYTES=8000 ENABLE_AST_EXTRACTION=true ENABLE_SYMBOL_COMPRESSION=false ENABLE_SEMANTIC_CHUNKING=true CHUNK_MAX_TOKENS=500 CHUNK_OVERLAP_LINES=5 CHUNK_PRIORITY_KEYWORDS=main,export,public,api,handler,controller INCLUDE_DOCSTRINGS=true INCLUDE_CRITICAL_COMMENTS=true MAX_BODY_SUMMARY_LINES=3 MIN_IDENTIFIER_LENGTH=8 PRESERVE_EXPORTS=true USE_COMPACT_PROMPTS=true # Deprecated no-op; retained for v4.x compatibility FORCE_PROJECT_TREE=false ENABLE_SELECTIVE_CONTEXT=false # Deprecated no-op; retained for v4.x compatibility MAX_FILES_PER_CONSULTANT=5 # Deprecated no-op; retained for v4.x compatibility # ============================================================================= # REPORTING & STORAGE # ============================================================================= ENABLE_COMPACT_REPORT=true REPORT_MAX_JSON_LINES=50 # RATE_LIMIT_DIR=/custom/cache/ratelimit # CHUNK_TEMP_DIR=/custom/cache/chunks # ============================================================================= # CUSTOM ROUTING & PERSONAS # ============================================================================= # AFFINITY_FILE=/path/to/affinity.json # Each consultant supports _PERSONA_ID (1-21), _PERSONA (custom prompt), and # _PERSONA_NAME (custom display name). Uncomment only the overrides you need. # GEMINI_PERSONA_ID=1 # CODEX_PERSONA_ID=2 # MISTRAL_PERSONA_ID=3 # KIMI_PERSONA_ID=20 # CLAUDE_PERSONA_ID=18 # QWEN3_PERSONA_ID=6 # GLM_PERSONA_ID=7 # GROK_PERSONA_ID=8 # DEEPSEEK_PERSONA_ID=17 # MINIMAX_PERSONA_ID=21 # GEMINI_PERSONA=Custom persona instructions # GEMINI_PERSONA_NAME=Custom persona name # CODEX_PERSONA=Custom persona instructions # CODEX_PERSONA_NAME=Custom persona name # MISTRAL_PERSONA=Custom persona instructions # MISTRAL_PERSONA_NAME=Custom persona name # KIMI_PERSONA=Custom persona instructions # KIMI_PERSONA_NAME=Custom persona name # CLAUDE_PERSONA=Custom persona instructions # CLAUDE_PERSONA_NAME=Custom persona name # QWEN3_PERSONA=Custom persona instructions # QWEN3_PERSONA_NAME=Custom persona name # GLM_PERSONA=Custom persona instructions # GLM_PERSONA_NAME=Custom persona name # GROK_PERSONA=Custom persona instructions # GROK_PERSONA_NAME=Custom persona name # DEEPSEEK_PERSONA=Custom persona instructions # DEEPSEEK_PERSONA_NAME=Custom persona name # MINIMAX_PERSONA=Custom persona instructions # MINIMAX_PERSONA_NAME=Custom persona name # Calibration judge commands TASTE_JUDGE_CMD= JUDGE_CLI=claude # ============================================================================= # LOGGING # ============================================================================= LOG_LEVEL=INFO # DEBUG, INFO, WARN, ERROR