Private GPT is a customized version of OpenAI's ChatGPT, designed to provide a powerful and versatile interaction experience with artificial intelligence technologies. This assistant can transform how you utilize AI in various daily applications.
- Interactive Chat: View your OpenAI balance, create and manage different chats, and switch assistants during a conversation.
- AI Audio Generation: Create high-quality audio in seconds.
- Artist Assistant: Generate stunning images, like forest landscapes, with the artist AI.
- Scriptwriter Assistant: Create creative and efficient scripts, such as horror video scripts.
- routes/: Contains application routes.
- assistants/: Module for managing assistants.
- instance/: Directory to store generated files, such as audio.
- static/: Static files (CSS, JS, images).
- templates/: HTML templates for rendering in Flask.
- app.py: Entry point of the Flask application.
- config.py: Application configuration.
- models.py: Database models definition.
-
Clone the repository:
git clone https://github.com/caiolombello/PrivateGPT.git cd PrivateGPT
-
Create and activate a virtual environment (optional, but recommended):
python3 -m venv venv source venv/bin/activate
-
Install project dependencies:
poetry install
-
Create a
.env
file with the following variables:OPENAI_API_KEY=your_openai_api_key OPENAI_SESSION_KEY=your_openai_session_key OPENAI_ORGANIZATION=your_openai_organization_id AUTHENTICATION=False
- OPENAI_API_KEY: Your OpenAI API key, which you can obtain from your OpenAI account dashboard.
- OPENAI_SESSION_KEY: Your OpenAI session key. For a detailed guide on how to get your session key, refer to this discussion.
- OPENAI_ORGANIZATION: Your OpenAI organization ID, which can be found in the OpenAI platform settings.
- AUTHENTICATION: Set to
False
if you do not require IP-based authentication; otherwise, set toTrue
and configure accordingly.
-
Initialize the database:
flask db init flask db migrate flask db upgrade
-
Run the application:
flask run
- Create an Assistant: Send a POST request to
/assistant/create
withassistant_name
,assistant_instructions
,image
(optional), andvoice
(optional). - Initialize a Thread: Send a POST request to
/assistant/initialize
withassistant_id
. - List Assistants: Send a GET request to
/assistant/list
. - Send Message: Send a POST request to
/messages/send
withthread_name
andmessage
. - Receive Messages: Send a GET request to
/messages/receive/<thread_name>
. - Rename Thread: Send a POST request to
/messages/thread/rename
withthread_name
andmessages
.
To build and run the application with Docker:
-
Build the Docker image:
docker build -t private-gpt .
-
Run the container:
docker run -d -p 5000:5000 --name private-gpt-container private-gpt
The create.sh
script located in the assistants
folder can be used to automatically create assistants based on instruction files.
- Edit the
create.sh
script to adjust theSERVER_URL
if necessary. - Add or modify text files with the assistant instructions in the
assistants
folder. - Run the script:
./assistants/create.sh
Contributions are welcome! Feel free to open issues and pull requests to improve this project.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information, contact [email protected].