Skip to main content
Configure tinykit using environment variables. All settings can be configured via a .env file or passed directly to your deployment platform.

Quick Reference

VariableRequiredDefaultDescription
LLM_PROVIDERYes-AI provider to use
LLM_API_KEYYes-API key for your provider
LLM_MODELNovariesModel name
LLM_BASE_URLNo-Custom API endpoint
POCKETBASE_ADMIN_EMAILYes-Database admin email
POCKETBASE_ADMIN_PASSWORDYes-Database admin password
PORTNo3000Server port
HOSTNo0.0.0.0Server host

AI Provider Settings

LLM_PROVIDER

The AI provider to use for the agent. Options:
ProviderValueDescription
AnthropicanthropicClaude models (recommended)
OpenAIopenaiGPT-4 and GPT-3.5 models
GooglegeminiGemini models
z.aizaiz.ai models
OllamaollamaLocal models via Ollama
LLM_PROVIDER=anthropic

LLM_API_KEY

Your API key from the provider. Get yours from:
LLM_API_KEY=sk-ant-api03-...
Never commit API keys to version control. Use environment variables or secrets management.

LLM_MODEL

The specific model to use. Defaults vary by provider:
ProviderDefaultRecommended
Anthropicclaude-sonnet-4-20250514claude-sonnet-4-20250514
OpenAIgpt-4gpt-4 or gpt-4o
Geminigemini-progemini-pro
z.aiglm-4.6glm-4.6
Ollamallama2llama2 or codellama
LLM_MODEL=claude-sonnet-4-20250514

LLM_BASE_URL

Custom API endpoint for OpenAI-compatible providers. Only needed for:
  • Self-hosted models
  • z.ai
  • Other OpenAI-compatible APIs
# For z.ai
LLM_BASE_URL=https://api.z.ai/api/paas/v4

# For local OpenAI-compatible server
LLM_BASE_URL=http://localhost:8080/v1

Database Settings

POCKETBASE_ADMIN_EMAIL

Email address for the Pocketbase admin account. Used to initialize the database on first run.
POCKETBASE_ADMIN_EMAIL=admin@yourdomain.com

POCKETBASE_ADMIN_PASSWORD

Password for the Pocketbase admin account. Must be at least 8 characters.
POCKETBASE_ADMIN_PASSWORD=your-secure-password
Use a strong, unique password. This account has full access to your database.

POCKETBASE_URL

Optional. URL of an external Pocketbase instance. By default, tinykit runs its own embedded Pocketbase.
# Only set if using external Pocketbase
POCKETBASE_URL=http://127.0.0.1:8091

Server Settings

PORT

The port the server listens on.
PORT=3000
  • Default: 3000 (production), 5173 (development)
  • Railway and similar platforms set this automatically

HOST

The host address to bind to.
HOST=0.0.0.0
  • Default: 0.0.0.0 (all interfaces)
  • Use 127.0.0.1 to restrict to localhost only

Provider Examples

Anthropic (Claude)

LLM_PROVIDER=anthropic
LLM_API_KEY=sk-ant-api03-...
LLM_MODEL=claude-sonnet-4-20250514

OpenAI (GPT-4)

LLM_PROVIDER=openai
LLM_API_KEY=sk-...
LLM_MODEL=gpt-4

Google (Gemini)

LLM_PROVIDER=gemini
LLM_API_KEY=your-gemini-api-key
LLM_MODEL=gemini-pro

z.ai

LLM_PROVIDER=zai
LLM_API_KEY=your-zai-key
LLM_MODEL=glm-4.6
LLM_BASE_URL=https://api.z.ai/api/paas/v4

Ollama (Local)

LLM_PROVIDER=ollama
LLM_MODEL=llama2
# No API key needed
Ollama is great for development and testing without API costs. Install from ollama.ai and run ollama pull llama2.

Complete Example

Here’s a complete .env file for production:
# AI Configuration
LLM_PROVIDER=anthropic
LLM_API_KEY=sk-ant-api03-...
LLM_MODEL=claude-sonnet-4-20250514

# Database
POCKETBASE_ADMIN_EMAIL=admin@yourdomain.com
POCKETBASE_ADMIN_PASSWORD=your-secure-password-here

# Server (usually set by platform)
PORT=3000
HOST=0.0.0.0

Platform-Specific Notes

Railway

Railway automatically sets PORT. Configure other variables in the Railway dashboard under Variables.

Docker

Pass variables with -e flags or use --env-file:
docker run -d \
  -e LLM_PROVIDER=anthropic \
  -e LLM_API_KEY=sk-ant-... \
  -e POCKETBASE_ADMIN_EMAIL=admin@example.com \
  -e POCKETBASE_ADMIN_PASSWORD=password \
  tinykit

VPS / PM2

Use a .env file in the project root, or configure in ecosystem.config.js:
module.exports = {
  apps: [{
    name: 'tinykit',
    script: './start.sh',
    env: {
      LLM_PROVIDER: 'anthropic',
      LLM_API_KEY: 'sk-ant-...',
      // ...
    }
  }]
}

Troubleshooting

Check these in order:
  1. LLM_API_KEY is set and valid
  2. LLM_PROVIDER matches your key (e.g., Anthropic key with anthropic provider)
  3. Your account has credits/quota remaining
  4. Check logs for specific error messages
Verify:
  1. POCKETBASE_ADMIN_EMAIL is a valid email format
  2. POCKETBASE_ADMIN_PASSWORD is at least 8 characters
  3. The pocketbase/pb_data directory is writable
Check:
  1. PORT isn’t already in use (lsof -i :3000)
  2. HOST is set correctly for your environment
  3. Firewall allows traffic on the port
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