what is krispy
open-source live chat with an AI answerer and a human handoff to Telegram β self-hosted on Cloudflare's free tier.
krispy π₯
open-source live chat with a human in the loop. an AI answers your visitors in your voice, and hands off to you on Telegram the moment a real person is needed β you reply from your phone, it lands live in the chat, and the bot goes quiet.
let the bot cook π₯
the repo you're reading
this is the lean, self-hostable core β exactly two deployable things plus the CLI to run them. the dashboard, billing, accounts, and marketing surfaces live in a separate Cloud repo and do not ship here.
| path | what it is |
|---|---|
services/edge | β one Cloudflare Worker + a hibernatable Durable Object (SessionDO). chat + Telegram handoff. the whole backend, one deploy. |
packages/widget | β the dependency-free embeddable widget.js β vanilla JS in a Shadow DOM, zero deps. |
packages/cli | the krispy CLI β manage your bot's knowledge base (its system prompt). |
the loop
- visitor types β instant AI reply.
- every message mirrors to one Telegram forum topic per visitor on your phone.
- you reply from Telegram β it's pushed into the browser over a WebSocket, live.
- the bot detects it's a human job and steps back β no double-answering.
the stack
- Cloudflare Workers + Durable Objects (hibernatable
SessionDO) β the whole backend, one deploy. - Workers AI β the built-in bot (
@cf/meta/llama-3.3-70b-instruct-fp8-fastby default). a BYO-key seam is there. - Cloudflare KV β tenant config, topicβsession map, usage counters.
- Telegram Bot API β the handoff channel (one forum topic per visitor).
- Bun + wrangler β package manager, runtime, deploy.
- widget is vanilla JS in a Shadow DOM β zero framework, zero dependencies.
where to go next
- quickstart β self-host in ~10 minutes.
- concepts β the markers, connectors, theme, KV config.
- guides β task-oriented: deploy, embed, connect Telegram, forms.
- reference β CLI, edge routes,
TenantConfig, the markers. - security β secrets, the widget-config whitelist, the prompt guardrails.