Configuration
Backend environment variables
Section titled “Backend environment variables”All backend configuration is loaded from environment variables (or a .env file in the backend directory).
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | No | postgres://postgres:postgres@localhost:54322/postgres | PostgreSQL connection string |
SUPABASE_JWT_SECRET | Yes | — | JWT secret from Supabase (used to verify auth tokens) |
BASE_PATH | No | (empty) | URL prefix for all routes. Empty serves at the domain root; set it when the app lives under a path, as on the CiTIUS instance (/chatty) |
HOST | No | 0.0.0.0 | Address the server binds to |
PORT | No | 5000 | Port the server listens on |
OPENAI_KEY | No | — | OpenAI API key (enables GPT-4, GPT-4 Turbo, GPT-3.5 Turbo) |
MISTRAL_KEY | No | — | Mistral API key (enables Mistral 7B, Large, Small, Codestral) |
GEMINI_KEY | No | — | Google Gemini API key (enables Gemini 1.5 Flash/Pro, 1.0 Pro) |
HF_KEY | No | — | HuggingFace API key (enables Flan-T5 Small/Base) |
OLLAMA_HOST | No | http://localhost:11434 | Ollama server URL (auto-discovers available models) |
Frontend environment variables
Section titled “Frontend environment variables”These variables are set in the frontend .env file and must be prefixed with PUBLIC_ (SvelteKit convention).
| Variable | Required | Default | Description |
|---|---|---|---|
PUBLIC_BASE_PATH | No | (empty) | Base path for the SvelteKit app (must match backend BASE_PATH) |
PUBLIC_SUPABASE_URL | Yes | — | Supabase API URL (e.g., http://localhost:54321) |
PUBLIC_SUPABASE_ANON_KEY | Yes | — | Supabase anonymous key for client-side auth |
ORIGIN | No | — | The origin URL, required in production for CSRF protection |
API keys and model registration
Section titled “API keys and model registration”The backend uses a plugin registry that automatically registers models when the corresponding API key is provided. No key means that provider is skipped silently.
Models registered per provider
Section titled “Models registered per provider”| Provider | Env var | Models registered |
|---|---|---|
| OpenAI | OPENAI_KEY | GPT-4, GPT-4 Turbo, GPT-3.5 Turbo |
| Mistral | MISTRAL_KEY | Mistral 7B, Mistral Large, Mistral Small, Codestral |
| Gemini | GEMINI_KEY | Gemini 1.5 Flash, Gemini 1.5 Pro, Gemini 1.0 Pro |
| HuggingFace | HF_KEY | Flan-T5 Small, Flan-T5 Base |
| Ollama | OLLAMA_HOST | Auto-discovered from running Ollama instance |
Google OAuth setup
Section titled “Google OAuth setup”Chatty the Lab uses Supabase Auth with Google as the OAuth provider.
1. Create a Google Cloud OAuth client
Section titled “1. Create a Google Cloud OAuth client”- Go to the Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application
- Add authorized redirect URIs:
- Local development:
http://localhost:54321/auth/v1/callback - Production:
https://your-domain.com/auth/callback(add the base path if you set one)
- Local development:
- Note the Client ID and Client Secret
2. Configure Supabase Auth
Section titled “2. Configure Supabase Auth”For local development (supabase/config.toml):
[auth.external.google]enabled = trueclient_id = "your-google-client-id"secret = "your-google-client-secret"redirect_uri = "http://localhost:54321/auth/v1/callback"For production (via environment variables in docker-compose.prod.yml):
supabase-auth: environment: GOTRUE_EXTERNAL_GOOGLE_ENABLED: "true" GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} GOTRUE_EXTERNAL_GOOGLE_SECRET: ${GOOGLE_CLIENT_SECRET} GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI: https://tec.citius.usc.es/chatty/auth/callback3. Verify the configuration
Section titled “3. Verify the configuration”After configuring, restart Supabase (supabase stop && supabase start) and navigate to the login page. Clicking “Sign in with Google” should redirect to the Google consent screen.