Build your own LLM Apps with LangChain & GPT-Index

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey friends welcome to one little coder are you excited about the large language model space or the generative AI space that is really heating up like with tools like gpt3 chat GPT everybody has been talking about it and then everybody wants to incorporate these tools inside their own application for example a couple of days back Bing announced Microsoft Bing the search engine announced that they are going to include chat GPT per or charge GPT or charge GPT like functionality within their search interface and this is becoming a growing Trend with every company wanting to include a large language model inside their tool to enhance their search capability and lot more other things if you wanted to use these kind of tools for your own application or if you wanted to build a brand new application on top of large language models I'm going to tell you about two important open source libraries that can help you make your life really really easy to do this thing why this is important why how these live libraries can make a difference that's exactly what we are going to discuss in this video let's get started the first thing is the first library's name is Lang chain Lang chain Lang chain I don't know how do you pronounce it it's it's it's Lang chain so Lang chain is saying that they are going to help you in building applications with llms large language models through composability let's let's say what does it mean it means the word chain here helps you change things for example let's say you have you want to build a large language model based document retrieval application or a search semantic Search application typically what you would need to do is you need to handle the context with which the model GPT model can handle like for example if you have got a prompt it has certain limitation about how much text it can take it as prompt and then it can give a result but if you want to go beyond that and if you want you know Supply your own Corpus of data and then you want the large language model to do let's say question and answering chatbot similarity search and lot of these things then that is exactly when you need to use Lang chain because Lang chain is going to make your life a lot easier one second it has got a lot of connectors like you can connect with open AI APA you can connect with certain hugging face models you can connect with Solutions like sentence Transformers but again Lang chain also has got the ability for you to scale it up as a proper software engine like software application and that's what Lang chain says what is this a large language models are emerging as transformative technology this library is aimed at assisting in the development of those kind of applications where instead of just using a large language model as a vanilla large language model what if you can supply your knowledge your text your Corpus that extra addendum extra layer if you want to add and that is exactly where a library like a long chain helps you some examples what you can do with the land chain you can build a question and answering application for a certain type of document let's say you've got your internal knowledge base in your company and you want to use that to build a search engine for your own employees you can use long chain you want to build a chatbot you can use land chain you want agents like what AI Bots you can use long chain and their documentation is really good if you click here you can see how you know long chain can help you they've got good details and the details for primarily in the modules like if you see the modules you can see they've got prompt templates you've got language models like connectors and they've got document loaders they've got certain utilities and one important thing is they've got this chains how you know you can combine things like more like pipes and these are certain things that you can do with long lung chain and you can also see a lot of examples here let me know in the comment section if you actually like to see a Hands-On tutorial about using long chain to build one of the tool one of the applications like let's say question and answering for your custom text I'm very happy to do that so this is primarily Lang chain and there are a lot of lot of information here like what is a chain what is a large language model prompt all this information you can actually read for yourself but I I just wanted to give you an introduction about how long chain can make a difference in your own workflow now now you might think hey I this is all well and good but I don't want to just simply use launcher I want something slightly easier than land chain uh slightly uh easy for me to use like maybe or not like a very good software engineer or you don't have that much time to explore a very comprehensive Library like language what if you got something like let's say like streamlit or radio what it is doing in the world of web application development for data applications what if you want something like that on top of launching that's exactly what we are going to talk about next which is GPT index GPT index is currently exploring a new name so maybe while you are watching this video in the future maybe this is not going to be named GPT index I don't know right now they're exploring different names just to not have any lawsuit from open a probably in the future but right now it's called GPD index it's again an open source project this project is actually from Jerry Liu it's a very interesting project by uh large like a lot of internals of GPT index uses Lang change so that's something for you to note and also for stock knowledge now what is GPT index GPT index is a project it has got certain data structures for you to use external knowledge base together with language models so you've got vanilla language models like let's say GPT 3 GPT 3.5 instruct GPT and then you've got your own Text corpus like your your knowledge base now what if you need to combine these two we just saw that we can use land chain but you don't you don't need sophistication you don't need a lot of things then you can actually use GPT index that can help you do it in like very easily now at its core GPT index contains a toolkit of index structures that's designed to easily connect with large language models with your external data and what kind of things that GPD index can help you with one of the biggest concern with the large language model is the prompt size every large language model comes with its own context space and if you go beyond that sometimes it might ignore it sometimes it might not use it you can handle that with GPT index next abstract your common usage patterns um like you you don't have to code everything the next thing is provide data connectors to common sources like for example you've got Google documents and you've got like slack messages so those kind of things you can connect it and then there is like a transparency um like tool transparency how you can reduce cost one of the things that you need to remember with the tools like open AI is they're all token based costing so it's very important for you to optimize your cost when you are using these kind of tools and GPD index says like they can help you with that what kind of things that you can build with GPT index you can build question and answering summary summarization solution text generation solution like email generation tweet generation blog post Generation all those things and then you have got a really good documentation it's quite easy to use the documentation is very good and you've got certain certain easy get started solutions that are easily available and it also tells you like how you can do use it with land chain how use you can use it with some other embedding Solutions and all these things are available and if you actually see an example it's quite simple so you can simply see this code um it's just initialize your openai key and then you can load the data and then you have got the index save the index anytime you want retrieve it and start asking questions from the index it's quite simple I wouldn't say very simple but it's quite good and I think if you are let's say if you're exploring a startup solution if you're exploring your own product solution I think today using GPT index or Lan chain could be effective for you to reduce technical debt for you to do a lot of things easily if you do not know the right way if you do not know the best way to do it I think these libraries give you really good Solutions and tools and utilities that can help you make a really good large language model solution web application whatever you want to do and you can see like on the internet a lot of people have been already developing Solutions like this using Lang chain and GPT index so that's why I actually make wanted to make this video this is not a typical video that I would usually make like it's not a Hands-On tutorial but still I wanted to quickly introduce these two libraries Lang chain and GPT index both are open source like that's that's another good thing both on open source you can you can you can use it for free and then build your own large language model application that can be robust scalable quite good and Deployable so if that is what you wanted to do definitely check out Lang chain and GPT index let me know in the comment section what you think about this kind of video format but I don't necessarily code but it's a short video I explain you something interesting and that can help you in building something new in AI generative AI space I hope this was helpful to you if you have any question let me know in the comment section otherwise these two links will be in the YouTube description definitely check it out see in the next video peace
Info
Channel: 1littlecoder
Views: 18,722
Rating: undefined out of 5
Keywords:
Id: -75p09zFUJY
Channel Id: undefined
Length: 9min 36sec (576 seconds)
Published: Thu Feb 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.