Skip to main content

Deploying to Production

This tutorial covers deploying Waxell agents to production with proper infrastructure.

Production Architecture

┌─────────────────────────────────────────────────────────┐
│ Load Balancer │
└─────────────────────────┬───────────────────────────────┘

┌─────────────────────────▼───────────────────────────────┐
│ API Gateway │
│ (waxell-controlplane) │
└─────────────────────────┬───────────────────────────────┘

┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Worker │ │ Worker │ │ Worker │
│ (Celery) │ │ (Celery) │ │ (Celery) │
└────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
└───────────────┼───────────────┘

┌──────────────────────────────┐
│ Redis + PostgreSQL │
└──────────────────────────────┘

Infrastructure Requirements

  • Redis: Task queue and rate limiting
  • PostgreSQL: Persistent storage
  • Celery Workers: Async task execution
  • Django: Control plane and API

Configuration

Install the infra package:

pip install waxell-infra

Configure Django settings:

# settings.py
INSTALLED_APPS = [
...
'waxell_infra',
]

# Redis connection
REDIS_URL = "redis://localhost:6379/0"

# Celery configuration
CELERY_BROKER_URL = REDIS_URL
CELERY_RESULT_BACKEND = REDIS_URL

Deploying an Agent

# Register the agent
wax agent register ./my_agent.py

# Deploy to production
wax agent deploy my-agent --env production

# Monitor execution
wax agent logs my-agent --follow

Scaling

Scale workers based on load:

# Kubernetes
kubectl scale deployment waxell-workers --replicas=10

# Docker Compose
docker-compose up -d --scale worker=10

Monitoring

Monitor agents via the dashboard:

  • Execution metrics: Success rate, latency, throughput
  • Token usage: LLM token consumption
  • Error tracking: Failed executions and causes
  • Audit logs: All agent actions

Next Steps