Production Deployment
Deploy SwiftClaw agents to production environments
Production Deployment
Learn how to deploy SwiftClaw agents to production with confidence.
Pre-Deployment Checklist
Before deploying to production:
- Test agent thoroughly in development
- Configure environment variables
- Set up monitoring and alerts
- Review security settings
- Configure scaling policies
- Set up backup and recovery
Deployment Methods
CLI Deployment
Deploy using the SwiftClaw CLI:
# Deploy to production
swiftclaw deploy my-agent --env production
# Deploy with specific configuration
swiftclaw deploy my-agent \
--env production \
--config production.json \
--region us-east-1Dashboard Deployment
- Navigate to your agent in the dashboard
- Click "Deploy to Production"
- Review configuration
- Confirm deployment
CI/CD Deployment
Integrate with your CI/CD pipeline:
# .github/workflows/deploy.yml
name: Deploy Agent
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to SwiftClaw
run: |
swiftclaw login --token ${{ secrets.SWIFTCLAW_TOKEN }}
swiftclaw deploy my-agent --env productionEnvironment Configuration
Production Settings
{
"environment": "production",
"model": {
"primary": "gpt-4",
"fallbacks": ["claude-3-sonnet"]
},
"scaling": {
"minInstances": 2,
"maxInstances": 10,
"targetCPU": 70
},
"monitoring": {
"enabled": true,
"logLevel": "info",
"metrics": true
}
}Health Checks
SwiftClaw automatically performs health checks:
- Startup Check: Verifies agent starts successfully
- Liveness Check: Ensures agent is running
- Readiness Check: Confirms agent can handle requests
Configure custom health checks:
@agent.health_check
async def custom_health():
# Check database connection
if not await db.ping():
return {"status": "unhealthy", "reason": "database"}
# Check external API
if not await api.ping():
return {"status": "unhealthy", "reason": "api"}
return {"status": "healthy"}Zero-Downtime Deployment
SwiftClaw uses rolling deployments:
- New version deployed alongside old version
- Health checks verify new version
- Traffic gradually shifted to new version
- Old version terminated after full migration
Automatic Rollback: If health checks fail, deployment automatically rolls back to previous version.
Post-Deployment Verification
Verify deployment success:
# Check deployment status
swiftclaw status my-agent
# View recent logs
swiftclaw logs my-agent --tail 100
# Test agent endpoint
curl https://api.swiftclaw.io/agents/my-agent/invoke \
-H "Authorization: Bearer $TOKEN" \
-d '{"message": "test"}'Next Steps
How is this guide ?
Last updated on