ZeebeeAI Deployment Guide
Table of Contents
Overview
This document provides guidelines for deploying the ZeebeeAI Chat SDK Platform to production environments. The platform is built with Flask (Python) and integrates with multiple LLM providers.
System Requirements
- Python 3.11+
- PostgreSQL database
- Redis (optional, for caching and queue management)
- Node.js (optional, for front-end development)
Environment Variables
The following environment variables must be configured:
Required
DATABASE_URL
: PostgreSQL connection stringSESSION_SECRET
: Secret key for session managementOPENAI_API_KEY
: OpenAI API key for accessing OpenAI models
Optional (Provider-specific)
ANTHROPIC_API_KEY
: Anthropic API key for Claude modelsGOOGLE_API_KEY
: Google API key for Gemini modelsMISTRAL_API_KEY
: Mistral API key for Mistral models
Optional (Analytics)
LANGFUSE_PUBLIC_KEY
: Langfuse public key for observabilityLANGFUSE_SECRET_KEY
: Langfuse secret key for observabilityLANGFUSE_HOST
: Langfuse host (defaults to Langfuse Cloud)
Database Setup
-
Create a PostgreSQL database:
createdb zeebeeai
-
Set the
DATABASE_URL
environment variable:export DATABASE_URL="postgresql://username:password@localhost:5432/zeebeeai"
-
Run database migrations:
python run_migrations.py
-
Seed subscription plans (if needed):
python seed_subscription_plans.py
Deployment Options
Docker Deployment
-
Build the Docker image:
docker build -t zeebeeai:latest .
-
Run the container:
docker run -p 5000:5000 --env-file .env zeebeeai:latest
Traditional Deployment
-
Clone the repository:
git clone https://github.com/yourusername/zeebeeai.git cd zeebeeai
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the server:
gunicorn --bind 0.0.0.0:5000 --workers 4 main:app
Scaling Considerations
Horizontal Scaling
The application can be horizontally scaled by running multiple instances behind a load balancer. Ensure that:
- All instances connect to the same database
- Session management is configured for distributed deployment
- Caching strategy is appropriate for multiple instances
Vertical Scaling
For increased performance on a single instance:
- Increase the number of Gunicorn workers (2-4× the number of CPU cores)
- Tune the PostgreSQL database for performance
- Consider using PyPy or similar for improved Python performance
Monitoring & Maintenance
Health Checks
The application exposes a health check endpoint at /api/health
which should return a 200 status code and basic information about the service.
Logging
Logs are output to stdout/stderr and can be captured by container orchestration platforms or log aggregation tools.
Backup Strategy
- Regular database backups should be scheduled
- User-generated content and conversation history should be included in backups
- API keys and secrets should be managed separately
Security Considerations
- Always use HTTPS in production
- Implement rate limiting for API endpoints
- Regularly audit user permissions and API key usage
- Monitor for unusual activity patterns
Update Process
- Always back up the database before updating
- Run migrations after code updates
- Use rolling updates to minimize downtime
- Have a rollback plan for failed deployments
Support & Troubleshooting
For issues, refer to the logs first. Common issues include:
- Database connection errors (check
DATABASE_URL
and network connectivity) - API key validation failures (verify provider API keys)
- Memory issues (monitor resource usage)
Contact support@zeebeeai.com for additional assistance.
Note: Always follow security best practices when handling API keys and sensitive configuration.