Alkiviades — Deployment Guide¶
Architecture¶
alkiviades.cc (Cloudflare Pages)
└── Next.js static export, CDN-cached
api.alkiviades.cc (Render)
└── Docker container, Python 3.12 + FastAPI + Uvicorn
Cloudflare DNS
├── CNAME @ → alkiviades.pages.dev (proxied)
├── CNAME www → alkiviades.pages.dev (proxied)
└── CNAME api → alkiviades.onrender.com (DNS only)
Backend: Render (Docker)¶
Initial Setup¶
- Go to dashboard.render.com → New → Web Service
- Connect GitHub:
Rumbleaxe/Alkiviades - Configure:
| Field | Value |
|---|---|
| Name | alkiviades |
| Region | Frankfurt |
| Branch | master |
| Runtime | Docker (auto-detected) |
- Add environment variables:
| Key | Value |
|---|---|
DEEPSEEK_API_KEY |
Your DeepSeek API key |
TAVILY_API_KEY |
Your Tavily API key |
ALKIVIADES_ADMIN_EMAIL |
Your admin email |
ALKIVIADES_ADMIN_PASSWORD |
Your admin password (≤72 chars) |
JWT_SECRET |
Stable random string (e.g. UUID) |
CORS_ORIGINS |
https://alkiviades.cc,https://www.alkiviades.cc |
COOKIE_SAMESITE |
none |
COOKIE_SECURE |
true |
COOKIE_DOMAIN |
.alkiviades.cc |
- Click Create Web Service
First build takes 5-8 minutes (Docker build + knowledge base construction). Test: https://alkiviades.onrender.com/health → {"status": "ok"}.
Custom Domain¶
- Settings → Custom Domain → Add
api.alkiviades.cc - Render verifies DNS and auto-provisions SSL (~5 min)
Auto-Deploy¶
Every push to master triggers a new build. Manual deploy available from Render dashboard.
Memory (Free Tier)¶
The free tier has 512 MB RAM. We optimize with: - float16 embedding dtype (halves vector memory) - 15K vocabulary cap - numpy mmap mode (lazy paging)
If OOM occurs, lower MAX_VOCAB_SIZE to 10000 or 8000.
Frontend: Cloudflare Pages¶
Initial Setup¶
- Go to Cloudflare Dashboard → Workers & Pages → Create → Pages tab
- Connect GitHub:
Rumbleaxe/Alkiviades - Configure:
| Field | Value |
|---|---|
| Framework preset | Next.js |
| Build command | npm run build |
| Build output directory | out |
| Root directory | frontend |
- Add environment variable:
| Key | Value |
|---|---|
NEXT_PUBLIC_API_URL |
https://api.alkiviades.cc |
- Click Save and Deploy
Custom Domain¶
- Cloudflare Pages → alkiviades → Custom Domains
- Add
alkiviades.ccandwww.alkiviades.cc - Auto-provisions SSL
DNS: Cloudflare Records¶
In Cloudflare Dashboard → alkiviades.cc → DNS → Records:
| Type | Name | Target | Proxy |
|---|---|---|---|
| CNAME | @ |
alkiviades.pages.dev |
Orange (Proxied) |
| CNAME | www |
alkiviades.pages.dev |
Orange (Proxied) |
| CNAME | api |
alkiviades.onrender.com |
Gray (DNS only) |
Verification¶
After deployment, verify in order:
https://api.alkiviades.cc/health→{"status":"ok"}https://api.alkiviades.cc/auth/login→ POST returns JWThttps://alkiviades.cc→ Landing page loads- Login from frontend → authenticates against API
- Chat works (send a prompt, receive SSE streaming response)
- Admin:
/health/debugendpoint accessible to admin user - Admin: AdminPanel appears in sidebar for admin users
- Guest: Click "Try Free" → login → 5 queries available
Updating Secrets¶
After changing env vars on Render, trigger a manual deploy (or push to master) for changes to take effect.
For JWT secret changes: users will need to log in again (old tokens invalidated).
Monitoring¶
- Render dashboard: CPU, memory, response time metrics
- Admin logs:
GET /api/admin/logs(authenticated admin) - Health debug:
GET /health/debug(authenticated admin) - Frontend: Browser DevTools → Network tab for SSE stream inspection