{"id":3885,"date":"2023-05-16T04:32:26","date_gmt":"2023-05-15T23:32:26","guid":{"rendered":"https:\/\/www.edopedia.com\/blog\/?p=3885"},"modified":"2023-05-16T04:32:27","modified_gmt":"2023-05-15T23:32:27","slug":"privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data","status":"publish","type":"post","link":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/","title":{"rendered":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data"},"content":{"rendered":"\n<p>PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been modified to make it more private. PrivateGPT does not store any of your data on its servers, and it does not track your usage. This makes it a great choice for businesses and individuals who are concerned about privacy.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/github.com\/imartinez\/privateGPT\">source code of PrivateGPT<\/a> is available on GitHub.<\/p>\n\n\n\n<p>PrivateGPT is also very powerful. It can generate text, translate languages, and answer your questions in an informative way. It can also be used to create interactive AI dialogues. This makes it a valuable tool for a variety of applications, including customer service, education, and research.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Benefits of Using PrivateGPT<\/h2>\n\n\n\n<p>There are many benefits to using PrivateGPT. Some of the most important benefits include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Privacy: PrivateGPT does not store any of your data on its servers, and it does not track your usage. This makes it a great choice for businesses and individuals who are concerned about privacy.<\/li>\n\n\n\n<li>Security: PrivateGPT is designed to be secure. It uses a variety of security measures to protect your data, including encryption and authentication.<\/li>\n\n\n\n<li>Power: PrivateGPT is a powerful AI language model. It can generate text, translate languages, and answer your questions in an informative way. It can also be used to create interactive AI dialogues.<\/li>\n\n\n\n<li>Flexibility: PrivateGPT is a flexible tool. It can be used for a variety of applications, including customer service, education, and research.<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Environment Setup<\/h1>\n\n\n\n<p>In order to set your environment up to run the code here, first install all requirements:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">pip install -r requirements.txt<\/pre><\/div>\n\n\n\n<p>Then, download the 2 models and place them in a directory of your choice.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LLM: default to&nbsp;<a href=\"https:\/\/gpt4all.io\/models\/ggml-gpt4all-j-v1.3-groovy.bin\">ggml-gpt4all-j-v1.3-groovy.bin<\/a>. If you prefer a different GPT4All-J compatible model, just download it and reference it in your&nbsp;<code>.env<\/code>&nbsp;file.<\/li>\n\n\n\n<li>Embedding: default to&nbsp;<a href=\"https:\/\/huggingface.co\/Pi3141\/alpaca-native-7B-ggml\/resolve\/397e872bf4c83f4c642317a5bf65ce84a105786e\/ggml-model-q4_0.bin\">ggml-model-q4_0.bin<\/a>. If you prefer a different compatible Embeddings model, just download it and reference it in your&nbsp;<code>.env<\/code>&nbsp;file.<\/li>\n<\/ul>\n\n\n\n<p>Rename&nbsp;<code>example.env<\/code>&nbsp;to&nbsp;<code>.env<\/code>&nbsp;and edit the variables appropriately.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text\/plain&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Plain Text&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;text&quot;}\">MODEL_TYPE: supports LlamaCpp or GPT4All\nPERSIST_DIRECTORY: is the folder you want your vectorstore in\nLLAMA_EMBEDDINGS_MODEL: (absolute) Path to your LlamaCpp supported embeddings model\nMODEL_PATH: Path to your GPT4All or LlamaCpp supported LLM\nMODEL_N_CTX: Maximum token limit for both embeddings and LLM models\n<\/pre><\/div>\n\n\n\n<p>Note: because of the way&nbsp;<code>langchain<\/code>&nbsp;loads the&nbsp;<code>LLAMA<\/code>&nbsp;embeddings, you need to specify the absolute path of your embeddings model binary. This means it will not work if you use a home directory shortcut (eg.&nbsp;<code>~\/<\/code>&nbsp;or&nbsp;<code>$HOME\/<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use PrivateGPT<\/h2>\n\n\n\n<p>Once you have installed PrivateGPT, you can start using it right away.<\/p>\n\n\n\n<p>To generate text, simply follow these instructions. PrivateGPT will then generate text based on your prompt. You can also translate languages, answer questions, and create interactive AI dialogues.<\/p>\n\n\n\n<p><strong>Step 1:-<\/strong> Place all of your .txt, .pdf, or .csv files in the source_documents directory.<\/p>\n\n\n\n<p><strong>Step 2:-<\/strong> Run the following command to ingest all of the data:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">python ingest.py<\/pre><\/div>\n\n\n\n<p><strong>Step 3:-<\/strong> To ask a question, run the following command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">python privateGPT.py<\/pre><\/div>\n\n\n\n<p><strong>Step 4:-<\/strong> Enter your query and wait for the answer.<\/p>\n\n\n\n<p><strong>Step 5:-<\/strong> To exit the script, type &#8220;exit&#8221;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>LangChain<\/code> is a tool that allows you to run an entire machine-learning pipeline locally, without any data leaving your environment.<\/li>\n\n\n\n<li>The <code>ingest.py<\/code> script uses <code>LangChain<\/code> tools to parse documents and create embeddings locally using <code>LlamaCppEmbeddings<\/code>. It then stores the results in a local vector database using <code>Chroma<\/code> vector store.<\/li>\n\n\n\n<li>The <code>privateGPT.py<\/code> script uses a local LLM based on <code>GPT4All-J<\/code> or <code>LlamaCpp<\/code> to understand questions and create answers. The context for the answers is extracted from the local vector store using a similarity search to locate the right piece of context from the docs.<\/li>\n\n\n\n<li>The <code>GPT4All-J<\/code> wrapper was introduced in LangChain 0.0.162.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>PrivateGPT is a powerful and secure AI language model. It is a great choice for businesses and individuals who are concerned about privacy. PrivateGPT is also very versatile and can be used for a variety of applications.<\/p>\n\n\n\n<p><strong>Here are some additional details about PrivateGPT:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PrivateGPT is based on the OpenAI GPT-3 language model, which is one of the most powerful language models in the world.<\/li>\n\n\n\n<li>PrivateGPT does not store any of your data on its servers, and it does not track your usage. This makes it a great choice for businesses and individuals who are concerned about privacy.<\/li>\n\n\n\n<li>PrivateGPT is designed to be secure. It uses a variety of security measures to protect your data, including encryption and authentication.<\/li>\n\n\n\n<li>PrivateGPT is a flexible tool. It can be used for a variety of applications, including customer service, education, and research.<\/li>\n<\/ul>\n\n\n\n<p><strong>If you are looking for a powerful and secure AI language model, then PrivateGPT is a great option.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been modified to make it more private. PrivateGPT does not store any of your data on its servers, and it does not track your usage. This makes &#8230; <a title=\"PrivateGPT: The AI Language Model That Puts You in Control of Your Data\" class=\"read-more\" href=\"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/\" aria-label=\"Read more about PrivateGPT: The AI Language Model That Puts You in Control of Your Data\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":3889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-3885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PrivateGPT: The AI Language Model That Puts You in Control of Your Data<\/title>\n<meta name=\"description\" content=\"PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PrivateGPT: The AI Language Model That Puts You in Control of Your Data\" \/>\n<meta property=\"og:description\" content=\"PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/\" \/>\n<meta property=\"og:site_name\" content=\"Edopedia\" \/>\n<meta property=\"article:author\" content=\"trulyfurqan\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-15T23:32:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-15T23:32:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"880\" \/>\n\t<meta property=\"og:image:height\" content=\"295\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Furqan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Furqan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data","description":"PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/","og_locale":"en_US","og_type":"article","og_title":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data","og_description":"PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been","og_url":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/","og_site_name":"Edopedia","article_author":"trulyfurqan","article_published_time":"2023-05-15T23:32:26+00:00","article_modified_time":"2023-05-15T23:32:27+00:00","og_image":[{"width":880,"height":295,"url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg","type":"image\/jpeg"}],"author":"Furqan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Furqan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#article","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/"},"author":{"name":"Furqan","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339"},"headline":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data","datePublished":"2023-05-15T23:32:26+00:00","dateModified":"2023-05-15T23:32:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/"},"wordCount":750,"commentCount":0,"publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/","url":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/","name":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#primaryimage"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg","datePublished":"2023-05-15T23:32:26+00:00","dateModified":"2023-05-15T23:32:27+00:00","description":"PrivateGPT is a new AI language model that is designed to be both powerful and secure. It is based on the OpenAI GPT-3 language model, but it has been","breadcrumb":{"@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#primaryimage","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2023\/05\/privategpt.jpg","width":880,"height":295,"caption":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data"},{"@type":"BreadcrumbList","@id":"https:\/\/www.edopedia.com\/blog\/privategpt-the-ai-language-model-that-puts-you-in-control-of-your-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.edopedia.com\/blog\/"},{"@type":"ListItem","position":2,"name":"PrivateGPT: The AI Language Model That Puts You in Control of Your Data"}]},{"@type":"WebSite","@id":"https:\/\/www.edopedia.com\/blog\/#website","url":"https:\/\/www.edopedia.com\/blog\/","name":"Edopedia","description":"Coding\/Programming Blog","publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.edopedia.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.edopedia.com\/blog\/#organization","name":"Edopedia","url":"https:\/\/www.edopedia.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","width":400,"height":100,"caption":"Edopedia"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339","name":"Furqan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","caption":"Furqan"},"description":"Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.","sameAs":["http:\/\/www.edopedia.com\/blog\/","trulyfurqan"],"url":"https:\/\/www.edopedia.com\/blog\/author\/furqan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/comments?post=3885"}],"version-history":[{"count":2,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3885\/revisions"}],"predecessor-version":[{"id":3888,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3885\/revisions\/3888"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media\/3889"}],"wp:attachment":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media?parent=3885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/categories?post=3885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/tags?post=3885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}