Service mesh for monce-optimization.
┌─────────────────────────────────────────────────────────────────────┐
│ Client (Python / Web) │
└───────────────────────────────┬─────────────────────────────────────┘
│
pip install monce-optimization
│
┌───────────────────────────────▼─────────────────────────────────────┐
│ monce-optimization (local) │
│ │
│ ┌──────────┐ ┌─────────────────┐ ┌──────────────────┐ │
│ │ Encoders │───►│ Uniformizer │───►│ DIMACS serialize │ │
│ │ (7 types)│ │ (BCP + balance) │ │ │ │
│ └──────────┘ └─────────────────┘ └────────┬───────────┘ │
│ ~10ms local │ │
└───────────────────────────────────────────────────┼───────────────────┘
│ HTTPS POST
▼
┌───────────────────────────────────────────────────────────────────────┐
│ npdollars.aws.monce.ai │
│ │
│ ┌─────────────┐ ┌───────────────┐ ┌────────────────┐ │
│ │ DIMACS parse │───►│ SAT solver │───►│ Assignment out │ │
│ │ │ │ (budget EC2) │ │ │ │
│ └─────────────┘ └───────────────┘ └────────────────┘ │
│ │
│ Budget: 1-60s EC2 compute per call │
│ Responds within budget + 3s │
│ .ncnf taboo transfer between calls │
└───────────────────────────────────────────────────────────────────────┘
│
▼ SAT assignment
┌───────────────────────────────────────────────────────────────────────┐
│ monce-optimization (local) │
│ │
│ ┌────────────────────┐ ┌──────────────────────┐ │
│ │ Variable map decode │───►│ Domain-level answer │ │
│ │ (strip aux vars) │ │ (grid, coloring, ..) │ │
│ └────────────────────┘ └──────────────────────┘ │
└───────────────────────────────────────────────────────────────────────┘
| Service | URL | Role |
|---|---|---|
| monce-optimization | monce-optimization.aws.monce.ai | Playground + API (this site) |
| npdollars | npdollars.aws.monce.ai | SAT solver backend |
| uniform-3-sat | uniform-3-sat.aws.monce.ai | Research site + reduction API |
| polyauma | auma.aws.monce.ai | Continuous optimization (sibling) |
# Terraform — EC2 t3.small, nginx, gunicorn, certbot
cd terraform/
terraform init
terraform apply -var="vpc_id=..." -var="subnet_id=..." -var="key_name=..." -var="hosted_zone_id=..."
# Deploy code
rsync -avz --exclude='.git' . ubuntu@IP:/opt/mopt/app/
ssh ubuntu@IP "cd /opt/mopt && venv/bin/pip install fastapi uvicorn gunicorn && sudo systemctl restart mopt"
# HTTPS
ssh ubuntu@IP "sudo certbot --nginx -d monce-optimization.aws.monce.ai --non-interactive --agree-tos -m admin@monce.ai"
The compute is in npdollars, not here. This server only does:
A single t3.small handles hundreds of concurrent requests. The bottleneck is always npdollars budget.