Skip to content

arnu515/ChatCrafters

Repository files navigation

ChatCrafters

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.

AI Models used

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:

Tech stack

  • 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.

Deploy on Cloudflare Pages

  1. Clone this repository and install pnpm packages with pnpm i.

Make sure you're authenticated to wrangler with pnpm exec wrangler login

  1. Create a D1 database using pnpm exec wrangler d1 create NAME_OF_DB. Copy whatever TOML output it gives you into wrangler.toml, but make sure that the binding is db.

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 --file

If wrangler isn't able to pick up these bindings for Cloudflare pages, then you may need to add them manually

  1. Add environment variables by copying the .env.example file 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.

  1. Build the app with pnpm build.

  2. 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

Local Development

  1. Follow steps 1-3 of the deployment guide, but substitute --remote for --local in the D1 command.

  2. Run pnpm dev to start the local devserver at http://localhost:5173.

About

Craft your conversations, meet virtual personas, connect!

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors