THIS IS A WORK IN PROGRESS!
Craft your conversations, meet virtual personas, connect!
ChatCrafters is a web application which allows you to create AI Personas, which are specialised instructions for an LLM to be able to act as another character. You can also chat with Personas other people create.
This website was built for the dev.to Cloudflare AI Challenge.
Hosted live at https://chatcrafters-c70.pages.dev.
View my submission post at https://dev.to/arnu515/chatcrafters-chat-with-ai-powered-personas-40o0.
This application uses eight different models!
One of them being Stable Diffusion XL Lightning, for generating Persona images.
It also uses OpenAI Whisper for speech recognition, so you can talk to your Personas!
The other six are Text Generation models. They are:
- Svelte Kit for the fullstack framework.
- It has first class support for Cloudflare Pages
- Svelte is a very elegant framework, and Svelte Kit is a very good meta-framework for Svelte.
- Svelte was probably the reason that I was able to build this application in a reasonable amount of time.
- TailwindCSS, Daisy UI, and Bits-UI for styling.
- Cloudflare D1 for the database.
- Using the official bindings for the client.
- Cloudflare Pages for hosting.
- DigitalOcean Spaces for the CDN.
- Clone this repository and install pnpm packages with
pnpm i.
Make sure you're authenticated to wrangler with pnpm exec wrangler login
- Create a D1 database using
pnpm exec wrangler d1 create NAME_OF_DB. Copy whatever TOML output it gives you intowrangler.toml, but make sure that the binding isdb.
Example:
[[d1_databases]]
binding = "db" # DO NOT CHANGE THIS
database_name = "NAME_OF_DB"
database_id = "SOME-RANDOM-UUID"Create the schema using
ls sql/*.sql -1 | xargs -L 1 -t pnpm exec wrangler d1 execute chatcrafters --remote --fileIf wrangler isn't able to pick up these bindings for Cloudflare pages, then you may need to add them manually
- Add environment variables by copying the
.env.examplefile to.env, and filling in your values.
Also copy paste the .env file you create in your Pages' settings (once it goes live, then do step 4 & 5 again.) as shown here.
-
Build the app with
pnpm build. -
Deploy to pages with
pnpm exec wrangler pages deploy .svelte-kit/cloudflare
If you don't have a pages project yet, create one with pnpm exec wrangler pages project create
-
Follow steps 1-3 of the deployment guide, but substitute
--remotefor--localin the D1 command. -
Run
pnpm devto start the local devserver at http://localhost:5173.