what is going on guys welcome back in this video today I want to talk about a fascinating tool called GPT engineer and it is basically like chat GPT the only difference being instead of getting an answer to your question it implements a full project for you so it can work on multiple files it can create directories it can execute scripts and is thus more powerful than just you know getting a response copy pasting stuff and then uh yeah trying to build it on your own it implements the full project for you or it can also
improve existing projects so let's get right into [Music] it all right so we're going to take a quick look at GPT engineer in this video today and it's going to be a sort of blind exploration I haven't played around with this tool too much I played around with it a little bit and the results were on the one hand quite interesting because it does something that usually large language models don't do but it's also not too overwhelming it's kind of underwhelming I would say because when you get more complex prompts it doesn't perform that well
so I don't want to hype this one but I think it's quite interesting to look at because GPT engineer can create full projects for you it creates a directory structure it creates multiple files it creates a runscript uh and all that and you don't need to copy paste Snippets it doesn't just give you autoc completion or individual functions or individual files it gives you a full project and it does work if you don't get too complex but it doesn't work that well when you get more complex so let us just take a look at it
we're going to start by installing it and in order to install it all we need to do is we need to say pip or pip 3 install GPT D engineer and GPT engineer is a toolkit or a framework that requires a large language model to work with so it's not an AI itself it doesn't have any uh model in an off itself it has to connect to a model that it can use and for this we need an API key depending on what model you want to use here on the GPT engineer page you can
see what kind of models are supported you have open AI you have anthropic and you have custom models if you are interested in that you want to read this guide here to learn how to use it for example with llama but we're going to use it here with the open AI API so we're going to use GPT I think the default is either gp4 or GPT 40 and for this we need an API key so go to your open AI API uh settings if you want to do the same thing create an API key copy
it and then you want to what you want to do is you want to paste it into an environment file so into a end file in this case here we have the nf. template file and all you got to do here is you have to replace the openai API key equals line with this same key or this same um yeah name and then here the API key or you do the same thing for anthropic and then you have uh the credentials for the for the model that you want to use with GPT engineer so what
I have here in my directory is I have a end file and thisn file contains the Line open AI API key equals and then my API key this is all it takes for this to work now let us get started and create a very simple project to get something that works first and then we're going to try to to see how far we can go with that I don't think that we're going to go too far I don't think that we can do very complicated things but maybe we can do something kind of interesting so
let us get started by creating a directory my project and this project is going to be very simple I go into this directory and I say now um I want to create a file prompt and this prompt now will contain all my instructions and my instructions are going to be simple I want to have or let's do it more like this built a flask [Music] application that shows a simple hello world page with nice styling dominant color should be red um also create a second page called about with some luren ipom text make sure there
is a navigation at the top so that shouldn't be too difficult I hope it doesn't fail already that would be quite quite bad for the Tool uh but what we do now is we go out of this directory and we run the following command gpte my project and it's going to recognize a prompt file what you see here now is it says using prompt and it gives you already here what it's doing so it's going to write out the code it's going to tell you what exactly it's doing and what you have to do in
the end is you have to approve it so you look at this you say does this make sense do I like it and then it says do you want to execute this code I say yes and what happens now is it executes the code uh now it asks me asks me here if it's okay to store your prompts or my prompts uh to help improve GPT engineer I'm going to say yes here but I'm going to say also uncertain uh to not waste any time here and I get here a total API cost of three
cents so if this works it costs three cents to get this to work maybe if I was hiring someone to do something simple like this they would charge 20 bucks for 15 minutes of work or something so if this works it might pay off already so let's see if it works let's go into my project what we have here is a run sh file we have an appy file so let's go ahead and say change mode plus X for run and then just run this I assume there's going to be a small problem with this
which is not a big deal because it doesn't work on my system this is exactly what I thought uh because it uses python here and not Python 3 but besides that hopefully it works so let's run this and this should start a flask application it does and I have red which is fine and I have my Hello World page and I have my about page with some text okay so this already worked so you can see that this thing here is capable of implementing a full project now it's not very complicated it doesn't have a
lot of functionality but it created multiple directories static templates um it has a requirements txt file it has an app py file file which has some code in here and we can also go to templates and we have three HTML files here the layout file which is a template or a base template we could say we have the index and we have the about page so this is already interesting now let's see how far we can take it let's go out of this and let's create a new directory let's call it to-do app and let's
say that in my to-do app I want to have here a prompt prompt and I want to say create a simple to-do list application in flask I want to be able to create check off and delete todos the result or the list should be stored in a CSV file not too complicated but it has some functionality so let's go out of this gpte Todo app and run this so it creates the structure again we have a to-do py so we have a separate we have three separate python files okay this is interesting let's see if
this works well um one issue that I had in the past was that the directory structure was kind of problematic and it didn't find the correct uh paths to the modules and it didn't work because of that but let's see if it works here out of the box and the source directory could be a problem here so I already assume this could be a problem but let's see if that's actually the case so let's say uncertain we get 5 cents of cost here so let's go into to-do app let's change the mode of run again
and then let's run this now probably first of all before we run this we should change this to Python 3 obviously but now let's see if this produces a problem I assume it's going to say cannot find module Source cuz that happened oh actually it doesn't do that so let's see to-do list add new to-do hello add okay that's interesting I get a to-do I get multiple to-dos I can delete to-dos I can check to-dos I can uncheck to-dos and does this also persist okay this persists as well this is interesting so to me this
seems like JavaScript so it actually implemented a working to-do list application let's close this for a second for 5 cents this is interesting uh let's go to to the source directory and let's see what kind of code we have here we have a to-do data class which is fine we have have a to-do manager which has the code that basically what does it do it just manages here the different to-dos in a class then we have our appui file which actually calls the functions from the to-do manager and then we have our templates which I'm
curious about now or the template now it doesn't actually have it doesn't actually have um doesn't have Js so it seems like it's actually or am I missing some something is this somewhere importing anything no okay this is actually all just Python and HTML interesting but okay this now okay it actually goes to the endpoint which is fine so this is a simple to-do list application now another feature of uh GPT engineer which is quite interesting is we can actually improve existing projects now I'm not sure if this is going to work here we can
start with something simple we can actually go ahead into the prompt we can remove everything that's in here and say uh change this application so that all of the styling has different shades of blue every button every background every UI element should have some form of blue let's see if it can do that so we're going to get out of this here and we're going to say um gpte to do app and now we need to use the flag dasi for improve so it's going to take the project and it's going to improve it uh
what we can do now here in this text file is we can uncommon the files that we actually want to modify for that obviously since we're talking about styling here uh the only things that I'm going to modify are the style CSS file and the index HTML file there's no reason to manipulate any of the Python code so I'm going to save that I'm going to close this and now it uh creates or updates a CSS file here probably is also going to change some things about the HTML file I guess and what we do
then is let's correct okay I mean it seems to do the same thing all the time not sure what's happening here let's see do you want to apply the changes let's just do it 10 cents so improving often times takes more money because it has to read the already existing code um so 10 cents is uh fine I guess let's go um and do gpte or actually not not gpte uh let's go into the directory to do app and let's run again and see if it now looks different I'm going to start this and it
looks blue okay doesn't look very beautiful but that was not the task the task was to have it here uh as a blue theme to-do list now let's try one more thing if it uh works I would be impressed because this kind of stuff didn't work when I tried it so I'm going to be honest about this it doesn't always work uh but let's go and say I want to actually change the prompt again I want to say add a login system to this project for this use flask login and hash the password the correct
password should be 1 2 3 4 5 no endpoint should be possible to reach without um without being locked in let's see if we can make this happen so gpte to do app- I and now we need to think about this which files could change we're not going to change this probably but we will change the appy we will change um actually just the Appy maybe we're going to also change the HTML just so we have a login button maybe so I'm going to save this I'm going to close this and let's see what we
get here so first of all it um changes the requirements file obviously it creates a user class it creates uh login manager so it creates new files this is going to be a little bit more expensive I guess so maybe we get something like 15 cents which is still very cheap you know we're still below 30 cents for the full thing oh 2 cents interesting this is just two cents okay so let's go into to-do list application let's run this and let's see if we have a login system now so open this and I see
the to-do list which is not good okay so we have an example here of this not working which is great because I didn't want to show this only working because that would be probably not correct I have played around with this a little bit and I had multiple times where it didn't work exactly like it doesn't work now because I can create Now new todos I'm not logged in I don't have any uh authentication process that I have to go to uh go through um and it shouldn't actually be possible to do that but I
am able able to do that so I don't know uh why maybe we can troubleshoot here maybe I can provide another prompt but it didn't work so that's an example of it not working um so yeah it is interesting it can be helpful but it's definitely not going to take your job if you can Implement a login system in an existing flask application this thing is not going to take your job because it is not as capable now maybe if you connect it to a different model maybe if you give it a different prompt it
will work but right now it didn't work first try and I would have to try over and over again and someone who doesn't know how to code so a manager for example will not uh sometimes be able to do it and will not have the nerve to do it so I don't think that this thing is going to replace any of you guys if you have any skills but it is interesting to look at now there is also an additional capability which I was not able to get to work which is division capability it says
here that you can provide an image directory and you can then say okay gpte and then provide the directory again and then you can say-- model GPT Vision preview uh prompt file image directory and then you can use the images in my case this didn't work I created a directory called screenshots I pasted a screenshot of a website and I say I said let my website look like this it's not that it didn't do the task properly it didn't even see the image it wasn't able to look at the image at all and I don't
know why this is exactly I looked into decode a little bit uh there is actually here uh in the core directory a file called aiy and here you can see how the vision is toggled so you have your self. vision and it's basically true if one of these things are true and it has to have Vision preview in the model name or GPT for turbo in the model name um or clot in the model name it didn't work with 40 even though 40 has Vision capabilities but it also didn't work if I used one of
these models that have this kind of name so I don't know why it is exactly maybe if you guys can get it to work let me know in the comment section down below how you did it but I was not able to get this functionality to work if you get it to work I think it's interesting because you can just add style based on a screenshot but yeah so I would say my opinion on GP engineer is it's interesting it may be helpful for small things but it's definitely not at all anything that's like super
exciting and it's nothing that will probably take your job so that's it for today's video I hope you enjoyed it and hope you learned something if so let me know by hitting a like button and leaving a comment in the comment section down below and of course don't forget to subscribe to this Channel and hit the notification Bell to not miss a single future video for free other than that thank you much for watching see you in the next video and bye for