GPTLLM-DIY Free

For those of you who prefer the do-it-yourself approach, whether to save the $5 a month or just for the satisfaction of doing it on your own, this page is dedicated to you. With just a few lines of Python, you can create your own private version of essentially what I am offering here. Below is the code you can use. Feel free to copy and paste. This code is provided without warranty and may require some adjustments to library configurations to function correctly. It is released under the MIT license.

Unfortunately, the chat code is not open source. However, there are various alternatives available that you might consider. ChatGPT could assist in finding one. Alternatively, you may already have a chat project that could be revitalized and put to good use. Enjoy and happy coding!

                    
                    import os
                    import sys
                    
                    openai_key = "YourKey"
                    os.environ["OPENAI_API_KEY"] = openai_key
                    print(sys.version)
                    query = sys.argv[1]
                    print(query)
                    
                    from langchain_community.document_loaders import TextLoader
                    from langchain.indexes import VectorstoreIndexCreator
                    
                    loader = TextLoader("info.txt")
                    index = VectorstoreIndexCreator().from_loaders([loader])
                    
                    from openai import OpenAI
                    
                    client = OpenAI()
                    print(index.query(query))