Skip to content

almightynan/0012

Repository files navigation

0012

a chat app built on Cloudflare Workers AI. uses Llama 3.3 70B running on Workers AI, with each chat session backed by a Durable Object that persists messages in SQLite. the chat sessions are stored in KV.

0012 doesn't mean anything. This is the 12th repository I'm publishing on GitHub, hence the name.

setup

you'll need a Cloudflare account and wrangler authenticated.

wrangler login

install dependencies:

npm install
bun install # if you use bun

create a KV namespace for session metadata: (this will update wrangler.jsonc file by itself.)

wrangler kv namespace create SESSIONS_KV

build the frontend and start the dev server:

npm run build
npx wrangler dev

for live frontend reloading during development, run these in two separate terminals:

npm run dev:ui    # hot reloading
npx wrangler dev  # worker

deploy

npm run deploy

notes

  • Workers AI runs remotely even in local dev, so you need to be logged into wrangler
  • the DO migration in wrangler.jsonc only needs to run once, don't remove it after deploying
  • don't copy this and call it your own, i need this for an assignment

About

chat app on cloudflare workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors