This guide covers different options for deploying the DeepSeek Wrapper application in various environments.
For local development, you can run the application with:
uvicorn src.deepseek_wrapper.web:app --reloadThis will start the application with auto-reload enabled for development purposes.
For a more production-ready local deployment:
uvicorn src.deepseek_wrapper.web:app --host 0.0.0.0 --port 8000 --workers 4This uses the Uvicorn ASGI server with multiple worker processes for better performance.
- Ensure Docker is installed on your system
- Build the image:
docker build -t deepseek-wrapper .
docker run -d -p 8000:8000 --env-file .env --name deepseek-wrapper deepseek-wrapperThis will:
- Run the container in detached mode (
-d) - Map port 8000 from the container to your host
- Use your local
.envfile for environment variables - Name the container "deepseek-wrapper"
For easier management, you can use Docker Compose:
# docker-compose.yml
version: '3'
services:
deepseek-wrapper:
build: .
ports:
- "8000:8000"
environment:
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
volumes:
- ./uploads:/app/uploads
restart: unless-stoppedRun with:
docker-compose up -d- Install the Heroku CLI and login
- Initialize a Git repository if not already done:
git init git add . git commit -m "Initial commit"
- Create a Heroku app and deploy:
heroku create deepseek-wrapper heroku config:set DEEPSEEK_API_KEY=your_api_key_here git push heroku main
- Install the EB CLI and initialize your project:
pip install awsebcli eb init
- Create and deploy to an environment:
eb create deepseek-wrapper-env
- Set environment variables:
eb setenv DEEPSEEK_API_KEY=your_api_key_here
- Install the Azure CLI and login:
az login
- Create an App Service and deploy:
az webapp up --name deepseek-wrapper --resource-group your-resource-group --runtime "PYTHON:3.9" - Set environment variables:
az webapp config appsettings set --name deepseek-wrapper --resource-group your-resource-group --settings DEEPSEEK_API_KEY=your_api_key_here
The following environment variables can be configured for deployment:
| Variable | Description | Default |
|---|---|---|
DEEPSEEK_API_KEY |
Your DeepSeek API key (required) | None |
DEEPSEEK_BASE_URL |
API base URL | https://api.deepseek.com/v1 |
DEEPSEEK_DEFAULT_MODEL |
Default model name | deepseek-chat |
SESSION_SECRET_KEY |
Secret for session middleware | supersecret |
SEARCH_API_KEY |
API key for Web Search tool | |
OPENWEATHERMAP_API_KEY |
API key for Weather tool | |
EMAIL_SMTP_SERVER |
SMTP server for Email tool | smtp.gmail.com |
EMAIL_SMTP_PORT |
SMTP port | 587 |
EMAIL_USERNAME |
SMTP username | |
EMAIL_PASSWORD |
SMTP password | |
EMAIL_TEMPLATE_DIR |
Email templates directory | ./email_templates |
WOLFRAM_ALPHA_APP_ID |
App ID for Wolfram Alpha tool |
For high-traffic deployments, consider:
- Using a reverse proxy like Nginx in front of the application
- Implementing Redis for session storage
- Deploying with multiple workers/instances
- Setting up a load balancer for horizontal scaling
- Always use HTTPS in production
- Set up proper authentication if exposing to public internet
- Keep your API key secure and use environment variables
- Regularly update dependencies
- Consider using a WAF (Web Application Firewall)
For production deployments, set up monitoring:
- Application logs
- Server metrics (CPU, memory, disk usage)
- Request/response times
- Error rates
Popular monitoring tools include Prometheus, Grafana, or cloud provider monitoring services.