A web based chat interface built on Cloudflare Pages that allows for exploring Text Generation models on Cloudflare Workers AI. Design is built using tailwind.
This project makes use of LocalStorage to maintain state. We have better solutions available (more coming soon). please dont forget to update your system prompt in index.tsx and script.js
This is a template repository. Please feel free to create your own repository from this one by using the "Use this template" button. It's right next to the ⭐️ this repo button, which you could totally do as well if you wanted to.
This is, like all of us, a Work in Progress.
npm install
# If this is your first time using workers by cloudflare
npx wrangler loginThis uses the local Vite server for rapid development
npm run devThis builds and runs in Wrangler your site locally, just as it will run on production
npm run previewThis hosts your site on Cloudflare Pages
npm run deploynpx wrangler pages deployment tailIf you are on a Mac, you can generate the list of models in script.js by running the following commands:
# If this is your first time here. You won't regret it.
brew install jq# Filter all Text Generation models into "ga" and "beta"
npx wrangler ai models --json | jq '
reduce .[] as $item (
{beta: [], ga: []};
if ($item.task.name == "Text Generation") then
if ($item.properties | any(.property_id == "beta" and .value == "true")) then
.beta += [$item.name]
else
.ga += [$item.name]
end
else
.
end
) |
.beta |= sort |
.ga |= sort
'