Files
slate/.env.example
Stijnus b7ef2247b8 feat: add Cerebras and Fireworks AI LLM providers (#2113)
* fix: improve local model provider robustness and UX

- Extract shared Docker URL rewriting and env conversion into BaseProvider
  to eliminate 4x duplicated code across Ollama and LMStudio
- Add error handling and 5s timeouts to all model-listing fetches so one
  unreachable provider doesn't block the entire model list
- Fix Ollama using createOllama() instead of mutating provider internals
- Fix LLMManager singleton ignoring env updates on subsequent requests
- Narrow cache key to only include provider-relevant env vars instead of
  the entire server environment
- Fix 'as any' casts in LMStudio and OpenAILike by using shared
  convertEnvToRecord helper
- Replace console.log/error with structured logger in OpenAILike
- Fix typo: filteredStaticModesl -> filteredStaticModels in manager
- Add connection status indicator (green/red dot) for local providers
  in the ModelSelector dropdown
- Show helpful "is X running?" message when local provider has no models

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add Cerebras LLM provider

- Add Cerebras provider with 8 models (Llama, GPT OSS, Qwen, ZAI GLM)
- Integrate @ai-sdk/cerebras@0.2.16 for compatibility
- Add CEREBRAS_API_KEY to environment configuration
- Register provider in LLMManager registry

Models included:
- llama3.1-8b, llama-3.3-70b
- gpt-oss-120b (reasoning)
- qwen-3-32b, qwen-3-235b variants
- zai-glm-4.6, zai-glm-4.7 (reasoning)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Fireworks AI LLM provider

- Add Fireworks provider with 6 popular models
- Integrate @ai-sdk/fireworks@0.2.16 for compatibility
- Add FIREWORKS_API_KEY to environment configuration
- Register provider in LLMManager registry

Models included:
- Llama 3.1 variants (405B, 70B, 8B Instruct)
- DeepSeek R1 (reasoning model)
- Qwen 2.5 72B Instruct
- FireFunction V2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add coding-specific models to existing providers

Enhanced providers with state-of-the-art coding models:

**DeepSeek Provider:**
+ DeepSeek V3.2 (integrates thinking + tool-use)
+ DeepSeek V3.2-Speciale (high-compute variant, beats GPT-5)

**Fireworks Provider:**
+ Qwen3-Coder 480B (262K context, best for coding)
+ Qwen3-Coder 30B (fast coding specialist)

**Cerebras Provider:**
+ Qwen3-Coder 480B (2000 tokens/sec!)
- Removed deprecated models (qwen-3-32b, llama-3.3-70b)

Total new models: 4
Total coding models across all providers: 12+

Performance highlights:
- Qwen3-Coder: State-of-the-art coding performance
- DeepSeek V3.2: Integrates thinking directly into tool-use
- ZAI GLM 4.6: 73.8% SWE-bench score
- Ultra-fast inference: 2000 tok/s on Cerebras

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add dynamic model discovery to providers

Implemented getDynamicModels() for automatic model discovery:

**DeepSeek Provider:**
- Fetches models from https://api.deepseek.com/models
- Automatically discovers new models as DeepSeek adds them
- Filters out static models to avoid duplicates

**Cerebras Provider:**
- Fetches models from https://api.cerebras.ai/v1/models
- Auto-discovers new Cerebras models
- Keeps UI up-to-date with latest offerings

**Fireworks Provider:**
- Fetches from https://api.fireworks.ai/v1/accounts/fireworks/models
- Includes context_length from API response
- Discovers new Qwen-Coder and other models automatically

**Moonshot Provider:**
- Fetches from https://api.moonshot.ai/v1/models
- OpenAI-compatible endpoint
- Auto-discovers new Kimi models

Benefits:
-  No manual updates needed when providers add new models
-  Users always have access to latest models
-  Graceful fallback to static models if API fails
-  5-second timeout prevents hanging
-  Caching system built into BaseProvider

Technical details:
- Uses BaseProvider's built-in caching system
- Cache invalidates when API keys change
- Failed API calls fallback to static models
- All endpoints have 5-second timeout protection

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Z.AI provider with GLM models and JWT authentication

Merged changes from PR #2069 to add Z.AI provider:
- Added GLM-4.6 (200K), GLM-4.5 (128K), and GLM-4.5 Flash models
- Implemented secure JWT token generation with HMAC-SHA256 signing
- Added dynamic model discovery from Z.AI API
- Included proper error handling and token validation
- GLM-4.6 achieves 73.8% on SWE-bench coding benchmarks

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 15:26:46 +01:00

222 lines
7.4 KiB
Plaintext

# ======================================
# Environment Variables for Bolt.diy
# ======================================
# Copy this file to .env.local and fill in your API keys
# See README.md for setup instructions
# ======================================
# AI PROVIDER API KEYS
# ======================================
# Anthropic Claude
# Get your API key from: https://console.anthropic.com/
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Cerebras (High-performance inference)
# Get your API key from: https://cloud.cerebras.ai/settings
CEREBRAS_API_KEY=your_cerebras_api_key_here
# Fireworks AI (Fast inference with FireAttention engine)
# Get your API key from: https://fireworks.ai/api-keys
FIREWORKS_API_KEY=your_fireworks_api_key_here
# OpenAI GPT models
# Get your API key from: https://platform.openai.com/api-keys
OPENAI_API_KEY=your_openai_api_key_here
# GitHub Models (OpenAI models hosted by GitHub)
# Get your Personal Access Token from: https://github.com/settings/tokens
# - Select "Fine-grained tokens"
# - Set repository access to "All repositories"
# - Enable "GitHub Models" permission
GITHUB_API_KEY=github_pat_your_personal_access_token_here
# Perplexity AI (Search-augmented models)
# Get your API key from: https://www.perplexity.ai/settings/api
PERPLEXITY_API_KEY=your_perplexity_api_key_here
# DeepSeek
# Get your API key from: https://platform.deepseek.com/api_keys
DEEPSEEK_API_KEY=your_deepseek_api_key_here
# Google Gemini
# Get your API key from: https://makersuite.google.com/app/apikey
GOOGLE_GENERATIVE_AI_API_KEY=your_google_gemini_api_key_here
# Cohere
# Get your API key from: https://dashboard.cohere.ai/api-keys
COHERE_API_KEY=your_cohere_api_key_here
# Groq (Fast inference)
# Get your API key from: https://console.groq.com/keys
GROQ_API_KEY=your_groq_api_key_here
# Mistral
# Get your API key from: https://console.mistral.ai/api-keys/
MISTRAL_API_KEY=your_mistral_api_key_here
# Together AI
# Get your API key from: https://api.together.xyz/settings/api-keys
TOGETHER_API_KEY=your_together_api_key_here
# X.AI (Elon Musk's company)
# Get your API key from: https://console.x.ai/
XAI_API_KEY=your_xai_api_key_here
# Moonshot AI (Kimi models)
# Get your API key from: https://platform.moonshot.ai/console/api-keys
MOONSHOT_API_KEY=your_moonshot_api_key_here
# Z.AI (GLM models with JWT authentication)
# Get your API key from: https://open.bigmodel.cn/usercenter/apikeys
ZAI_API_KEY=your_zai_api_key_here
# Hugging Face
# Get your API key from: https://huggingface.co/settings/tokens
HuggingFace_API_KEY=your_huggingface_api_key_here
# Hyperbolic
# Get your API key from: https://app.hyperbolic.xyz/settings
HYPERBOLIC_API_KEY=your_hyperbolic_api_key_here
# OpenRouter (Meta routing for multiple providers)
# Get your API key from: https://openrouter.ai/keys
OPEN_ROUTER_API_KEY=your_openrouter_api_key_here
# ======================================
# CUSTOM PROVIDER BASE URLS (Optional)
# ======================================
# Ollama (Local models)
# DON'T USE http://localhost:11434 due to IPv6 issues
# USE: http://127.0.0.1:11434
OLLAMA_API_BASE_URL=http://127.0.0.1:11434
# OpenAI-like API (Compatible providers)
OPENAI_LIKE_API_BASE_URL=your_openai_like_base_url_here
OPENAI_LIKE_API_KEY=your_openai_like_api_key_here
# Together AI Base URL
TOGETHER_API_BASE_URL=your_together_base_url_here
# Hyperbolic Base URL
HYPERBOLIC_API_BASE_URL=https://api.hyperbolic.xyz/v1/chat/completions
# LMStudio (Local models)
# Make sure to enable CORS in LMStudio
# DON'T USE http://localhost:1234 due to IPv6 issues
# USE: http://127.0.0.1:1234
LMSTUDIO_API_BASE_URL=http://127.0.0.1:1234
# ======================================
# CLOUD SERVICES CONFIGURATION
# ======================================
# AWS Bedrock Configuration (JSON format)
# Get your credentials from: https://console.aws.amazon.com/iam/home
# Example: {"region": "us-east-1", "accessKeyId": "yourAccessKeyId", "secretAccessKey": "yourSecretAccessKey"}
AWS_BEDROCK_CONFIG=your_aws_bedrock_config_json_here
# ======================================
# GITHUB INTEGRATION
# ======================================
# GitHub Personal Access Token
# Get from: https://github.com/settings/tokens
# Used for importing/cloning repositories and accessing private repos
VITE_GITHUB_ACCESS_TOKEN=your_github_personal_access_token_here
# GitHub Token Type ('classic' or 'fine-grained')
VITE_GITHUB_TOKEN_TYPE=classic
# ======================================
# GITLAB INTEGRATION
# ======================================
# GitLab Personal Access Token
# Get your GitLab Personal Access Token here:
# https://gitlab.com/-/profile/personal_access_tokens
#
# This token is used for:
# 1. Importing/cloning GitLab repositories
# 2. Accessing private projects
# 3. Creating/updating branches
# 4. Creating/updating commits and pushing code
# 5. Creating new GitLab projects via the API
#
# Make sure your token has the following scopes:
# - api (for full API access including project creation and commits)
# - read_repository (to clone/import repositories)
# - write_repository (to push commits and update branches)
VITE_GITLAB_ACCESS_TOKEN=your_gitlab_personal_access_token_here
# Set the GitLab instance URL (e.g., https://gitlab.com or your self-hosted domain)
VITE_GITLAB_URL=https://gitlab.com
# GitLab token type should be 'personal-access-token'
VITE_GITLAB_TOKEN_TYPE=personal-access-token
# ======================================
# VERCEL INTEGRATION
# ======================================
# Vercel Access Token
# Get your access token from: https://vercel.com/account/tokens
# This token is used for:
# 1. Deploying projects to Vercel
# 2. Managing Vercel projects and deployments
# 3. Accessing project analytics and logs
VITE_VERCEL_ACCESS_TOKEN=your_vercel_access_token_here
# ======================================
# NETLIFY INTEGRATION
# ======================================
# Netlify Access Token
# Get your access token from: https://app.netlify.com/user/applications
# This token is used for:
# 1. Deploying sites to Netlify
# 2. Managing Netlify sites and deployments
# 3. Accessing build logs and analytics
VITE_NETLIFY_ACCESS_TOKEN=your_netlify_access_token_here
# ======================================
# SUPABASE INTEGRATION
# ======================================
# Supabase Project Configuration
# Get your project details from: https://supabase.com/dashboard
# Select your project → Settings → API
VITE_SUPABASE_URL=your_supabase_project_url_here
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here
# Supabase Access Token (for management operations)
# Generate from: https://supabase.com/dashboard/account/tokens
VITE_SUPABASE_ACCESS_TOKEN=your_supabase_access_token_here
# ======================================
# DEVELOPMENT SETTINGS
# ======================================
# Development Mode
NODE_ENV=development
# Application Port (optional, defaults to 5173 for development)
PORT=5173
# Logging Level (debug, info, warn, error)
VITE_LOG_LEVEL=debug
# Default Context Window Size (for local models)
DEFAULT_NUM_CTX=32768
# ======================================
# SETUP INSTRUCTIONS
# ======================================
# 1. Copy this file to .env.local: cp .env.example .env.local
# 2. Fill in the API keys for the services you want to use
# 3. All service integration keys use VITE_ prefix for auto-connection
# 4. Restart your development server: pnpm run dev
# 5. Services will auto-connect on startup if tokens are provided
# 6. Go to Settings > Service tabs to manage connections manually if needed