CrewAI: AI-Powered Blogging Agents using LM Studio, Ollama, JanAI & TextGen

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is amazing using crew AI now we can create multi-agents with completely open- Source large language models you are able to create a group of agents to create a blog post and it'll be running locally on your computer not only that for each agent we are able to use different tools such as LM Studio Jan AI olama text gen web Bui completely local on your computer that's exactly what we're going to see today let's get [Music] started hi everyone I'm really excited to show you about blog post agent which is a use case for crew AI we are going to integrate multiple open source launch language model using many different tools I'm going to take you through step by step on how to do this but before that I regularly create videos in regards to Artificial Intelligence on my YouTube channel so do subscribe and click the Bell icon to stay tuned make sure you click the like button so this video can be useful for many people like you I've already covered beginners tutorial in regards to crew AI which I will link that in the description below first make sure you install Lang chain Community Lang chain crew AI Lang chain open Ai and then click enter next pip install Doug duug go search and then click enter now let's create a file called app.py and then let's open it inside the file from crew AI import agent task crew and process next from L chain openai import chat open AI next from L chain community import o Lama next from L chain Community tools import dugdug go search Run next we are going to initialize the Search tool now we are going to Define our first log language model using LM studio so we're going to initiate the function chat open Ai and then Define the open AI base as the URL and the port number 1 23/ V1 which we can find from LM studio in your LM Studio make sure you download the required model and then go to the local server icon and click it then choose the model you want to use I'm going to use zifer then click the start server button make sure you provide enough context length so that it is able to generate block posst now we got the URL here this is the URL which I'm entering there in open API base I'm going to use ziper model now let's create Jan AI integration here we going to provide this URL and this model here is the Jan a application running I can see the active model is myal quantization 4 which I can see from the system monitor make sure you enable your API key from this enable API server icon next we're going to initiate AMA and I'm going to run art 2 model make sure you run AMA run art 2 to download The Lodge language model next we are going to add one more tool which is text generation web Bui I'm going to use the same function chat open Ai and then provide the base API URL which is this so I'm in text generation webui folder there I'm going to start the server by using bash start Mac .h and then click enter now this is going to load and you can see the API base here and Al the portal URL is here I'm going to navigate to this portal URL here is the text generation webui I entered the open hermis model and downloaded the model then I refresh the icon and then click the open hermis model and then click load to load the model now I can see successfully loaded now we have added four tools with four different large language models this is powerful how already covered LM Studio Jan aai olama and text generation webui beginners tutorial which I will link those in the description below now we have initiated all these tools now we're going to create agents first is a researcher agent it is going to research using LM studio llm and the Search tool which it's going to use is dugdug go search so it can go and search the internet next the Insight researcher agent it is going to find key insights from the data provided by the researcher agent next the writer agent to write the content based on the insights it is using olama next the format agent to format the incoming text into mckown this can be used in various different tools such as WordPress now we have completed the agent creation task finally we are going to assign task to each individual agent first is the research task is to identify the next big Trend in AI by searching the internet next Insight task to find key insights from the data then the right task to write a blog post on the findings finally the format task format the text in markdown now I'm going to instantiate a crew tech crew with the crew function providing the list of agents and the list of tasks the process sequential and then closing the bracket next we are going to begin the task execution check underscore crew. kickoff we're going to save that in the result variable and print the result that's it as a quick summary we integrated four different tools such as LM Studio J AI ol and tex gen webui all of the four tools running different large language model completely locally on my computer I'm using M2 with 32 GB of RAM then we are creating four agents one to research then find the Insight from the research third write the content for the research and finally format the research article into a blog post next we are going to run the tech crew and making it all work together and printing the results now I'm going to run the code in your terminal Python app.py and then click enter now I can see it's entering new crew agent executor chain and it's going to search using dugdug go search you can see the LM Studio logs that the response is getting generated you can monitor the status from Jan AI the amount of RAM usage CPU usage you can see text generation webbii log that a request has come through I can see the zipper model and the myal model worked fine when come coming to Oka model it is finding some difficulty in creating the blog article so I'm going to change the Oka 2 model in olama and change that to mistal now I'm going to run the code again seems like it's looping here do I need to use a tool yes and then it's not providing relevant information this is normal in open source Lodge language model and also I'm using a quantied version I'm going to fine tune the instruction further I'm going to say don't use any tool similarly I'm going to use say don't use any going to run this again I can see it's properly searching the internet using du go next is going to the next agent and the next agent and finally the format and then I got information like this I can see half of the information got lost when it was passed through agents the main reason behind this is not because of the fault in our integration our integration everything working fine which we can see from the log but it's because of the open source lunch language model and also it's because of the quantized version which we are using so if you use unan Contex version and properly choose your launch language model and also have a proper prompt then it's going to work as simple as that the integration of Open Source lunch language model one final thing which we are going to try what is going to happen if we use open AI in this scenario let's see I'm going to remove the llm from the formatter from the writer and from the researcher now I'm going to go to the terminal I'm going to export my open a API key like this and then click enter next Python appp and then click enter it is searching the internet using dougd go search it is passing to the next agent with the key insights it's very clear next is passing to the writer to create a blog and I can see an very decent blog here next that is passed to the formatter to format and finally here is the formatted version with hash as heading in markdown and you can just copy this content and then paste it in WordPress or any content management system this output is very clear so with your open source make sure it's unquantized try different models and also do prompt engineering that's it I'm going to create more videos similar to this so stay tuned I hope you like this video do like share and subscribe and thanks for watching
Info
Channel: Mervin Praison
Views: 8,784
Rating: undefined out of 5
Keywords: crewai, ai, crew ai, agents, ai agents, autonomous agents, ai agent, autogen local, auto ai, crew, open source, open source agents, open source llm agents, llm agents, crewai lm studio, crewai ollama, crewai textgen web ui, crewai text generation web ui, lm studio, lmstudio, janai, crewai janai, crewai lmstudio, crew ai ollama, crew ai text generation web ui, crew ai janai, jan ai, jan, local, crewai local, crew ai local, crew ai private, crewai private, crewai local llm
Id: fnchsJd9pfE
Channel Id: undefined
Length: 8min 14sec (494 seconds)
Published: Mon Jan 15 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.