A UI (that is somewhat similar to ChatGPT) for the OpenAI API or any model that supports the Messaging API. Key features include
- Chat History
- Temporary Chat
- Support for math and code blocks
- Navigate to the
@/backenddirectory and run:npm install
- Navigate to the
@/frontenddirectory and run:npm install
Run the run.ps1 script located in the root directory to start the web application:
./run.ps1- First Time Setup:
On the first execution, this script will automatically configure the required environment variables and generate configuration files before starting the application.
To use the app, you need to set the following environment variables:
OPENAI_API_KEY=<your_openai_api_key>HF_API_KEY=<your_huggingface_api_key>
BASE_URL=<huggingface_inference_api_base_url>Note: The
run.ps1script will prompt you to enter these keys during setup if they are not already configured.
If you want to save your chat history to a MongoDB database, you need to set an additional environment variable:
CONNECTION_URL=<your_mongodb_connection_url>By default, chat history is saved as files in the @/backend/database/chats/ directory.
- Open the
@/backend/configs/config.jsonfile. - Locate the
"CHAT_SAVE_MODE"property and update its value:
{
// ...
"CHAT_SAVE_MODE": 1
// ...
}{
// ...
"CHAT_SAVE_MODE": 2
// ...
}The application supports a variety of text-completion models.
- OpenAI Models: Ensure the model is enabled in your OpenAI API Playground.
- Hugging Face Models: Any model available via the Hugging Face Messaging or Inference API is supported.
- Make sure you have a valid API key for the service you are using (OpenAI or Hugging Face).
- The
run.ps1script simplifies the setup and ensures everything is configured correctly.
Enjoy using the ChatGPT-Interface! 🎉
