Tip Of AI
Discover what you can do with AI
privateGPT is a project that allows users to ask questions to their documents without an internet connection, ensuring complete privacy as no data leaves the execution environment. It is built with several technologies including LangChain, GPT4All, LlamaCpp, Chroma, and SentenceTransformers. To set up the environment to run the code, users need to install the required dependencies using either pip3 or poetry. They also need to download the LLM model and place it in a directory of their choice. Users can specify the model type, persistence directory, model path, maximum token limit, number of tokens in the prompt, embeddings model name, and the amount of chunks (sources) to be used to answer a question by configuring the variables in the .env file. The project supports various file extensions for ingesting documents, including CSV, Word Documents, EverNote, Email, EPub, HTML, Markdown, Outlook Message, Open Document Text, PDF, PowerPoint Document, and Text file. Users can ingest their own datasets by placing the files into the source_documents directory and running the ingestion script. Once the documents are ingested, users can ask questions by running the privateGPT script. The script will consume the prompt and provide the answer along with the sources used as context from the documents. Users can ask multiple questions without re-running the script. The project utilizes LangChain tools, HuggingFaceEmbeddings, and Chroma vector store to parse and create embeddings from the documents. It then uses a local LLM based on GPT4All-J or LlamaCpp to understand and answer questions by extracting the context from the local vector store using similarity search. privateGPT has system requirements of Python 3.10 or later and may require a C++ compiler for building the wheel during installation. It is important to note that the project is still in the testing phase and not intended for production use. The model selection prioritizes privacy over performance, but it is possible to use different models and vector stores to improve performance. Overall, privateGPT offers a locally-run, privacy-focused solution for question-answering with LLMs and vector embeddings.