← all posts
how-to · fait maison

Self-host live chat on Cloudflare for free

Self-host AI live chat on Cloudflare for $0/mo using Workers, Pages, and Durable Objects. Built-in AI answers questions; Telegram handoff routes the rest.

Shai Snir
self-hostingcloudflarelive-chatworkersopen-source

Krispy AI live chat widget running on Cloudflare Workers and Pages at the edge

Buttr at the edge. 300 Cloudflare locations, zero tabs open, $0/mo. this is the build.

Buttr the croissant mascot

🥐 Buttr: crisp is $95/mo. intercom starts at $74 and climbs. i'm free. no shade — just math.

Krispy is an open-source AI chat widget that runs on Cloudflare Workers, Pages, and Durable Objects. For typical indie and early-stage traffic, the total monthly infrastructure cost is $0. It answers visitor questions with a built-in LLM and routes the conversation to you on Telegram when a human is needed.

What does self-hosting Krispy on Cloudflare actually cost?

For most indie and early-stage projects, $0 — and all three Cloudflare primitives Krispy uses are included in the free plan:

  • Workers — the chat API, session logic, and widget delivery. Cloudflare's free plan covers 100,000 requests per day (cloudflare.com/plans), which is more than enough for most marketing sites and early products.
  • Workers AI — the built-in LLM that answers visitor questions before a human takes over. The free tier includes 10,000 neurons per day (developers.cloudflare.com/workers-ai/platform/pricing) with no external API key or third-party bill.
  • Durable Objects — each chat session lives in its own DO, so message state is consistent without a separate database. Free plan: 1 million requests per month.

None of these require a credit card to start.

By comparison, Crisp's team plan is $95/month and Intercom starts at $74/month before AI add-ons and per-seat costs kick in (both as of their 2026 pricing pages). The Cloudflare free tier covers the infrastructure that competes with both.

How do I deploy Krispy to Cloudflare Pages?

Clone the repo, install dependencies, run one command. The full deploy is:

# clone and install
git clone https://github.com/lonormaly/krispyai
cd krispy
bun install

# deploy the Worker + Pages functions to Cloudflare's edge
bunx wrangler deploy

That pushes the Worker (chat API + Durable Object bindings) and the static Pages assets to Cloudflare's global edge in one shot. No Docker, no server to keep running. Deploys take about 20 seconds.

Then drop the embed snippet wherever your site loads scripts:

<script src="https://<your-worker>.workers.dev/widget.js" async></script>

Visitor conversations route to your own Worker — nothing touches any Krispy-owned server. The 5-minute quick-start guide covers the widget config and first message setup in full.

How does the Workers AI layer work?

By default, Krispy uses @cf/meta/llama-3.1-8b-instruct via the Cloudflare AI binding — the same model available in every Workers account, billed directly to Cloudflare at the standard AI Gateway rate. On the free tier those first 10,000 neurons/day cost nothing. You configure the system prompt, fallback behavior, and escalation rules in krispy.config.ts.

If you'd rather use GPT-4o, Claude, or Gemini, the config accepts a model override and your own key. That's covered in the bring-your-own-AI-model guide. Workers AI is the zero-config default — useful if you want to ship first and revisit the model choice later.

Buttr the croissant mascot

🥐 Buttr: llama 3.1 handles "where's my order?" just fine. the existential ones are yours. sorry.

How does the Telegram handoff work?

When the AI hits its limits — a billing dispute, a refund request, a user who just says "I want to talk to a person" — Krispy routes the conversation to Telegram. Your phone buzzes, you reply in the thread, and your message appears live in the visitor's chat widget. No new app to learn, no extra dashboard to check.

The Telegram handoff setup guide takes about two minutes: create a bot via BotFather, paste the token into your config, add your chat ID.

This is where most of the real time savings come from. The widget isn't just a support inbox — it's a triage layer. Most visitor questions repeat (pricing, integrations, account access). The AI handles those. The ones that reach Telegram are the ones worth your time.

What are the honest limits of the free tier?

The free tier has real ceilings. Here's what they are:

  • Workers AI: 10,000 neurons/day free, then ~$0.011 per 1,000 neurons at Cloudflare's standard rate. For a high-volume site, switching to an external model via the model override is likely cheaper.
  • Durable Objects: 1 million requests/month free. Each message read/write counts as a request. A busy chat widget can reach this. Cloudflare's paid plan adds $5/month for Workers — still far below any live-chat SaaS.
  • Cloudflare Pages: 500 deployments/month, 100,000 requests/day on the free plan. For most projects this isn't a constraint.

"Free" is accurate for typical indie and early-stage traffic. The ceiling is real, but the floor of any competing SaaS starts at $74–95/month.

Buttr thinking through the Cloudflare pricing tiers

Buttr the croissant mascot

🥐 Buttr: worst case you hit $5/mo on workers. that's less than a croissant at the airport. (those are $8.)

Star the repo or skip the ops

Krispy is open source. Star or fork it at github.com/lonormaly/krispyai — that's how the project stays active and how you stay in the loop on updates. If you'd rather skip Wrangler entirely, Krispy Cloud gives you the same widget and Telegram handoff hosted, with a 14-day free trial and $19/month flat after that.

Both paths give you the same chat experience. One gives you full data control and $0 recurring cost; the other saves the setup time.

FAQ

Does self-hosting Krispy on Cloudflare actually cost $0?

For typical low-to-mid traffic, yes. Cloudflare's free plan covers 100,000 Worker requests per day, 10,000 Workers AI neurons per day, and 1 million Durable Object requests per month — all without a credit card. If your volume exceeds those limits, the paid plan starts at $5/month for Workers, which is still far below any live-chat SaaS minimum.

Do I need a Cloudflare account to self-host Krispy?

Yes — Krispy deploys as a Cloudflare Worker + Pages project, so a Cloudflare account is required. If you don't want to manage infrastructure at all, Krispy Cloud is the hosted alternative with a free trial.

Can I run Krispy on Cloudflare without a separate database?

Yes. Session state lives in Durable Objects, which are included in your Cloudflare account. No external Postgres, Redis, or Supabase required. Conversation history is stored at the edge, close to your users.

What happens to chat data when I self-host?

It stays in your Cloudflare account. Durable Object storage is isolated to your zone — no conversation data touches Krispy's servers. That's the main reason some teams prefer self-hosting over any SaaS: full data residency under their own account.

Does the free Workers AI model work well enough for a support widget?

Llama 3.1 8B handles FAQ-style questions, product information, and basic troubleshooting reliably. It struggles with nuanced reasoning or multi-step problems — which is exactly why the Telegram handoff exists. The AI covers the 80% of questions that repeat; you handle the 20% that actually need a person.

Can I use a different AI model instead of Workers AI?

Yes. The model field in krispy.config.ts accepts any OpenAI-compatible provider — GPT-4o, Claude, Gemini, or a self-hosted model. You supply the key; Krispy routes through it. Workers AI is the default because it requires no configuration, not because it's the only option. Full instructions in the bring-your-own-AI-model guide.

Buttr the croissant mascot

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