我們如何在 Cloudflare Workers 上構建 18 款自託管 AI 聊天機械人店面
How We Built an 18-Bot Self-Hosted AI Chatbot Storefront on Cloudflare Workers (4.7KB Widget, 648 Adversarial Tests, $0 Hosting)
ShelfBot 團隊在 Cloudflare Workers 上構建了包含 18 款專用 AI 聊天機械人套件的自託管店面,套件以 ZIP 檔提供,收費為一次性 $19,5 個客戶網站則為 $39。每款機械人均通過 648 項自動化對抗性防護測試,並採用 4.7KB 嵌入式 Widget,託管成本為 $0。用戶無須註冊即可測試 18 款行業機械人,購買後可下載套件。
Most small Shopify stores, local clinics, and independent agencies abandon AI chatbot SaaS platforms within 30 days for three predictable reasons:
- Unpredictable message-credit overages ($49–$199/mo).
- Heavy drag-and-drop workflow builders that take hours to configure.
- Hallucinated store policies or missing legal/safety guardrails.
We decided to build a different model: ShelfBot (https://tryshelfbot.com) — a storefront of 18 single-purpose, ready-to-deploy niche AI chatbot kits delivered as self-hosted Cloudflare Worker ZIP archives (BYOK) for a flat $19 one-time fee ($39 for 5 client sites).
Architecture Highlights ($0 Infra Overhead)
-
4.7KB Async Embed Widget (
widget.js): Zero framework dependencies, loads strictly afterwindow.loadso it never hurts Lighthouse scores. - Grounded-Only FAQ Matching + Workers AI: Every bot ships with industry-specific verified FAQs and a strict safe fallback instead of guessing policies.
-
Built-In EU AI Act Art. 50 Disclosure: Every widget renders
"You're chatting with an AI"directly inside the DOM. -
Hard Flood & Cost-Bomb Defense: Daily-salted SHA-256 IP rate limiting + global sandbox cap verified against a 1,000-request flood test returning
HTTP 429with zero runaway spend. - 648 Automated Adversarial Guardrail Tests: Every SKU is tested against prompt injections, PCI/IBAN/SSN/EIN leaks, medical/legal/tax advice traps, and life-safety interrupts (e.g., HVAC gas-leak 911/999 warnings, restaurant allergen cross-contact notices).
-
Pure-JS ZIP Packaging Inside Cloudflare Workers: After checkout, buyers immediately download a standard
PK\x03\x04ZIP bundle containingworker.mjs,wrangler.toml,faq-knowledge.json,embed-snippet.html, and a 10-minuteREADME.md.
Try Any of the 18 Live Sandboxes (No Sign-Up)
You can test all 18 industry bots live on the homepage, preview your own brand color and 1-line <script> snippet, or vote for the next industry bot on our public board:
👉 https://tryshelfbot.com
(Disclosure: I'm part of the team building ShelfBot & StarReply at Chunfeng Digital Studio — happy to share code details or answer Cloudflare Workers architecture questions in the comments!)
來源:DEV Community · dev.to