🔐 Configuration
All configuration is done through environment variables. Copy .env.example to .env and fill in your values.
Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✅ | PostgreSQL connection string |
CLERK_SECRET_KEY | ✅ | Clerk backend secret key |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | ✅ | Clerk frontend publishable key |
GROQ_API_KEY | ⭐ | Groq API key — free, ultra-fast inference (recommended) |
MISTRAL_API_KEY | ⚡ | Mistral AI API key (fallback if Groq not set) |
OLLAMA_URL | ⚡ | Ollama endpoint (default: http://localhost:11434) |
NEXT_PUBLIC_API_URL | ⚡ | Backend URL for the frontend (default: http://localhost:8000) |
You only need one LLM provider key. Groq is recommended — it’s completely free with generous rate limits.
LLM Provider Setup
1️⃣ Groq (Recommended — Free)
Groq provides free, ultra-fast LLM inference with no credit card required.
- Sign up at console.groq.com
- Go to API Keys → Create API Key
- Add to your
.env:
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxAvailable models:
| Model | Tier | Speed |
|---|---|---|
llama-3.1-8b-instant | Light | ~800 tok/s |
llama-3.3-70b-versatile | Heavy | ~250 tok/s |
gemma2-9b-it | Light (alt) | ~500 tok/s |
2️⃣ Mistral AI (Paid fallback)
If GROQ_API_KEY is not set, IntentScope falls back to Mistral.
- Sign up at console.mistral.ai
- Go to API Keys → Create new key
- Add to your
.env:
MISTRAL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx3️⃣ Ollama (Local — no key needed)
If neither Groq nor Mistral keys are set, IntentScope falls back to a local Ollama instance.
# Start Ollama via Docker
docker compose up -d
# Pull the model
docker exec intentscope-ollama ollama pull llama3.2OLLAMA_URL=http://localhost:11434Ollama cannot run on cloud platforms like Render. Use it for local development only.
Clerk Auth Setup
IntentScope uses Clerk for user authentication.
- Create a project at dashboard.clerk.com
- Go to API Keys
- Copy both keys to your
.env:
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...Also add to frontend/.env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_API_URL=http://localhost:8000Database
IntentScope uses PostgreSQL via SQLAlchemy async + Alembic migrations.
Local (Docker):
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5434/intentscopeProduction (Neon):
DATABASE_URL=postgresql+asyncpg://user:password@host/dbname?sslmode=requireAfter setting the URL, run migrations:
cd backend-python
alembic upgrade head