create-svelte-chatgpt
is a project generator for building SvelteKit applications powered by ChatGPT. It comes with a pre-built example chat interface and other common features integrated.
Features include:
- ChatGPT integration using chatgpt-api.
- Keyv for persistent chat history. Prioritises Redis, falls back to in-memory storage if
REDIS_URL
is not provided in the.env
. - TailwindCSS for styling / animations.
- Svelte Form Actions utilised in the chat interface.
npx create-svelte-chatgpt@latest
Create a .env
file in the root directory and add your OpenAI API key.
You can get your API key here from the OpenAI dashboard.
OPENAI_API_KEY=xxx
REDIS_URL=yyy # Optional, can be local or remote using Redis Labs, etc. Falls back to in-memory storage if not provided.
REDIS_PASSWORD=zzz # Optional, only required if using a Redis instance.
demo.mov
To start a development server:
npm run dev
# Or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.
Contributions are welcome! Please create a fork of the repository, make your changes, and submit a pull request.
This project is open-source and available under the MIT License.