Skip to main content
The llms.txt Generator is configured through environment variables. This guide covers all available settings for both backend and frontend components.

Backend Configuration

Backend configuration is managed through a .env file in the backend/ directory.

Required Settings

string
default:"http://localhost:3000"
Comma-separated list of allowed CORS origins.
.env
The frontend URL must be included in this list for WebSocket connections to work.

Database Configuration

Required for auto-update functionality and site tracking.
string
required
Your Supabase project URL.
.env
Get this from: Supabase Dashboard → Settings → API → Project URL
string
required
Your Supabase anonymous/public key.
.env
Get this from: Supabase Dashboard → Settings → API → anon public

Storage Configuration

Required for hosting generated llms.txt files on a public CDN.
string
required
Cloudflare R2 endpoint URL.
.env
Format: https://<account-id>.r2.cloudflarestorage.com
string
required
R2 access key ID.
.env
Generate from: Cloudflare Dashboard → R2 → Manage R2 API Tokens
string
required
R2 secret access key.
.env
Keep this secret! Never commit to version control.
string
default:"llms-txt"
Name of the R2 bucket for storing llms.txt files.
.env
Create this bucket in the Cloudflare R2 dashboard before using.
string
required
Public domain for accessing R2 files.
.env
Options:
  • Use R2’s public domain: https://pub-<bucket-id>.r2.dev
  • Use a custom domain connected to R2

Brightdata Configuration

Optional proxy service for crawling JavaScript-heavy websites.
string
Your Brightdata customer ID.
.env
Get this from: Brightdata Dashboard → Overview → Customer ID
string
Zone password for your Brightdata zone.
.env
Get this from: Brightdata Dashboard → Zones → Zone Password
string
default:"scraping_browser1"
Brightdata zone to use for crawling.
.env
Options:
  • scraping_browser1 - Standard scraping browser
  • Custom zones you’ve created
boolean
default:true
Global toggle for Brightdata usage.
.env
Individual requests can override this with the useBrightdata parameter.

LLM Enhancement Configuration

Optional AI-powered content optimization using OpenRouter.
boolean
default:false
Enable LLM-powered content enhancement.
.env
Must be explicitly enabled. Requires OPENROUTER_API_KEY to be set.
string
OpenRouter API key for LLM enhancement.
.env
Get this from: https://openrouter.ai/keys
string
default:"x-ai/grok-4.1-fast:free"
OpenRouter model to use for enhancement.
.env
Options:
  • x-ai/grok-4.1-fast:free - Grok 4.1 Fast (free tier)
  • anthropic/claude-3-5-sonnet - Claude 3.5 Sonnet
  • openai/gpt-4-turbo - GPT-4 Turbo
See OpenRouter docs for all models.
float
Timeout for LLM API requests in seconds.
.env
integer
default:3
Maximum retry attempts for failed LLM requests.
.env
float
Temperature parameter for LLM generation (0.0-1.0).
.env
  • Lower values (0.1-0.3): More consistent, deterministic output
  • Higher values (0.7-1.0): More creative, varied output

Security Configuration

string
API key for authenticating WebSocket connections.
.env
Generate a secure key:
If not set, WebSocket connections will not require authentication. Only use this for development.
string
Secret token for authenticating cron job requests.
.env
Required for:
  • /internal/cron/recrawl - Scheduled recrawl endpoint
Generate a secure token:

Frontend Configuration

Frontend configuration is managed through a .env.local file in the frontend/ directory.
string
required
WebSocket URL for the backend API.
.env.local
Use ws:// for local development and wss:// (secure WebSocket) for production.
string
API key for authenticating with the backend (optional).
.env.local
Only use this for testing. Production should use JWT tokens via the /auth/token endpoint.

Configuration File Reference

The backend uses Pydantic Settings for configuration management:
config.py

Environment File Examples

Development Environment

Production Environment

Validation

Verify your configuration:
1

Test backend health

Health Check
Expected response:
2

Test database connection

If Supabase is configured, the backend will log:
3

Test R2 storage

Generate a llms.txt file and verify the hosted URL is accessible.
4

Test authentication

Get Token
Should return a JWT token.

Troubleshooting

Symptom: WebSocket connection failed: CORS errorSolution:
  • Add your frontend URL to CORS_ORIGINS in backend .env
  • Ensure URLs match exactly (including protocol and port)
  • Restart the backend after changing .env
Example
Symptom: Generated llms.txt shows but no public URLSolution:
  • Verify all R2 configuration variables are set:
    • R2_ENDPOINT
    • R2_ACCESS_KEY
    • R2_SECRET_KEY
    • R2_BUCKET
    • R2_PUBLIC_DOMAIN
  • Verify the bucket exists in Cloudflare R2
  • Check bucket permissions allow public reads
Symptom: Sites not recrawling on scheduleSolution:
  • Verify SUPABASE_URL and SUPABASE_KEY are set
  • Check the crawl_sites table exists in Supabase
  • Verify AWS Lambda/cron job is configured
  • Check CRON_SECRET matches between backend and Lambda
Symptom: “Failed to connect to Brightdata” errorsSolution:
  • Verify BRIGHTDATA_API_KEY (customer ID) is correct
  • Verify BRIGHTDATA_PASSWORD matches your zone password
  • Check BRIGHTDATA_ZONE exists in your Brightdata account
  • Ensure you have credits/subscription active
Symptom: No enhancement despite enabling in UISolution:
  • Set LLM_ENHANCEMENT_ENABLED=true in backend .env
  • Verify OPENROUTER_API_KEY is valid
  • Check OpenRouter account has credits
  • Review backend logs for LLM errors

Best Practices

Use Environment Variables

Never hardcode secrets in source code. Always use environment variables.

Rotate Keys Regularly

Change API keys, tokens, and secrets periodically (every 90 days).

Separate Environments

Use different credentials for development, staging, and production.

Validate on Deploy

Test all endpoints after deployment to catch configuration issues early.

Next Steps

Web Interface

Learn how to use the web UI with your configuration

API Usage

Integrate programmatically using the WebSocket API

Deployment

Deploy to production with proper configuration

Development

Set up a local development environment