FREE: Self-Host Dify AI - RAG AI AGENTS! (Coolify & Traefik)š¤ Drag-N-Drop FlowiseAI Alternativeā”
Links from the video
- langgenius/difygithub.com/langgenius/dify/
- coolify.iocoolify.io/
- doc.traefik.io/traefikdoc.traefik.io/traefik/
- APP_API_URLdify.api.app.yourdomain.com
- APP_WEB_URLdify.yourdomain.com
- CONSOLE_API_URLdify.console.api.yourdomain.com
- CONSOLE_WEB_URLdify.console.yourdomain.com
- SERVICE_API_URLdify.api.yourdomain.com
- 'dify.console.yourdomain.com'
- 'dify.yourdomain.com'
- 'dify.console.api.yourdomain.com'
- 'dify.api.yourdomain.com'
Transcript
5,304 wordsWhat's going on everybody Josh pook here and in today's video we are going to be taking a look at iffy or D FY Ai and this is a crazy tool guys if you're familiar with tools like flow wise AI where you can build llm apps easily using open source low code tool for developers this is very similar if not even better this is something that has been very very hot on GitHub um you know Diffy is an open-source llm app development
Platform orchestrate llm llm apps from Agents to complex AI workflows with an rag engine all right super super powerful stuff guys rag engine Pro uh prompt IDE Enterprise llm Ops fast solution llm agent workflow guys this going to be a good one let's and not only this I'm I'm going to show you how you can install it regularly or how I personally installed it using kify which is a versel alternative if you've been a fan of this Channel or from following
This channel you'll know about coolify I'll show you how to set it up too we're going to dive into all of that and how to specifically configure it using uh traffic because if he uh out of box is using engine X um so we going to have to do some uh changing things around to accommodate for traffic running on kify if you're doing it that way we're going to dive into all of that in this video Let's Dive Right [Music] In
All right guys so here is the diff defi uh website right here and it is really cool um but yeah you can check it out link will be in the description and you can see end to end AI workflows build autonomous agents and it the UI first of all is really really nice like this looks like a really nice tool you can see the all the Integrations got o llama llama 2 um Gemini Gemma open AI hugging face aure um anthropic
You know all the big players and there is a pricing page if you want to use their self or their they're hosted they're cloud based and you can see the pricing here which I mean it's probably I mean it's a really great tool I just personally wouldn't I wouldn't pay this myself because I I'm self-hosting it right that's what I'm going to show you in this video I mean for some reason you want to use this you could but um yeah
We're going to dive into self hosting where it's completely free and um yeah you don't have to worry about these limitations because these all also have limitations right so let's take a look at their GitHub so this is the GitHub right here and the Innovation engine for Gen applications introducing Diffy workflow to kind of show you I don't know if this has sound or not but um okay it's not loading we'll we'll show you in just a second once we actually
Install this thing so you can see here now this is really cool right um well this feature chart obviously they're you know biased because it's their own app but we can kind of see at least from what they're saying why it's better than things like flow wise and Lang Chang and open AI assistance API so programming approach API and app oriented so that's actually really good I like that um and Lang chain python code flow wise just app oriented I like
How this also has API and then wow I'm actually really excited to start building on this app uh this is one that I've been was actually really excited to start using so you guys know and I was having some issues installing it and you this could help you if you're running into issues installing it because there are this isn't just like an easy install per se if you're if you're using coolify or something like that you could run into issues but
Other than that it's pretty easy it's going to be easy for you because I'm just if you were going to encounter any issues I'm going to show you what to do uh we got a rag engine built in agent workflow okay so flow wise I think they just added agents so that's may not be accurate um workflow uh okay so observability uh Enterprise SSL access control then local deployment so you can just see some more information here get will be in
The description down below so you can check that out and you can see it's definitely taken off it blew up uh it ble this is not like years this is months so oh no no no this is uh 2024 so yeah it's a blew up very quick um and anyways so that is uh their GitHub this is flow wise by the way I've covered it on this channel if you want to check it out um how to install flow wise I've
Covered videos on that but like I said this is this is a similar tool except it seems like it's from what they're saying it's a bit of an upgrade um what we'll have to see right anyways so if you're not familiar with coolify this is what we're I'm going to be showing you how to self-hosted on I'm also going to share with you how to host selfhosted if you're just not using coolify but for those of you who are um or
You want to if you don't already have it you can just go to cool fly.io I'll leave a link in the description click on selfhosted and I have a video many videos on coolify you can check them out but you just run this command and coolify will start um we'll install Okay coolify versell alternative Heroku alternative uh netlify alternative all right so that is defi flow wise I'm just closing out some of these tabs here so we can get through all
This info because um yeah there's a few things we need to cover and make sure so here in their GitHub basically what you're going to do to install this let's start installing this now so we go to projects so if you're in kify um you're just going to click add you're going to add a new project and um I'm not going to here just for the sake of this for time I'm just going to go into this project so you're going
To create a new resource and what you're going to do is public repository okay and you'll see here they actually have a quick install guide right here quick start and they have some minimum requirements so two uh two core CPU 4 GB of RAM and I will say this is a definitely not on the light side of uh apps that you would run all right even as I was setting it up with within coolify like within here this is like the
One app that I've been setting up so far at least I mean maybe there'll be more obviously in the future but this is like one of the first ones where it's actually been pretty like not slow like where it's bad like super bad but it's it's definitely lagging a bit just because there's so much in here like you'll see from the en environment variables even alone that there is you know a lot of environment variables and you'll see there's a lot
Of stuff going on in the docker composed there's multiple containers um so yeah but if you're not using coolify you can just do um so let's just go just go to um where are we actually I'll just to make things easy let's go here back to D Diffy and then they docks so if you're not using coolify then all you do is go to the dogs Link in the description and going to go to Community Edition I'll leave this link directly
There and then Docker compose deployment all right and simply put all you're going to do is get clone this resource and then you're going to start Diffy so you're going to CD into Diffy Docker um that's where the docker compose file is then you're going to copy the Environ variable example into an environment variable and then you're going to run Docker compose up D and then it's going to deploy make sure they're all started and created you're going to see that
It's using engins right here or engine X we're not going to be using that on kify and I'm going to show you how to remove that and make sure it all works with traffic and then once you're done that you're good to go you can do Docker compose PS to see your container and you should have them running and uh then you can upgrade ify there right so it's a little bit more a little bit simpler if you're doing it that
Way um but it's still fairly simple the way I'm going to show you um especially now that you're going to I'm going to give you the copy and paste um code all right so what you're going to do is you're going to want to Fork the the whole entire project and the only thing I changed in the docker compose of the fork which well the docker compose is the only thing I'm going to change or that that you're going to change
That's the only thing I changed and the only thing you're going to change in it is you're just basically going to remove um the container if I go to Docker here and then go to Docker compose yaml we are going to remove so you can see it's a big file here and we got sandbox we got reddish this right here you're going to remove the SF so you can just search for these things so the things you would want to search
For is SF ssf ssrf proxy and you're going to delete this container you're going to delete anything basically surrounding SF ssrf proxy Network you're going to delete that Network here uh uh actually yeah you can um I'm not really the sandbox thing there you may want to add a different network there but anyways the I mean that's I'm not even really like it's not that important to use it unless you really want to but anyways let's just see so yeah you
Would honestly just go through delete all all the yeah delete the proxy so you don't need these two proxies right here and what else worker yeah delete the network okay and then delete these variables up here and yeah you're just deleting anything basically with the word proxy or ssrf and if it's under like uh the container um you would you would delete the full container for the ssrf proxy and for under networks you can delete this okay but I think you
Get the gist once you do that um you're going to be left with something that's looks like this it's just basically the exact same thing I just deleted all the proxy stuff and the I basically deleted the proxy variables um at the top for the environment uh and then I also delete those obviously in the environment Ables well that a it autop populates once you do that uh and then you're just deleting the container and any reference to that container or
The network all right very simple once you done once you're done that that's all you're going to have to do pretty much for customizing you're going to have to do a bit more but I'm going to give you the exact code once you're done that we're going to go over to coolify so you already should have your um project set up so where we here right here so this is where you're going to paste that repo so you're going to grab
That repo URL and paste in the link right here and check repository once you do that I'm not going to do it because um I already have it and it's going to look like this once you get in so what you're going to do is I'm going to leave this in the description down below so these are the files you need let me see here so within the environment variables the only thing you really need to customize are these right here
So app API URL app web URL console API URL console web URL service API URL init password security key uh web API core allow Origins and then and console core allow Origins all right so you're going to need one two three four five uh subdomains pointing at your server okay um I mean you may be able to do it some other way but this is the way this is actually the way that you want to do it okay so you can
Put the the subdomains to whatever you want you can see like this is like a Sub Sub sub doain this is like a subdomain right here Diffy doy domain Diffy a api. apppp your domain dy. console. API your domain dy. console doyou domain dy. API doyou domain then you can put for the init password just whatever password this going to be the admin password when you actually uh get it set up it's the initialization password secret key um you could hash
This if you want but yeah that whatever just goes here and then web a API cores allow Origins that will be these right here um now for these this is basically so once we actually deploy it um it's going to use cores and you're going to have to set these uh this up in traffic to ensure that um you're that that they're working properly if you don't know what cores are stands for cross origin resource sharing it's basically a form of
Security um so yeah that's for the environment variables okay we're also going to let's see this is the compose we're also going to create a dynamic configur uh configuration or config configuration within your server so you're just going to click on your server then you're going to select your local host or whatever server you're using then you're going to click on proxy all right then you're going to add a dynamic configuration right and we can I just call it uh kors-y.
Yo you can call it whatever okay but you're going to paste in this this all right and this is in the description so you don't have to do all the hard work in figuring this out but I'll try to explain to you some to some degree what it's doing um I'm not going to go so so in depth but yeah we're using some middle Wares here this is like basically all just traffic stuff uh mostly we're sending the headers right here
Control allow origin list and then boom those those uh domains here so you're going to need to change the domains so there's only the only things you're going to need to change are the domains here and throughout everywhere else and then get access control method so we're allowing get options put post deletes for the API and then Access Control headers content and authorization allow credentials true control max age 100 and then Diffy console API and then boom boom middleware cores DS
Uh tlser let's encrypt ify web here middleware cores insert revolver resolver let's encrypt if you and if you don't know like what any of this is it's okay you don't really need to um I'm just kind of explaining it a little bit then you should probably start learning a bit more about traffic if you're using coolify I did a video on it the other day so you can check that out um and I'll do more as well but start start reading
Uh some of the docks and stuff get getting used to what these are like middle Wares and all that because if you're configuring a lot of apps you're going to have to kind of know a bit when it comes to coolify and traffic and stuff uh and it's good to know anyways so and then yeah load balancer server so yeah the only thing you need to change is these domains and then the last thing you need to change is the IPS
Here um so all you do to get those IPS is you just use this command which will be in the description down below you're logged into your server you run Docker PS and then this command it's going to tell you the name of the um your Docker container and then the IP addresses for that Docker container you're going to want to look for the web uh the web Docker container and the API Docker container one or one of them may have
Like two IPS beside it but just grab you can grab the first one if you have issues figuring out what is which just ask AI chat gbt or Claude but you just run this command you'll see web it it will it will say something different like than this but this is the web the new container you just spawn up once you deploy it um and then this is for the API and that's for Dy and you get those um those IPS
And you just put them here you're going to want to keep the same ports all right those are the same ports this is the port for the web server and then this is the port for the API okay once you do that you just upload to your config you save all right once you save stuff with your proxy you're always going to have to restart it but in order to get those IPS you would need to have deployed it already so
Now that we got that next thing is the uh your traffic configuration so let me just okay now this you don't need to like completely copy this config file especially if you've already done configurations um because you'll you'll you know lose those ones but so you don't need every single thing in here a few things I'll just like your your your default config file will look pretty similar but there's basically a few different lines so the way traffic works is lots
Of times when you just need to do certain things you can add either command or labels mostly so these labels right here a lot of these are actually just like this is related to your traffic dashboard and getting that set up I'm not going to cover how to set all that up but I mean if you just copy this it will actually just set it up I mean okay well if if you want me to quickly cover it uh all you
Do is you yeah you just copy all this put it in and then when you go to your you have to go to for SL dash Ford forward slash and you must do the money the the dollar uh the pound sign like that okay that's in when in your url once you actually get this config file that's just for your traffic dashboard that's not related to Diffy okay but the main thing for Diffy here is we're just making sure that the
C certificate result s are let en cryp Acme uh HTTP challenge this this that Etc and then yeah you can conf configure your traffic domain here let's encrypt resolver for dashboard and load balancer 8080 um this is this right here is if you're using the the traffic dashboard you want to Hash this password this is like a dummy password but this is what your cuz that's what your admin and cuz the dashboard has authentification so yeah um but yeah and then
There's more labels here boom all right so I'm just trying to cover like just briefly show you what the labels are even though I'm giving you the exact copy and paste thing but just so you kind of know because it's good to still know how it's actually working under the hood a bit right and yeah if you have any issues or if you have any questions or you need to do a bit of customization just ask AI give what I'm giving
You to Ai and you'll be good to go this is this works out of box though okay you're going to paste that in here and then you're going to save and then you're going to restart your proxy um okay so you should have already deployed your server and you just restart the proxy and then yeah so you just to recap you have your Dynamic configuration you have your configuration for traffic right here and then you updated your environment variables with your
Domains so you need to have five subdomains or sub subdomains pointing at your server IP address so make sure you already did that in your Cloud flare in your name CH whatever and and then basically what we did in the configurations is we're allowing chords pores for those websites and all that good stuff because an issue you may face which I faced uh is once I actually got Diffy up all right up and I had the main website loaded and it
It's like here this is what it looked like um me just show you once you actually deploy it going to look something like this this actually the second page setting up an admin account there's going to be a first page and it's going to be login and then below the login it's going to say like create admin account something like that it's going to be like in Blu text like this you just click that then it's going to take to this
But if you don't do the the configuration right with traffic then it's going to be on a continuous loading page all right so you may who knows you may still run into issues whatever the case may be if you do um one thing you can do is inspect element and look in your console see if there's any issues all right see if there's any issues when it's uh when the when the uh admin account is loading because what I was seeing
Was I was seeing an API request was trying to be sent to the back end so basically what we're doing but it wasn't able to connect right so basically what we did in the uh this right here the dynamic configuration we're connecting the backend API service IP we're connecting that with the front end all right so they can like sync and go back and for each other and then we're also allowing cores all right once you do all that and you
Just copy and paste do exactly that you should be good to go from that point on now we're in Diffy all right um I'm trying to think if there's any other any other thing issue you may encounter um okay so you can inspect you can check if you are encountering issues check console and check Network all right check for the stuff that's loading and you just see the error click on it look at the HT PP request like if it's allowing
You to do get or post or or um whatever and you can see the API but you shouldn't run into any issues so especially if you just follow this tutorial you should be good right but who knows there if you're using specific setup bugs can always come about or maybe you're watching this in the future so just giving you some tools to potentially troubleshoot all right because Diffy has a lot of containers and it's a pretty intensive tool so that's what
I um what's making me very excited about it because I see how intensive it kind of is with the setup and all this and the tools and the UI and it it's um making me very excited right so let's just quickly cover um some of the basics of divy now that we have it installed and deployed and I'll show you a little bit about it and then I'm going to make future videos actually like building cool things out right but once
You have your account set up um we have four options at the top we have explore so this is all the divy Diffy apps all right so or the Diffy app templates so you can see recommended agent assistant HR programming workflow writing Etc um some of the top ones right here workflow planning assistant question classifier knowledge chatbot knowledge retrieval plus chatbot automated email reply text summarization workflow customer review analysis workflow sentiment analysis invents investment analysis report SAS startup Mentor AI front-end
Interviewer code converter right you know you get the point um next is studio so this is where you're going to build things out right we can either build from a blank create from template or import DSL file all right X is chatbot same thing well these are this is all and then you can filter either by your chat Bots agents or workflows right right and I'll show you a bit about the Builder in just a second knowledge so this is where
Obviously you can have your knowledge so import your own text or write data in real time by a web hook or L for llm context enhancement so this is really cool we can just click here and create data sets like this is super super powerful and also too guys if you're using notion you can sync with notion you're going to have to um you may have to do a few extra steps here I believe I haven't done this yet but you
May have to if you're doing certain things I know there's a part uh you can check the docks there you have some uh section on notion variables Etc you may have to add in the environment section tools um yeah so here's different tools built in custom and workflow so Yahoo finance web scraper wow code interpreter GitHub ding talk right bunch of different ones twio fir crawl Brave really cool um search API so those are the some built-in ones you can create
Custom tools and then workflows we don't have any workflows right now all right so let's go ahead and just do some testing here let's create a template and we can just use this one right here question classifier knowledge catbot we'll create that and now we see it right here we can go inside the Builder and boom this kind of looks a little bit like flow wise but honestly I just really like the UI of Diffy because it it's very um very
Modern um and yeah it's just it looks a lot Slicker and cleaner to be honest and it looks a little bit more like expensive like it would be an expensive tool um orchestrate API access log wow so Advanced AI uh chat AI so we can literally see wow this is super super cool okay boom we can see our logs and announ annotations right here wow total messages active users average session this is pretty crazy stuff all right so you can see
Here start Define the initial parameters for launching your workflow so you can change some of this input Fields queries system files conversation ID user ID um question classifier input variables we can change Models All right we would actually have to add models first I believe and then knowledge retrieval llm Etc so yeah I'm going to play around with this more uh you know in the next couple days guys so I can actually get a feel of building stuff with Diffy since
I'm new to Diffy but I'm very very excited but I'm just kind of giving you guys over the shoulder just my reaction to seeing some of these features you can do HTTP get requests or well any requests here right and then we can play wow this is just awesome um and publish update run app embed into site yeah this is like I mean I haven't fully Dove deep into Diffy as well as even flow wise as much as I want to
I've used flow wise Etc but I haven't fully dove into it as much as I planned on um to really get a really good feel for it but just off of my initial Impressions like I I would lean more towards Diffy just in terms of uh what I see so far but I mean not to fly count out flow wise um but yeah this is just really really clean um I'll have to full like I said before I come to a
Complete you know um sensus consensus I'll have to really see play around but I think Diffy just has so many things that I I didn't see with flowise but we'll have to we'll have to see but if you've used both of them let me know which tool you prefer down below or what tool you're excited to use um whether it's Diffy or flow wise and yeah guys I hope this helped you out install Diffy and get started with Diffy and now
You can actually take this start using it build out your knowledge base build your tools you know build out cool workflows you know and uh you have API access to them you can embed them there's a lot of cool stuff you can do here the possibilities are endless AI is getting crazier and crazier guys so if you uh are into this type of stuff open source AI automation workflows nadn make.com whatever the case may be we upload videos every single day
On this channel on how to do just that you're entrepreneur marketer business AI Tech person Enthusiast whatever the case may be um welcome to the channel if you're new here and yeah if you did get some value from this you know uh drop a like drop a subscri uh subscription to stay up to date with the daily content and then also too guys if you're new to the channel you haven't already joined our free community strid community.com it's 100% free so
You can just get free Extra Value in there you know anything that I find that I don't post on YouTube I put in the stride Comm Community as well as you can just network with like-minded individuals like myself other marketers business owners salespeople coaches Consultants you know AI um AI Engineers whatever right a lot of cool people in there so check that out it's 100% free stri community.com and then other than that guys if you have any questions or you encounter
Any issues with this install let me know in the comments down below but I will see you in tomorrow's video Keep hustling keep grinding and of course guys accelerate your stride take care