Prod Telegram bot: Custom event decor from NL in <60s. Gemini + Flux pipeline with refinement & background removal. Self-hosted on Ubuntu VPS (Apache, systemd, CI/CD). Free Cloudflare AI tier.
Event and wedding planners spent days iterating on decor concepts with designers. Manual design turnaround was slow, expensive, and couldn't scale. Planners needed instant visual proposals to close clients faster during sales calls.
Built an end-to-end Agentic AI Telegram bot (dos-bot.service, ~39MB RAM): users describe a theme → Gemini refines prompt → Pollinations Flux generates decor → rembg removes background → Pillow optimizes → delivered in chat. Deployed on a 1 vCPU, 458MB RAM DigitalOcean VPS via GitHub Actions CI/CD (push to git = live). SQLite handles session state. Infrastructure & Architecture: Hosting: Self-managed Ubuntu VPS running alkrie.info, arkhaai.in, demos.arkhaai.in, webmail, and mail server alongside 6 prototypes, retaining ~170MB headroom. Edge Security: Cloudflare provides DDoS protection, WAF, Full (Strict) SSL, and Workers AI (10k free daily neurons). Apache 2.4 reverse proxy handles client IPs (mod_remoteip), rate-limiting (50 req/s), security headers, and exploit rules. FastAPI Unified Demo Engine: Features anti-abuse backoff middleware (0s to 429), SQLite response/image caching, and Pillow Lanczos 1024px image optimization. Inference Pipeline: Primary via Cloudflare Workers AI (Llama 3.1 70B/8B, Llama 3.2 Vision) with automatic failover to Google Gemini Flash. Cost Defense: SHA-256 semantic caching (4ms, $0), hard daily kill-switch (50 calls/day), and universal image token reduction (>80% size, ~90% tokens). Telemetry monitored via Cloudflare GraphQL Analytics API.
Reduced design turnaround from days to <60 seconds. Enabled real-time sales enablement: planners generate proposals during client calls. Zero-downtime deployments via CI/CD. Token costs optimized via image preprocessing (Pillow) and model switching. Single lightweight process handles concurrent users on modest VPS. Public request cost: $0.00/month (Cloudflare Workers AI free tier).
Design turnaround: days → <60 seconds (99%+ reduction). Concurrent user handling: single process on modest VPS. Deployment frequency: on every commit (CI/CD). Zero production incidents since launch. Daily neuron usage: ~215 / 10,000 free (<2.2%).