# ============================================================================= # Design System Extractor v2 — Environment Variables # ============================================================================= # Copy this file to .env and fill in your values # NEVER commit .env to version control # ============================================================================= # ----------------------------------------------------------------------------- # REQUIRED: Hugging Face Token (Pro recommended for best models) # ----------------------------------------------------------------------------- # HuggingFace Token (for Spaces deployment and model access) # Get yours at: https://huggingface.co/settings/tokens # Pro subscription unlocks: Llama 3.1 405B, Qwen 72B, Command R+, etc. HF_TOKEN=your_huggingface_token_here # HuggingFace Space name (for deployment) HF_SPACE_NAME=your-username/design-system-extractor # ----------------------------------------------------------------------------- # MODEL CONFIGURATION — Diverse Models for Different Tasks # ----------------------------------------------------------------------------- # === Agent 1 (Crawler/Extractor): NO LLM NEEDED === # Pure rule-based extraction using Playwright + CSS parsing # === Agent 2 (Normalizer): FAST STRUCTURED OUTPUT === # Task: Token naming, duplicate detection, pattern inference # Needs: Good instruction following, JSON output, SPEED # # Options (pick one): # - microsoft/Phi-3.5-mini-instruct (Fast, great for structured tasks) # - mistralai/Mistral-7B-Instruct-v0.3 (Fast, good JSON) # - google/gemma-2-9b-it (Balanced speed/quality) # - Qwen/Qwen2.5-7B-Instruct (Good all-rounder) AGENT2_MODEL=microsoft/Phi-3.5-mini-instruct # === Agent 3 (Advisor): STRONG REASONING — Most Important! === # Task: Design system analysis, best practice recommendations, trade-off analysis # Needs: Deep reasoning, design knowledge, creative suggestions # # Options (pick one - Pro tier recommended): # - meta-llama/Llama-3.1-70B-Instruct (Excellent reasoning, long context) # - CohereForAI/c4ai-command-r-plus (Great for analysis & recommendations) # - Qwen/Qwen2.5-72B-Instruct (Strong reasoning, good design knowledge) # - mistralai/Mixtral-8x22B-Instruct-v0.1 (Large MoE, good balance) # - meta-llama/Llama-3.1-405B-Instruct (BEST - if you have Pro++) AGENT3_MODEL=meta-llama/Llama-3.1-70B-Instruct # === Agent 4 (Generator): CODE/JSON SPECIALIST === # Task: Generate Tokens Studio JSON, CSS variables, structured output # Needs: Precise formatting, code generation, schema adherence # # Options (pick one): # - codellama/CodeLlama-34b-Instruct-hf (Code specialist) # - bigcode/starcoder2-15b-instruct-v0.1 (Code generation) # - mistralai/Codestral-22B-v0.1 (Mistral's code model) # - deepseek-ai/deepseek-coder-33b-instruct (Strong code model) AGENT4_MODEL=mistralai/Codestral-22B-v0.1 # === Fallback Model (if primary fails) === FALLBACK_MODEL=mistralai/Mistral-7B-Instruct-v0.3 # ----------------------------------------------------------------------------- # PRESET CONFIGURATIONS # ----------------------------------------------------------------------------- # Uncomment ONE preset below, or configure individually above # --- PRESET: BUDGET (Free tier compatible) --- # AGENT2_MODEL=microsoft/Phi-3.5-mini-instruct # AGENT3_MODEL=mistralai/Mixtral-8x7B-Instruct-v0.1 # AGENT4_MODEL=mistralai/Mistral-7B-Instruct-v0.3 # --- PRESET: BALANCED (Pro tier) --- # AGENT2_MODEL=google/gemma-2-9b-it # AGENT3_MODEL=meta-llama/Llama-3.1-70B-Instruct # AGENT4_MODEL=mistralai/Codestral-22B-v0.1 # --- PRESET: MAXIMUM QUALITY (Pro tier) --- # AGENT2_MODEL=google/gemma-2-27b-it # AGENT3_MODEL=meta-llama/Llama-3.1-405B-Instruct # AGENT4_MODEL=deepseek-ai/deepseek-coder-33b-instruct # ----------------------------------------------------------------------------- # OPTIONAL: Application Settings # ----------------------------------------------------------------------------- DEBUG=false LOG_LEVEL=INFO MAX_PAGES=20 MIN_PAGES=10 # ----------------------------------------------------------------------------- # OPTIONAL: Browser Settings (Playwright) # ----------------------------------------------------------------------------- BROWSER_TYPE=chromium BROWSER_HEADLESS=true BROWSER_TIMEOUT=30000 NETWORK_IDLE_TIMEOUT=5000 # ----------------------------------------------------------------------------- # OPTIONAL: Storage Settings # ----------------------------------------------------------------------------- STORAGE_PATH=/data ENABLE_PERSISTENCE=true MAX_VERSIONS=10 # ----------------------------------------------------------------------------- # OPTIONAL: Rate Limiting # ----------------------------------------------------------------------------- CRAWL_DELAY_MS=1000 MAX_CONCURRENT_CRAWLS=3 RESPECT_ROBOTS_TXT=true # ----------------------------------------------------------------------------- # OPTIONAL: HuggingFace Inference Settings # ----------------------------------------------------------------------------- USE_HF_INFERENCE_API=true HF_INFERENCE_TIMEOUT=120 HF_MAX_NEW_TOKENS=2048 HF_TEMPERATURE=0.3 # ----------------------------------------------------------------------------- # OPTIONAL: UI Settings # ----------------------------------------------------------------------------- SERVER_PORT=7860 SHARE=false UI_THEME=soft # ----------------------------------------------------------------------------- # OPTIONAL: Feature Flags # ----------------------------------------------------------------------------- FEATURE_COLOR_RAMPS=true FEATURE_TYPE_SCALES=true FEATURE_A11Y_CHECKS=true FEATURE_PARALLEL_EXTRACTION=true