← all posts
how-to · fait maison

Add AI live chat to your site in 5 minutes

Deploy Krispy — open-source AI live chat with Telegram handoff — to Cloudflare Workers in minutes. Free to self-host, no API key or credit card needed.

Shai Snir
live chatquickstartcloudflareopen-sourceself-host
Buttr the croissant mascot

🥐 Buttr: took me 2 min. and i'm a croissant. you'll be fine.

Clone one repo, run two commands, and your site has an AI chat widget backed by Cloudflare Workers — no API key, no credit card, no sales call. Krispy handles visitor questions automatically and pings you on Telegram the moment you need to step in. The whole deploy takes under five minutes.

What does Krispy do?

Krispy is an open-source AI live chat widget that runs entirely inside Cloudflare Workers using their built-in AI model — nothing leaves your deployment unless you configure it to. When a visitor asks something the bot can't handle, or when you spot a hot lead and want to jump in personally, Krispy sends you a Telegram message with the full conversation thread and a "Take over" button. You reply from Telegram; the visitor sees it live in the widget on your site. Bot handles the queue, human closes the conversation.

The widget drops into any page as a single script tag — Next.js, plain HTML, React, Webflow, whatever. No npm package required on the frontend.

What do you need before starting?

Four things:

  • A Cloudflare account — the free tier is enough
  • Node.js 18+ and npm
  • Wrangler CLI: npm install -g wrangler
  • A Telegram account for human handoff (optional, but worth the two minutes)

No OpenAI key. No Pinecone. No AWS credentials. Cloudflare is the only dependency.

Step 1 — Clone and install

git clone https://github.com/krispyai/krispy
cd krispy
npm install

Step 2 — Configure

cp wrangler.example.toml wrangler.toml

Open wrangler.toml. The only required change for a first deploy is your Cloudflare account ID. Wrangler can look it up:

wrangler whoami

Paste the ID into account_id. Everything else — AI model, system prompt, widget accent color — ships with a working default you can change after the first deploy.

Step 3 — Deploy

wrangler deploy

Wrangler bundles your Worker, uploads it, and returns a *.workers.dev URL. That URL is your Krispy backend. The whole step takes about 20 seconds on a normal connection.

For a deeper look at what's running — the KV namespace, the AI binding, the routing — the self-hosting walkthrough covers the full Cloudflare Workers setup.

Step 4 — Add the widget

Drop this before </body> on any page you want the chat to appear:

<script
  src="https://your-worker.workers.dev/widget.js"
  data-krispy-url="https://your-worker.workers.dev"
  defer
></script>

Replace your-worker with your actual subdomain. That is the entire frontend install. The widget initializes itself, connects to your Worker, and starts answering questions using @cf/meta/llama-3-8b-instruct by default. You can swap the model in wrangler.toml to anything in the Workers AI catalog.

Reload your page. The 🥐 button appears in the corner. Say hi.

How does the Telegram handoff work?

When a visitor escalates — or when you notice a promising lead mid-conversation — Krispy sends you a Telegram message with the full thread and a "Take over" button. Tap it, type your reply in Telegram, and the visitor sees it live in the widget on your site. The bot steps aside while you're active and resumes when you're done.

Setup takes one bot token and one chat ID. The Telegram handoff guide walks through the exact steps.

Buttr the croissant mascot

🥐 Buttr: the handoff is the whole bit. a croissant handles questions; a human closes deals. that's the loop.

How do I customize the bot's persona?

The system prompt lives in src/prompt.ts — plain text you edit directly. No GUI, no drag-and-drop blocks. Common things people set in the first five minutes:

  • What the product does and who it's for
  • Topics to always route to a human ("anything about billing, hand off immediately")
  • Tone (formal, casual, terse)

Deploy again with wrangler deploy. Done.

Buttr thinking about the cost math

"wait — zero dollars? let me check that again."

What does Krispy cost compared to paid live chat tools?

Self-hosted Krispy costs $0. Cloudflare's free plan includes 100,000 Worker requests per day and Workers AI inference at no charge up to the included free limits (source: Cloudflare pricing page). For most small to mid-size sites, you'll stay inside the free tier indefinitely.

Paid alternatives, for comparison: Intercom's Starter plan begins at $74/month per seat and climbs fast once you add the AI layer (source: Intercom pricing page). Crisp's paid plans run roughly $25–95/month. The typical spend for teams on these tools: $100–400/month.

If you grow past Cloudflare's free limits, the Workers paid plan is $5/month flat — still a fraction of the alternative (source: Cloudflare Workers pricing). Cloudflare stops requests before it bills you past a cap unless you explicitly opt into the paid plan.

FAQ

How long does the initial deploy actually take?

If Node and Wrangler are already installed, the deploy finishes in under two minutes. The slowest part is npm install. The wrangler deploy itself runs in 15–30 seconds. The "five minutes" in the title accounts for reading the config, pasting in your account ID, and a first reload to confirm the widget appears on the page.

Do I need an OpenAI API key to run Krispy?

No. Krispy uses Cloudflare Workers AI, which is built into the Cloudflare runtime. The model runs on Cloudflare's own infrastructure as part of your Worker — there's no external API to configure or pay for separately. The default model is @cf/meta/llama-3-8b-instruct, and you can switch it to any model in the Workers AI catalog from wrangler.toml with no code change.

Can I add Krispy to a site I don't control, like Webflow or Shopify?

Yes, as long as you can inject a custom script tag. Webflow supports this under Site Settings → Custom Code. Shopify has a custom code section in the theme editor. Any CMS or site builder that lets you paste a <script> tag works — there's no npm dependency on the frontend side.

What happens when the Cloudflare free tier limit runs out?

The Worker returns 429 errors until the daily limit resets at midnight UTC — Cloudflare does not charge you without warning or explicit opt-in. If you need sustained higher volume, the $5/month Workers paid plan raises the request cap dramatically. Cloudflare stops requests before it bills past a cap unless you upgrade.

Is conversation history stored on Krispy's servers?

No. When you self-host, conversations live in Cloudflare KV under your own account — nothing is sent to Krispy. If you use Krispy Cloud instead of self-hosting, the terms of service cover data handling. Self-hosting means your data never leaves your own Cloudflare account.

Buttr the croissant mascot

🥐 Buttr: à bientôt. star the repo if this saved you $74/mo.

The repo is at github.com/krispyai/krispy — a ⭐ helps other builders find it. Prefer to skip the terminal? Krispy Cloud runs the same open codebase, hosted, with a 14-day free trial and $19/month flat after that.

Buttr the croissant mascot

that's the whole thing. want me to answer your visitors like this? i self-host in one command. 🥐