Configuration
Environment variables and configuration options
textrawl is configured via environment variables in a .env file.
Environment Variables
Database Connection
| Variable | Required | Description |
|---|---|---|
SUPABASE_URL | Yes | Your Supabase project URL |
SUPABASE_SERVICE_KEY | Yes | Service role key (bypasses RLS) |
Warning: Never commit your service key to version control. Use
.envfiles or secret managers.
Embedding Provider
Choose between OpenAI (cloud) or Ollama (local):
| Variable | Required | Description |
|---|---|---|
EMBEDDING_PROVIDER | No | openai (default) or ollama |
OPENAI_API_KEY | If OpenAI | Your OpenAI API key |
OLLAMA_BASE_URL | If Ollama | Ollama server URL |
OLLAMA_MODEL | If Ollama | Model name (default: nomic-embed-text) |
OpenAI Configuration:
- Model:
text-embedding-3-small - Dimensions: 1536
Ollama Configuration:
- Dimensions: 1024
Important: OpenAI and Ollama use different embedding dimensions. You cannot mix providers without re-embedding all documents.
Server Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | Server port |
LOG_LEVEL | No | info | debug, info, warn, error |
ALLOWED_ORIGINS | No | * | CORS allowed origins (comma-separated) |
Authentication
| Variable | Required | Description |
|---|---|---|
API_BEARER_TOKEN | Production | Auth token (min 32 characters) |
When set, all API endpoints require the Authorization: Bearer <token> header.
Unprotected endpoints (for health checks):
/health/health/live/health/ready
Web UI
| Variable | Required | Default | Description |
|---|---|---|---|
UI_PORT | No | 3001 | Web UI port for file conversion |
Feature Flags
| Variable | Required | Default | Description |
|---|---|---|---|
ENABLE_MEMORY | No | true | Enable/disable memory tools |
COMPACT_RESPONSES | No | true | Token-efficient response format |
Compact Responses
When COMPACT_RESPONSES=true (default), memory tools return token-efficient responses that reduce LLM context usage by 40-60%. This uses short keys like n, t, c instead of name, type, content.
Set COMPACT_RESPONSES=false for human-readable verbose responses during development or debugging.
See Response Format for the complete key mapping.
Rate Limits
Built-in rate limiting (not configurable):
| Endpoint | Limit |
|---|---|
API (/mcp, /api/*) | 100 requests/minute |
Upload (/api/upload) | 10 requests/minute |
Health (/health/*) | 300 requests/minute |
Example Configurations
Development (Local)
Production (Cloud Run)
Self-Hosted (Ollama)
Generating Secure Tokens
The setup script generates a secure token automatically:
Or generate manually:
Next Steps
- Quick Start - Connect Claude Desktop
- Security Hardening - Production security
- Cloud Run Deployment - Deploy to GCP