Svelte GPT is a Chat UI for interacting with language model APIs.
- Frontend: Svelte
- Backend: SvelteKit
- Database: Pocketbase
It runs in your browser on localhost:1337
.
- π Launch a new chat from anywhere (via Alfred)
- I.e. You can input a prompt + select which model to use via URL query parameters
- This isn't possible on chat.openai.com
- π‘ Use any model
- βοΈ Control the model settings
- π Control the
system_prompt
- π Fork chats
- Surprisingly useful feature!
- I don't think anyone has done this yet
- π Automatic model switching when the context window is exceeded
- I.e. Intelligently switches from
gpt-3.5-turbo
togpt-3.5-turbo-16k
at the 4096 token limit
- I.e. Intelligently switches from
- π° Save $25/mo if you don't actually use ChatGPT that much
-
Download the latest Pocketbase release
- Put the
pocketbase
executable in the/pocketbase/
folder - Run
pocketbase
for the first time to initialise it- On MacOS you may need to do
β+Click
->Open
->Confirm open
- On MacOS you may need to do
- Close the terminal window once it's done
- Put the
-
Create a
.env
file in the root directory, addOPENAI_TOKEN=<your_token_goes_here>
and save:
OPENAI_TOKEN=sk-YoUrOpEnAiAcCeSsToKeNtHaTyOuGeTfRoMtHeIrWeBsItE
- Install dependencies
npm install
- Compile the SvelteKit app:
npm run build
- Launch both Pocketbase and Svelte GPT with the shell script:
./start.sh
- (Note: You can also run Svelte GPT in dev mode, with live reloading, by running
./start.sh dev
)
-
Go to
http://localhost:1336/_/
(β+click the link) and add an admin email + password to finish setting up Pocketbase -
Go to
http://localhost:1337
and start chatting.
This isn't finished, production ready code - it's a personal project that I originally had no intention of sharing. I could be persuaded to develop it properly, but it works for my needs and I'm currently focused on other things!