.env file.
Core Configuration
Database
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
DB_POOL_SIZE | No | Database connection pool size (default: 20) |
DB_MAX_OVERFLOW | No | Max overflow connections (default: 10) |
Redis
| Variable | Required | Description |
|---|---|---|
REDIS_URL | Yes | Redis/Valkey connection string |
Authentication
| Variable | Required | Description |
|---|---|---|
JWT_SECRET | Yes | Secret key for JWT signing (min 32 chars) |
SESSION_MAX_AGE_SECONDS | No | Session duration in seconds (default: 604800 / 7 days) |
COOKIE_DOMAIN | No | Cookie domain for cross-subdomain auth |
Deployment Mode
| Variable | Required | Description |
|---|---|---|
DEPLOYMENT_MODE | No | enterprise (default) or saas |
ADMIN_API_SECRET | Yes | Secret for Admin API authentication (min 32 chars) |
- Organization creation only via Admin API
- No public signup flows
- Self-service organization creation
- Billing features enabled
Example Deployment Configurations
Enterprise / On-Prem:Bootstrapping an Enterprise Install
After deploying Piper in enterprise mode, create the first organization and admin user:Application Settings
| Variable | Required | Description |
|---|---|---|
ENVIRONMENT | No | Environment name (default: production) |
DEBUG | No | Enable debug mode (default: false) |
LOG_LEVEL | No | Logging level (default: INFO) |
FRONTEND_URL | No | Frontend URL for email links |
API_BASE_URL | No | API base URL for OAuth redirects |
CORS
| Variable | Required | Description |
|---|---|---|
BACKEND_CORS_ORIGINS | No | Allowed CORS origins (comma-separated) |
LLM Configuration
Piper uses LiteLLM for LLM provider integration.System Default Provider
The system default provider is used when organizations haven’t configured their own LLM credentials.| Variable | Required | Description |
|---|---|---|
PIPER_AGENT_PROVIDER | Yes | Provider name: piper (managed), groq, openai, anthropic, google, fireworks, together, or cerebras |
PIPER_AGENT_API_KEY | Yes | API key for the default provider (for piper, use a Fireworks AI key) |
SECRET_ENCRYPTION_KEY | Yes | Fernet key for encrypting stored credentials (generate with python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())") |
Per-Organization LLM Providers
Organizations can configure their own LLM providers through the dashboard under Settings > LLM Providers. This allows:- Bring Your Own Keys: Organizations use their own API keys
- Per-Agent Model Selection: Each agent can use a specific provider and model
- Automatic Fallback: If no org config exists, the system default is used
- Groq - Fast inference with Llama models
- OpenAI - GPT-4, GPT-5 models
- Anthropic - Claude models
- Google - Gemini models
Embeddings
| Variable | Required | Description |
|---|---|---|
PIPER_EMBEDDING_MODEL | No | Embedding model (default: text-embedding-3-small) |
PIPER_EMBEDDING_API_KEY | Yes | API key for embedding provider |
Scenario Evaluation
| Variable | Required | Description |
|---|---|---|
PIPER_EVAL_MODEL | No | LLM judge model (default: anthropic/claude-opus-4-5-20251101) |
PIPER_EVAL_API_KEY | Yes | API key for eval provider |
Email (SMTP)
| Variable | Required | Description |
|---|---|---|
SMTP_HOST | Yes | SMTP server host |
SMTP_PORT | No | SMTP server port (default: 587) |
SMTP_USER | No | SMTP username |
SMTP_PASSWORD | No | SMTP password |
SMTP_DEFAULT_FROM_EMAIL | No | Sender email address |
SMTP_DEFAULT_FROM_NAME | No | Sender display name (default: Piper) |
SMTP_TLS | No | Use TLS (default: true) |
SMTP_SSL | No | Use SSL (default: false) |
Slack Integration
| Variable | Required | Description |
|---|---|---|
SLACK_CLIENT_ID | For OAuth | Slack app client ID |
SLACK_CLIENT_SECRET | For OAuth | Slack app client secret |
SLACK_SIGNING_SECRET | Yes | Slack signing secret for webhook verification |
OAUTH_STATE_SECRET | Recommended | Secret used for OAuth state signing (fallback: SLACK_CLIENT_SECRET) |
SLACK_OAUTH_SCOPES | No | Comma-separated OAuth scopes (default: chat:write,app_mentions:read,im:history,channels:history,groups:history) |
Observability
Pydantic Logfire
| Variable | Required | Description |
|---|---|---|
LOGFIRE_TOKEN | No | Pydantic Logfire write token for agent tracing (LLM calls, tool execution, token usage) |
LangSmith
| Variable | Required | Description |
|---|---|---|
LANGSMITH_API_KEY | No | LangSmith API key for tracing |
LANGSMITH_PROJECT | No | LangSmith project name |
LANGSMITH_TRACING | No | Enable LangSmith tracing (default: false) |