ChatGPT "Code Interpreter" But 100% Open-Source (Open Interpreter Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
open interpreter is an incredible open- source project that I reviewed a few months ago and essentially it is just like chat gpt's code interpreter but you can run it locally from your computer and the best part is you can now power it completely locally with open- Source models and since the last time I reviewed it the team behind it has made incredible progress it can now fully control your computer they've made it super developer friendly so you can actually build applications on top of it and it now has Vision so I'm going going to show you how to install it I'm going to talk about all of the new features and then I'm going to show you a bunch of examples so installing it now really could not be easier the first thing we're going to do is spin up a new cond environment and to do that we're going to type condac create DN oi python equal 3.11 now I already have an environment called oi so it's going to ask me to replace that but you shouldn't get that warning so here it is remove existing environment I'm going to say yes okay then I'm going to say proceed install everything then we copy this code right here here paste cond activate oi and then we can tell it's activated because it says so right there now watch how easy it is to install open interpreter now pip install open dash interpreter and just hit enter that's it it installs everything we need and I have not run into any issues so it's done then to run it simply type interpreter and then hit enter now if you're running this for the first time you're going to want to grab your open AI API key and I'm going to show you how to do this with local models a little bit later but first we're going to test out everything using GPT 4 so if you don't already have one sign up for open aai get an open AI API key you can click create new key right here name it and then you create a key I've already done that so I'm not going to do that again then come back to the terminal you're going to type export open aior aior key all capitals equals and then paste your API key in here I'm going to revoke this API key before publishing the video hit enter there now it's saved on your computer then the only thing you need to do next is just type interp preter hit enter and you can see right here it says model set to GPT 4 and open interpreter will require approval before running code all right first thing let's ask it what folders are on my desktop so sure I can help with that I'm going to use the shell command LS desktop would you like to run this code yes here we go the folders are and that is correct and there's also a screenshot so that is perfect and it's so cool that you can fully control your computer and you know what look at this image it's an avif image and I hate that format let's convert it to jpeg convert the image on my desktop to jpeg make sure to remove the avif file extension after you do hit enter all right so we'll have to use image magic installed in your machine for the conversion here's the plan check if image magic is installed if it's not install it then convert the image remove the original avif image let's proceed check if image magic is installed in your machine execute the code yes all right looks like it is is installed and if it wasn't installed it would have installed it next we're going to convert the file to jpg yes and I can see on my desktop it just created a new file and there it is jpeg from the avif file and it's done now it's asking if I want to remove the other file and there we go put it in the trash and now we have this JPEG file so easy now imagine if you had 500 of these rather than manually converting each one or having to download some kind of software to do that you can simply tell the computer to do that and you can fully control your computer as well watch this so open the folder YouTube on my desktop okay would you like to run this code yes there we go it opened that folder next open the folder within that folder okay to open the folder within the YouTube directory I need the exact name of the subfolder okay so it got that folder perfect the subfolder within the YouTube directory is named llm 101 now let's open it go ahead and there it goes perfect so you can write sophistic ated scripts to do pretty much anything on your computer next I also mentioned open interpreter now has Vision so to start up interpreter with vision we just type interpreter D- vision and then hit enter and there we go now I switch over to chat GPT and I'm going to take a screenshot of this dropdown right here switching back to open interpreter I'm going to take that screenshot and drag it on the screen then I'm going to say create this dropdown with code so what I'm asking it to do is read what's in the image and write code to recreate it okay so to create a drop down similar to the one in the screenshot I'll need to write HTML with inline Tailwind CSS Styles and here we go so it's writing all the code to do that and it's done and it says would you like to run this code yes so it popped open an HTML file and there's the drop down it's definitely not perfect but it's pretty good let's try to get it to correct itself wow look at this I was about to give it feedback but it reviewed its own output the output you see on your machine indicates that the HTML and Tailwind CSS code has been executed and displayed played it appears that you are seeing a drop down however upon reviewing the screenshot you provided I can see that there's a mismatch between the desired design and the actual output unbelievable and here we go and now it's writing out all the things it's going to fix it gave me updated code although it's kind of weird oh there we go there's the updated code and would you like to run this code let's see the next version and there we go much better and now we have a drop down let's see what it thinks about that one all right task is done it's still not perfect but it's really good let me actually try to get rid of this so simply say that piece of code is showing remove it okay there it wrote the code let's try it out and unfortunately it's still there so I'm going to be done with this for now obviously it's it's not perfect but I'd still say really good ah there it says and it's correcting itself it appears that the previous HTML code block still has the uranous code tag should have been removed I apologize for the oversight and now it's writing some more code let's see it if it fixed it this time it still didn't so it is struggling to get rid of this little piece of code showing and it sees once again that it still has that code there I don't know why it's struggling so much to get rid of it I can see already it's still going to show it all right I'm going to let it do one more try and then I'm going to move on all right yep still there okay so I'm just going to end it right there so opening regular interpreter backup I want to show you how to actually create tools and reuse tools let's see if this will work okay convert the screenshot on my desktop to jpeg once you're done save the code necessary to do that so we can reuse the code later call it conversion tool so plan for this task is as follows find the screenshot file on the desktop use the convert command from image magic save the successful command to a shell script called conversion tool. sh for later reuse okay so now it's looking for any PNG files there it is so now it's going to convert it to JPEG and that's going to use image Magic's convert command so it's seeing if it's installed yes it is okay now it's using the convert command to actually convert the file okay so it failed it seems a convert command failed to locate the screenshot file this could be due to the spaces let's try again all right there we go it worked so this is obviously very simple code to run but you can create very complex tools that you can save and reuse so now let's confirm that the new jpeg has been created yes okay so it has now it should save the code okay so now it's going to create the file yes all right it has been successfully created the script takes two arguments The Source image and a destination JPEG file so now I can have open interpreter reuse that code rather than pinging gp4 again to write the code from scratch absolutely incredible now what if you want to build applications on top of open interpreter it really could not be easier let me show you so down in the bottom right I have my conduit environment selected so all I need to do is import interpreter from interpreter then do interpreter. chat input a prompt and that's it let's try it out now for some reason The Interpreter here could not be imported but we'll see if it works okay so of course python module issues let's do this pip install open interpreter wherever I am all right let's see if that worked so my visual studio code must be in a different environment because it didn't have open interpreter and now it doesn't have the API key so let's go ahead and do the same thing export open AI API key hit enter now it should work let's push play again all right here we go okay to plot the normalized stock prices of apple and we will take the following steps and there it goes so now you can imagine you can build entire applications on top of open interpreter power you can even control the desktop you can use the vision version of the model and of course you can power everything locally which I'm going to show you in a second so here we go it's writing the code to actually do what I just asked it yes go ahead and do it let's see if it works so it's installing some packages great we got the closing prices of apple and meta so it actually wrote code to HD an API now it's doing doing normalization using pandas Json so it is writing code to actually normalize the data would you like to run this code yes okay there is an issue let's see it appears there was an error in my previous code so of course it is self-correcting I tried to apply json. loads to the panda series object instead of the string let's correct this confusion all right and that is obviously a really cool part of open interpreters the fact that I can actually self-correct and it's kind of like agents in that sense would you like to run this code yes all right still another issue let's see if it corrects itself and this is the same thing that code interpreter from chat GPT does it writes code it tries to execute it if it has any errors it tries to fix it okay so it looks like I ran into some issues running interpreter from the code it keeps saying parent appears to have exited shutting down now I've actually gotten it to work outside of on this video so I know it works but I'm struggling to recreate it now but obviously you can just run this test it out yourself and play around with building code on top of open interpreter okay the last thing I'm going to show you is how to run this completely locally using LM Studio one of my favorite projects it is so easy to use and I've already created a full tutorial for LM Studio I'll drop it in the link below once you have LM Studio installed I went ahead and just searched for mixol I download this massive dolphin 2.7 mixol 8 time 7B model my favorite model you go down to this my models folder make sure it's there it is great okay so I clicked load and it's loading the model right now okay so it should be loaded perfect now we just click Start server now we have the dolphin 2.7 Mixel 8X 7B loaded locally which is obviously mind-blowing in itself but now we're going to power open interpreter using this open source model switch back to terminal all we're going to type is interpreter D- local and hit enter and that's it it knows to use LM Studios endpoints here we go open inter local mode is powered by LM Studio you will need to run LM studio in the background it tells you how to do it I've already done that of course this is highly experimental don't expect GPT 3.5 or four level quality but of course this is awesome so we're going to try it out anyways tell me what folders are on my desktop all right now my video might slow down quite a bit right now because it is using a ton of my processing power on my computer and if you're wondering I have a MacBook Pro M2 Ultra and it might actually be incredibly low maybe I should not have downloaded such a massive model I think this model's too big for doing everything I'm doing at the same time including recording these videos so I'm going to go ahead and click stop I'm going to eject the model and I'm going to download a small model mistol so here we go mistal 7B instruct this is for code this is great and I'm going to go ahead and download the quantise version right there so this is a much smaller model hopefully it's much faster okay now the smaller mistal 7B model finished let's go ahead and load it up click right here click there it's going to load the model loading much faster perfect now we're going to start our server again switch back to the terminal we're going to do interpreter D- loc all right now tell me what folders I have on my desktop now remember this is running completely locally and you can see right here streaming response so it is working and here it goes to solve the problem we can use Theo's module in Python which allows us to get information about the operating system and basic actions related to it now again it's not going to perform as well as gp4 it just won't but if we fine-tune it if we play around with it if we test different scenarios we could get it to work really well if we were using a larger mixol model which we can host somewhere it would also work very well so let's execute the code and there it is the folder on my desktop so it actually worked perfectly on the first go using a very small mistel models mistl 7B completely locally so this works this is incredible so so play around with open interpreter let me know what you think I've spoken to Killian who's the original author of open interpreter and he told me about his vision and his vision aligns extremely well with the way that I see the world essentially there's going to be a large language model interface for computers and eventually we're just going to talk to this large language model and there's no need for applications anymore so it's going to be really exciting to see this project evolve play around with it let me know what you think if you liked this video please consider giving a like And subscribe and I'll see you in the next one
Info
Channel: Matthew Berman
Views: 104,262
Rating: undefined out of 5
Keywords: open interpreter, code interpreter, chatgpt, openai, llm, ai, artificial intelligence, open source, large language model
Id: xPd8FFzIeOw
Channel Id: undefined
Length: 13min 29sec (809 seconds)
Published: Fri Jan 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.