File size: 5,736 Bytes
9f5ee50 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# =============================================================================
# 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
|