Go to file
2023-04-02 10:02:12 +08:00
.github Add funding link 2023-03-05 21:48:31 +08:00
.vscode Add configuration file 2023-03-09 23:52:26 +08:00
config Handle the OpenAI API error 2023-03-13 01:03:14 +08:00
public Handle the OpenAI API error 2023-03-13 01:03:14 +08:00
src Handle the OpenAI API error 2023-03-13 01:03:14 +08:00
test Init project 2023-03-05 18:17:50 +08:00
.dockerignore Build docker image 2023-03-10 00:10:52 +08:00
.editorconfig Init project 2023-03-05 18:17:50 +08:00
.eslintrc.js Init project 2023-03-05 18:17:50 +08:00
.gitignore Add configuration file 2023-03-09 23:52:26 +08:00
.prettierrc Init project 2023-03-05 18:17:50 +08:00
Dockerfile Build docker image 2023-03-10 00:10:52 +08:00
nest-cli.json Init project 2023-03-05 18:17:50 +08:00
package.json Add configuration file 2023-03-09 23:52:26 +08:00
pnpm-lock.yaml Add configuration file 2023-03-09 23:52:26 +08:00
README.md Archive the project 2023-04-02 10:02:12 +08:00
tsconfig.build.json Init project 2023-03-05 18:17:50 +08:00
tsconfig.json 修复macos下fetch错误 2023-03-09 11:55:51 +08:00

⚠️ This repository is archived. Please use ChatbotUI instead.

ChatGPT Mirror

Based on model gpt-3.5-turbo.

Installation

Tested on Node.js 18.x.

$ pnpm install

Running the app

Create a .env file in the root directory and add your OpenAI API key:

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# optional, support http or socks proxy
HTTP_PROXY=http://proxy-server:port
# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Visit http://localhost:3000

Running the app with Docker

Build the image

$ docker build -t chatgpt-mirror .

Run the container

$ docker run -d -p 3000:3000 --env-file .env chatgpt-mirror

Run with the config file

$ docker run -d -p 3000:3000 --env-file .env -v $(pwd)/config/app.config.json:/app/config/app.config.json chatgpt-mirror

Configuration

You can configure the app by copying the config/example.json to config/app.config.json and editing its values. Note: comments are not allowed in JSON files.

Error messages

Error messages for the OpenAI API can be customized by editing the config/app.config.json file. See the examples in the config/example.json file.

Credits

Thanks: transitive-bullshit/chatgpt-api

License

MIT licensed.