hey there welcome back to AI code King recently I found out about this open-source project called defi I've been seeing that it's trending on GitHub so I thought I should cover it so let's talk about what defi is and how to use it when you see def's GitHub page you might get misguided by the terms they use like apps software and whatnot many people may start thinking that it's something that can make apps for them well that's not true at all defi is basically like Lang chain with an interactive IDE a better interface to interact
with the workflows you create and it doesn't require coding it's all graphical if you don't know what Lang chain is let me explain it to you quickly when a user gives a prompt to the llm it gives an output but what if you needed to provide some context to the llm for a rag application or what if you needed to connect it to an internet search well that can be done via some tools like Lang chain or defy they make creating such workflows Easy by letting you connect tools to your llms to create specific chatbots
or specific llm applications okay now that you've understood the basics let me tell you about its other features you can get a very greatl looking Studio through which you can create applications workflows chatbots and agents all in one place you can also create rag pipelines with it there's also the LL mops feature through which you can check logs fine-tune models and multiple other things you can also create automated agents with this you also have the backend as a service option which basically means whatever workflow or chatbot you create can be connected to your own applications
via API you also get the workflow option which is a relatively new feature through it you can create your specific workflow applications it has support for almost all of the llm providers this is an open-source project and it can be self-hosted but they also have a website where you can use it without self-hosting to use their website you have three plans the first one is the free plan through which you can send up to 200 messages for free to gp4 but you also have other limitations in this plan like storage and whatnot so I'll be
getting it set up locally okay so let's start the setup process first open their GitHub repo then clone it on your computer once cloned CD into the cloned folder fer then go back to the GitHub page scroll down and you'll see this quick start section go ahead and copy the First Command then run the second command remember this requires you to have Docker installed so make sure you have that anyway run this command and it will start getting installed after it gets installed go ahead and open Local Host on your browser once you open it
you'll see this screen you'll be asked to sign in but we don't have credentials yet so go ahead and click on this link and create an account once done go ahead and sign in after you're signed in you'll see the screen here you can see the options it has you have the chatbot agent and workflow options you also have the explore option here where you can find Community created workflows and apps you can just use any of them which suits you or you can also create one from scratch let's first try running a pre-existing app
I'll be choosing this SEO article generator here click on it and then click the create button now go back to the studio page and here you'll find the app we just created now click on it as you can see it's asking us to set up the llm provider here go ahead and click on on the go to settings option here you have multiple options of llm providers let's set it up with AMA for 100% local access if you don't have aama installed go to Al llama's website and get it installed from there now here we
are asked to enter the model we want to use I'll be using llama 3 so I'll enter that then it'll ask you for the API base URL I'm using it on Local Host and a llama generally works on Port 11434 so I'll enter this URL now it will ask for the max context llama 3 allows 8K context so I'll enter that here once done click on the save button now the model will be added now close this and select the new model over here okay now enter the keywords you want to generate the article about
and hit run okay it works so this is how you can get the pre-made template working now let's try creating our own workflow to create our own workflow click on the studio option then click on the create from blank option now you have four options here the first one is chatbot the second one is text generator the third one is Agent and and the final fourth one is workflow I'll be using the workflow option here now enter the app name and description and hit the create button I'll be creating an SEO article generator so I'll
enter that now you'll see a drag and drop flow like interface here you can see our start node now in the start we need to take a custom input from the user so go over here and add a new input Vari variable and enter its label and max length once done come back and click on the plus button here now you can add multiple nodes over here if you want to connect it to an llm you can do that or maybe if you want to do a Google search you can do that or you can
connect this node to anything you like it has multiple options you can even add a custom code option here to run your Python scripts pretty cool I'll be making a simple SEO generator so I'll add an llm here now select the model here and in the context choose the variable we just created in the start node in my case it's the title variable now enter the system prompt here about what needs to be prompted to the system I have prompted it to write an SEO friendly article about the topic variable here to add a variable
use curly braces and add the variable here now that's done add an end node here and in the output select the llm text message output now let's run it enter the variable data here and hit enter okay it's getting generated pretty cool so that's how you can create a workflow for your specific use case in defy you can also publish the app from here which can be used by anyone with the link through through their interface you can also use it with an API which is really great if you want to connect it to your
custom applications you also have some other tabs here like knowledge in this tab you can add your custom knowledge here which can be referenced in your workflows and chat Bots you can also use the tools option to integrate your custom tools and whatnot I think it is a really great option to create your own AI work flows apps and just custom tools to integrate into your applications across the board you can easily configure test and check your workflows pretty cool I really like this one let me know if you'll be using it too in the
comments also if you liked this video consider donating to the channel by using the super thanks button below this video also give this video a thumbs up and subscribe to my channel I'll see you in the next video till then bye