-2

I am currently exploring LangChain and find it really useful to contextualize LLMs for an enterprise and use it to build AI powered bots or solve common problems related to support or any process for a given enterprise.

However, I am not finding any good documentation on data privacy. Does anyone know if LangChain would upload all data to LLM vendor server if I have to use it's capabilities to build question and answer bot for my company's processes and confidential documents?

Here is code snippet on how I am using it -

import os
import sys
from langchain import PromptTemplate
from langchain.chains import RetrievalQA

from langchain.llms import OpenAI

os.environ["OPENAI_API_KEY"] = ""

llm = OpenAI(temperature=0.9)  # model_name="text-davinci-003"

from langchain.document_loaders import TextLoader

# loader = TextLoader('state_of_the_union.txt', encoding='utf8')


loader = TextLoader('The_Chronology_of_Puranic_Kings_and_Rigv.txt', encoding='utf8')

from langchain.indexes import VectorstoreIndexCreator

index = VectorstoreIndexCreator().from_loaders([loader])

# query = "What did the president say about Ketanji Brown Jackson"
# query = "How much time elapsed from the beginning to the end of the Nanda dynasty"
# query = "When did MahÀpadma Nanda came to power"


for line in sys.stdin:
    if 'q' == line.rstrip():
        break
    print(f'Input : {line}')
    print(index.query(line))

print("Exit")

Will LangChain upload whole data ["The_Chronology_of_Puranic_Kings_and_Rigv.txt"] to openai in this case?

Kiran Pawar
  • 79
  • 1
  • 8
  • I'm not familiar with LangChain, but does the inference happen on your computer or on OpenAI's? I'm guessing it's the latter but answer this question and you have your answer. – Riwen Apr 20 '23 at 18:37
  • Thanks, but actually I saw LangChain posting data to OpenAI server for making an inference in the logs so wanted to hear from community. – Kiran Pawar Apr 25 '23 at 12:26

1 Answers1

-1

I added logging and saw that Langchain was posting contents from the referred doc to openai server. So consumers of lLangchain needs to be careful while using LangChain. One may end up posting critical details to external systems.

Kiran Pawar
  • 79
  • 1
  • 8