The Wayback Machine - https://web.archive.org/web/20230321222222/https://github.com/yuezk/chatgpt-mirror
Skip to content

yuezk/chatgpt-mirror

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
March 5, 2023 21:48
March 9, 2023 23:52
March 13, 2023 01:03
March 13, 2023 01:03
src
March 13, 2023 01:03
March 5, 2023 18:17
March 10, 2023 00:10
March 5, 2023 18:17
March 5, 2023 18:17
March 9, 2023 23:52
March 5, 2023 18:17
March 10, 2023 00:10
March 13, 2023 01:03
March 5, 2023 18:17
March 9, 2023 23:52
March 5, 2023 18:17

ChatGPT Mirror

Based on model gpt-3.5-turbo. Demo: https://fastgpt.app

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.