-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Complete guide to configuring Luna Chat.
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | production |
PORT |
API server port | 3005 |
LOG_LEVEL |
Logging level | info |
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection | postgresql://user:pass@host:5432/luna |
POSTGRES_HOST |
Database host | luna-postgres |
POSTGRES_PORT |
Database port | 5432 |
POSTGRES_DB |
Database name | luna |
POSTGRES_USER |
Database user | luna |
| Variable | Description | Example |
|---|---|---|
REDIS_URL |
Redis connection | redis://:password@host:6379 |
REDIS_HOST |
Redis host | luna-redis |
REDIS_PORT |
Redis port | 6379 |
| Variable | Description | Notes |
|---|---|---|
JWT_SECRET |
JWT signing key | Min 32 chars |
ENCRYPTION_KEY |
Token encryption | 32 chars |
CORS_ORIGINS |
Allowed origins | Comma-separated |
| Variable | Description | Required |
|---|---|---|
OLLAMA_HOST |
Ollama URL | For embeddings |
SEARXNG_URL |
Search engine | For web search |
MEMORYCORE_URL |
MemoryCore URL | Optional |
| Variable | Provider |
|---|---|
OPENAI_API_KEY |
OpenAI |
ANTHROPIC_API_KEY |
Anthropic |
GROQ_API_KEY |
Groq |
GOOGLE_API_KEY |
Google AI |
XAI_API_KEY |
xAI |
OPENROUTER_API_KEY |
OpenRouter |
ELEVENLABS_API_KEY |
ElevenLabs |
For production, use Docker secrets instead of environment variables:
mkdir -p secrets
# Database
echo "your-postgres-password" > secrets/postgres_password.txt
# Security
echo "your-jwt-secret-min-32-chars" > secrets/jwt_secret.txt
echo "your-redis-password" > secrets/redis_password.txt
echo "your-32-character-encryption-key" > secrets/encryption_key.txt
# API Keys (optional)
echo "sk-your-openai-key" > secrets/openai_api_key.txt
echo "sk-ant-your-anthropic-key" > secrets/anthropic_api_key.txt
echo "gsk_your-groq-key" > secrets/groq_api_key.txtsecrets:
postgres_password:
file: ./secrets/postgres_password.txt
jwt_secret:
file: ./secrets/jwt_secret.txt
services:
luna-api:
secrets:
- postgres_password
- jwt_secretConfigure which models to use for different tasks.
Web UI: Settings > Models
| Task | Purpose | Default |
|---|---|---|
main |
Primary chat | gpt-5.1 |
council |
Council deliberation | llama-3.3-70b |
researcher |
Research agent | claude-sonnet-4 |
coder |
Coding agent | claude-sonnet-4 |
writer |
Writing agent | gpt-5.1 |
analyst |
Analysis agent | llama-3.3-70b |
planner |
Planning agent | gpt-5.1 |
friends |
Friend discussions | llama3.2:3b |
embeddings |
Vector embeddings | bge-m3 |
{
"main": {
"provider": "openai",
"model": "gpt-5.1"
},
"council": {
"provider": "groq",
"model": "llama-3.3-70b-versatile"
},
"embeddings": {
"provider": "ollama",
"model": "bge-m3"
}
}| Provider | Value |
|---|---|
| OpenAI | openai |
| Anthropic | anthropic |
| Groq | groq |
google |
|
| xAI | xai |
| OpenRouter | openrouter |
| Ollama | ollama |
Configure autonomous mode behavior.
Web UI: Autonomous > Settings
| Setting | Description | Default |
|---|---|---|
enabled |
Enable autonomous mode | false |
autoStart |
Auto-start sessions | false |
sessionInterval |
Minutes between sessions | 60 |
maxDailySessions |
Max sessions per day | 10 |
idleTimeout |
Session timeout (minutes) | 30 |
PUT /api/autonomous/config
{
"enabled": true,
"autoStart": false,
"sessionInterval": 60,
"maxDailySessions": 10,
"idleTimeout": 30
}Per-user settings stored in database.
Web UI: Settings > Appearance (and other tabs)
| Category | Settings |
|---|---|
| Appearance | Theme, CRT effects |
| Models | Per-task model config |
| Persona | Custom prompts |
| Memory | Fact extraction settings |
GET /api/settings
PUT /api/settings
{
"theme": "dark",
"crtFlicker": false,
"models": { ... }
}Luna includes Radicale CalDAV server:
| Setting | Value |
|---|---|
| URL | http://luna-radicale:5232 |
| Username | Set in Radicale config |
| Password | Set in Radicale config |
- Create OAuth app in provider console
- Set redirect URI:
https://your-domain/api/integrations/oauth/callback - Add credentials to secrets
SMTP_HOST=mail.example.com
SMTP_PORT=587
SMTP_USER=luna@example.com
SMTP_PASS=password
IMAP_HOST=mail.example.com
IMAP_PORT=993- Create OAuth app
- Enable Gmail/Outlook API
- Add credentials to secrets
SEARXNG_URL=http://searxng:8080# docker-compose.yml addition
searxng:
image: searxng/searxng
ports:
- "8080:8080"Luna supports two TTS providers for Voice mode.
Best for emotion expression with full tag support ([laughs], [sighs], etc.)
echo "your-elevenlabs-key" > secrets/elevenlabs_api_key.txtEnvironment variables:
| Variable | Description | Default |
|---|---|---|
ELEVENLABS_ENABLED |
Enable ElevenLabs | true |
ELEVENLABS_VOICE_ID |
Voice ID | (Luna's voice) |
ELEVENLABS_MODEL |
Model version | eleven_v3 |
Cost-effective alternative with good quality.
Uses your existing OpenAI API key.
Configure in Settings > Models:
{
"tts": {
"provider": "elevenlabs",
"voice": "voice-id",
"model": "eleven_v3"
}
}Or for OpenAI:
{
"tts": {
"provider": "openai",
"voice": "nova",
"model": "tts-1-hd"
}
}| Voice | Style |
|---|---|
| alloy | Neutral |
| echo | Male |
| fable | Expressive |
| onyx | Deep male |
| nova | Female (recommended) |
| shimmer | Soft female |
Configure per-endpoint rate limits:
RATE_LIMIT_CHAT=60
RATE_LIMIT_TTS=10
RATE_LIMIT_AUTH=10| Endpoint | Limit/min |
|---|---|
| Chat | 60 |
| TTS | 10 |
| Auth | 10 |
| Abilities | 100 |
| Level | Description |
|---|---|
error |
Errors only |
warn |
Warnings and above |
info |
General info (default) |
debug |
Debug information |
LOG_LEVEL=infoWORKSPACE_DIR=/data/workspaceDOCUMENTS_DIR=/data/documents| Type | Path |
|---|---|
| Workspace | /app/data/workspace |
| Documents | /app/data/documents |
| Uploads | /app/data/uploads |
DB_POOL_MIN=2
DB_POOL_MAX=10# Run migrations
npm run migrate
# Create migration
npm run migrate:create migration_name# Environment
NODE_ENV=production
PORT=3005
LOG_LEVEL=info
# Database
DATABASE_URL=postgresql://luna:password@luna-postgres:5432/luna
# Redis
REDIS_URL=redis://:password@luna-redis:6379
# Ollama
OLLAMA_HOST=http://luna-ollama:11434
# Search (optional)
SEARXNG_URL=http://searxng:8080
# Rate limits
RATE_LIMIT_CHAT=60
RATE_LIMIT_TTS=10secrets/
├── postgres_password.txt
├── jwt_secret.txt
├── redis_password.txt
├── encryption_key.txt
├── openai_api_key.txt
├── anthropic_api_key.txt
├── elevenlabs_api_key.txt
├── spotify_client_id.txt
└── spotify_client_secret.txt
Luna uses direct Spotify OAuth for music control.
- Create a Spotify Developer App at https://developer.spotify.com/dashboard
- Add redirect URI:
https://your-domain/api/abilities/spotify/callback - Copy Client ID and Client Secret to secrets files
echo "your-spotify-client-id" > secrets/spotify_client_id.txt
echo "your-spotify-client-secret" > secrets/spotify_client_secret.txt| Variable | Description | Default |
|---|---|---|
SPOTIFY_ENABLED |
Enable Spotify integration | true |
Users connect their Spotify accounts via:
- Go to Settings > Integrations
- Click Connect Spotify
- Authorize in Spotify popup
- Luna stores encrypted OAuth tokens per user
- Spotify Premium account (for playback control)
- Active Spotify device