Introduction to ChatGPT Mirror
ChatGPT Mirror is an intriguing project that aims to facilitate the use of OpenAI's powerful gpt-3.5-turbo
model. Although the repository is archived, it provides valuable insights into setting up and utilizing AI models in a user-friendly manner. This repository is now succeeded by ChatbotUI, which users are recommended to explore for continued improvements and support.
Installation Guide
ChatGPT Mirror is developed with Node.js, specifically tested on version 18.x. To get started with the application, users need to execute the following command:
$ pnpm install
This installs all the necessary dependencies required to run the application smoothly.
Running the Application
To run the application, users must create a .env
file in the root directory, which is critical for personalizing the setup. The OpenAI API key must be added to this file:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# optional, support http or socks proxy
HTTP_PROXY=http://proxy-server:port
The command-line instructions for different environments are as follows:
-
For development mode:
$ pnpm run start
-
For watch mode:
$ pnpm run start:dev
-
For production mode:
$ pnpm run start:prod
Once these steps are completed, the application will be accessible by visiting http://localhost:3000
.
Running with Docker
Docker offers an alternative way of running the application, providing more flexibility in deployment. The following command builds the Docker image:
$ docker build -t chatgpt-mirror .
To run the container, users can use:
$ docker run -d -p 3000:3000 --env-file .env chatgpt-mirror
Additionally, to run the application with a configuration file, the command is:
$ docker run -d -p 3000:3000 --env-file .env -v $(pwd)/config/app.config.json:/app/config/app.config.json chatgpt-mirror
Configuration
The application is highly customizable. Users can configure settings by copying the config/example.json
to config/app.config.json
and adjusting the necessary values as per their requirements. It's important to note that JSON files should not contain comments.
Customizing Error Messages
One of the features of ChatGPT Mirror is the ability to customize error messages related to the OpenAI API. Users can modify these messages by editing the config/app.config.json
file. For guidance, examples can be found in the config/example.json
file.
Acknowledgments and License
Special thanks to transitive-bullshit/chatgpt-api for their contributions that have significantly informed the development of ChatGPT Mirror.
The project is licensed under the MIT License, promoting a robust open-source contribution model. Users and developers are encouraged to review the license details in the provided LICENSE
file.
Through its structured setup and comprehensive configuration options, ChatGPT Mirror serves as a notable project for those interested in exploring AI implementations using state-of-the-art language models.