.env file or passed directly to your deployment platform.
Quick Reference
| Variable | Required | Default | Description |
|---|---|---|---|
LLM_PROVIDER | Yes | - | AI provider to use |
LLM_API_KEY | Yes | - | API key for your provider |
LLM_MODEL | No | varies | Model name |
LLM_BASE_URL | No | - | Custom API endpoint |
POCKETBASE_ADMIN_EMAIL | Yes | - | Database admin email |
POCKETBASE_ADMIN_PASSWORD | Yes | - | Database admin password |
PORT | No | 3000 | Server port |
HOST | No | 0.0.0.0 | Server host |
AI Provider Settings
LLM_PROVIDER
The AI provider to use for the agent. Options:| Provider | Value | Description |
|---|---|---|
| Anthropic | anthropic | Claude models (recommended) |
| OpenAI | openai | GPT-4 and GPT-3.5 models |
gemini | Gemini models | |
| z.ai | zai | z.ai models |
| Ollama | ollama | Local models via Ollama |
LLM_API_KEY
Your API key from the provider. Get yours from:- Anthropic: console.anthropic.com
- OpenAI: platform.openai.com/api-keys
- Google: aistudio.google.com/apikey
- z.ai: z.ai
- Ollama: No key needed (local)
LLM_MODEL
The specific model to use. Defaults vary by provider:| Provider | Default | Recommended |
|---|---|---|
| Anthropic | claude-sonnet-4-20250514 | claude-sonnet-4-20250514 |
| OpenAI | gpt-4 | gpt-4 or gpt-4o |
| Gemini | gemini-pro | gemini-pro |
| z.ai | glm-4.6 | glm-4.6 |
| Ollama | llama2 | llama2 or codellama |
LLM_BASE_URL
Custom API endpoint for OpenAI-compatible providers. Only needed for:- Self-hosted models
- z.ai
- Other OpenAI-compatible APIs
Database Settings
POCKETBASE_ADMIN_EMAIL
Email address for the Pocketbase admin account. Used to initialize the database on first run.POCKETBASE_ADMIN_PASSWORD
Password for the Pocketbase admin account. Must be at least 8 characters.POCKETBASE_URL
Optional. URL of an external Pocketbase instance. By default, tinykit runs its own embedded Pocketbase.Server Settings
PORT
The port the server listens on.- Default:
3000(production),5173(development) - Railway and similar platforms set this automatically
HOST
The host address to bind to.- Default:
0.0.0.0(all interfaces) - Use
127.0.0.1to restrict to localhost only
Provider Examples
Anthropic (Claude)
OpenAI (GPT-4)
Google (Gemini)
z.ai
Ollama (Local)
Complete Example
Here’s a complete.env file for production:
Platform-Specific Notes
Railway
Railway automatically setsPORT. Configure other variables in the Railway dashboard under Variables.
Docker
Pass variables with-e flags or use --env-file:
VPS / PM2
Use a.env file in the project root, or configure in ecosystem.config.js:
Troubleshooting
AI responses return errors
AI responses return errors
Check these in order:
LLM_API_KEYis set and validLLM_PROVIDERmatches your key (e.g., Anthropic key withanthropicprovider)- Your account has credits/quota remaining
- Check logs for specific error messages
Pocketbase won't start
Pocketbase won't start
Verify:
POCKETBASE_ADMIN_EMAILis a valid email formatPOCKETBASE_ADMIN_PASSWORDis at least 8 characters- The
pocketbase/pb_datadirectory is writable
Can't connect to server
Can't connect to server
Check:
PORTisn’t already in use (lsof -i :3000)HOSTis set correctly for your environment- Firewall allows traffic on the port
Settings not taking effect
Settings not taking effect
Environment variables are read at startup. After changing
.env:- Development: Restart
npm run dev - PM2: Run
pm2 restart tinykit - Docker: Recreate the container
- systemd: Run
sudo systemctl restart tinykit