demo.mp4
ChatMancer is an app that leverages the power of a LLM (currently GPT) to offer a dynamic and interactive user experience, inspired by OpenAI's ChatGPT. This application stands out with its ability to maintain context in conversations and generate images based on user requests. And could potentially be a cheaper alternative than ChatGpt plus with the ability to use models only available using the OpenAi API.
ChatMancer is adept at remembering the context from previous user interactions, enabling continuous and coherent dialogues. This feature allows for in-depth discussions and efficient follow-up questions, enhancing the user experience significantly.
A distinctive feature is the integration of the /image
command. Users can prompt the creation of images by entering /image
followed by a descriptive brief. The application seamlessly processes this command, connecting with an image generation API (currently uses DALL·E) to produce visual content that aligns with the user's description. This innovative functionality adds a creative dimension to the interaction, enriching the overall experience.
Allows users to upload PDFs for direct inquiries. Upon uploading a document, users can immediately ask questions about its content. For subsequent queries related to the document, simply prefix your question with /pdf
to maintain context. This enhancement streamlines the process of extracting information from documents, facilitating a focused and efficient conversation tailored to the content of the uploaded PDF.
Reimplement the ability to upload text based files to ask questions / add to the context.- Support for a user to give gpt a url to ask questions on / add to the context
- Integration of Gpt vision so a user can upload an image and ask gpt questions on it.
- Ability to choose model and possibly maintain context from the conversation.
- Websockets
Please note that running this application involves usage of certain APIs that are not free of charge. Costs depend on the volume of use. However, for personal use, these APIs are generally quite affordable. For instance, during my personal usage of the app, the highest monthly bill I ever received was only $8. I was using multiple services that month like Dalle and played A LOT with AutoGPT.
While this is relatively low, costs can vary based on usage, so it's important to monitor your usage to avoid any surprises. Please ensure you understand the pricing details of these APIs before using the application. In the billing section of the Open Ai Developer page, you can set usage limits. I set my account to max out at $20/month.
To run this project, you will need to add the following environment variables to your .env
file in the /api directory. These variables are crucial for securing the application and connecting to external services.
This is your OpenAI API key, used to authenticate requests to OpenAI services such as GPT and DALL-E. Ensure that you have an active OpenAI account and have generated an API key. This key enables the application to interact with OpenAI's powerful AI models.
This variable acts as a simple security measure to protect access to your project, especially when deployed on the internet. You can set this to any string value you prefer. This password should be kept confidential and only shared with authorized users.
If you just want to play with this locally and know how to use docker follow these steps.
-
Clone the repository:
git clone https://github.com/alexbenko/ChatMancer.git
cd ChatMancer
-
Create and fill required values in .env file in /api
-
Run command at root
docker build -t chatmancer .
-
Start docker
docker run -p 8000:8000 chatmancer
-
Click on the printed url, enter your password, and start chatting!
Follow the instructions below to set up the project on your local machine for development and testing purposes.
-
Clone the repository:
git clone https://github.com/alexbenko/ChatMancer.git
cd ChatMancer
-
Install server dependencies:
pip install -r requirements.txt
-
Ensure you have an API key from OpenAI.
-
Set your enviornment variables in a .env file inside the /api directory:
OPENAI_API_KEY=your_openai_key PASSWORD=your_chosen_password
Replace
your_openai_key
with your actual OpenAI key. -
Navigate to the
api
directory and start the Python backend application:python main.py
This will launch the backend server.
-
Navigate into the
web
directory and install dependencies, then build the Vite.js project:cd web npm install npm run dev
-
You can access the application by navigating to the printed URL.
- Vite - A lightweight and fast build tool for modern JavaScript applications, designed for quick development and efficient production builds.
- React - A JavaScript library for building user interfaces, developed and maintained by Facebook.
- TypeScript - A statically typed superset of JavaScript
- Python 3.11 - A high-level, interpreted programming language
- FastApi - A modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.
- NPM - A package manager for JavaScript, widely used to manage dependencies in Javascript projects and to share and install open-source JavaScript packages.
- PIP - A package manager for Python that simplifies the installation and management of software packages from the Python Package Index (PyPI).
Any contributions you make are greatly appreciated.
Distributed under the MIT License. See LICENSE
for more information.