This project is developed from the source project chatgpt-web with backend refactored from third-party chatgpt-api which has been out-of-maintenance to official openai-node API with much flexibility and extensibility.
This project has the following new features standing on the source project chatgpt-web.
[✓] Model selection (gpt-4 / gpt-3.5)
[✓] In-place message editing
[✓] Full session history control
[✓] Conversation-wise draft prompt and context state
[✓] Search chat list by title
[✓] Drag to reorder chat list
[✓] Auto-generate summary title for conversation
[✓] Built with official openai-node API
[✓] Multi-user authentication and profiles
[✓] Model-wise token usage statistics logging for users
More coming...
node
>= 18
If you haven't installed pnpm
npm install -g pnpm
You should complete the environment variable file following service/.env.example
, including setting up your OpenAI API Key.
If you would like to setup access tokens for users, create the auth config file following service/auth.example.json
to define relevant user information, including name, avatar link, and description.
Under root directory of the repository:
pnpm install
cd service/
pnpm install
In one terminal:
cd service/
pnpm dev
In another terminal:
pnpm dev
Access http://127.0.0.1:3002/
to see a preview during development.
Optionally modify frontend .env
file.
# Install
pnpm install
# Pack - this packs all distribution files into the backend folder "service/public/"
pnpm build
After packing the frontend, you can safely move service/
folder independently to the production environment.
Setup service/.env
and service/auth.json
files as described above.
cd service/
# Install
pnpm install
# Pack
pnpm build
# Start service
pnpm prod
User usage logs would be generated automatically under service/logs/
, for example:
{
"2024_06_28": {
"user1": {
"gpt-4o": {
"prompt_tokens": 768,
"completion_tokens": 266
},
"gpt-4o-mini": {
"prompt_tokens": 324,
"completion_tokens": 95
}
}
}
}
Q: Does it support unofficial proxy API like in source project?
A: No. It removes proxy support with official API.
Q: Can I migrate my chat history from the source project?
A: Yes. The data store is fully compatible with the source project, and you can safely import your old chat histories.
Q: Does it support other packaging methods like docker container?
A: To maintain simplicity, this project only keeps manual deployment. You could apply other packaging methods from the source repo.
Thanks to everyone who has contributed! Especially @Gnefil who learnt a lot during the project development =D.
Thanks to @ChenZhaoYu for contributing to the source project chatgpt-web.