Following the recent popularity of ChatGPT, another explosive open-source project <span>Auto-GPT</span> has emerged.In just the last 10 days, this project has gained over 80,000 stars, with a total star count exceeding 100,000!So what exactly is Auto-GPT? Why is it so popular? How can it be used and deployed? Is it really practical?With these questions in mind, let’s take a look at this article. Below, I will share an introduction to Auto-GPT, the simplest deployment method, and provide a brief hands-on experience.
What is Auto-GPT?
Auto means automatic, so Auto-GPT means automatic GPT.What does that mean?Previously, if we wanted to use ChatGPT to write a paper, we might have to manually ask it several questions, such as:Question: I want to write a paper on AI, what should I do?AI Answer: Confirm the topic, write the background, write the program, conduct experiments, write the conclusion, etc.Question: Help me come up with a topicAI Answer: AutoGPTQuestion: Help me introduce the background of AutoGPT…You would need to ask the AI multiple questions until you finally completed a paper.But with AutoGPT, you only need to tell it a goal, like “write a paper on AI,” and it can automatically complete the goal using its program.Of course, like humans, it doesn’t get it right in one go; it first automatically asks the AI questions, then based on the AI’s answers, it automatically poses new questions, and this process continues until it achieves the goal you set.
AutoGPT itself also combines LLM (Large Language Model), effectively allowing AI to direct AI.
Moreover, AutoGPT has a very powerful ability: when it finds that GPT cannot answer its questions, it will actively search for answers online, thus compensating for the limitation of GPT’s training data, which only goes up until September 2021.Officially introduced featuresIt sounds impressive, so let’s set up our own Auto-GPT~
Setting Up Your Own Auto-GPT
Many tutorials online suggest setting up Auto-GPT locally, which is actually not recommended due to the hassle and potential inconsistencies in the environment and dependencies.I personally believe the simplest way is to use <span>GitPod</span> cloud hosting service, directly deploying Auto-GPT using a server provided by someone else, which is perfect for learning.First, visit the official repository: https://github.com/Significant-Gravitas/Auto-GPTThen click Fork to copy the repository to your own GitHub:This step is crucial! Uncheck <span>Copy the master branch only</span>! Because <span>master</span> branch code may be unstable (I learned this the hard way)!Once the Fork is successful, we enter our repository and change the browser address from <span>github.com</span> to <span>gitpod.io/#</span>.For example, my address is:<span>https://github.com/liyupi/Auto-GPT </span>, change it to <span>https://gitpod.io/#/liyupi/Auto-GPT</span>, and visit it; now you can deploy the project with one click using GitPod!Then we enter the GitPod project homepage, and you can now use this webpage as your computer (server), for example, using the VS Code editor.Once on this page, the first thing to do is switch branches; make sure to select <span>origin/stable</span> branch! Otherwise, you might encounter some weird bugs later.As shown below:Next, we find the <span>.env.template</span> file in the left directory, right-click to rename it to <span>.env</span>, and modify OPEN_API_KEY to your own.
Since Auto-GPT also queries OpenAI, you must have an OpenAI key.
After making these modifications, enter the command <span>./run.sh</span> in the terminal, and it will automatically install the required environment and dependencies; just wait!If you see the message in the image below, it means the installation was successful!Next, press <span>ctrl + c</span> to exit the program; do not use the <span>run.sh</span> command to start it again, as it will check dependencies each time. Instead, you can directly use the <span>python -m autogpt</span> command to start autogpt.For example, execute <span>python -m autogpt --help</span> to view the usage and parameter descriptions of autogpt:In the image above, there are several parameters that need special attention, such as:
-c: Whether to enable continuous mode. This is a very dangerous command! It means autogpt will execute automatically without your consent, including but not limited to infinite loops, infinitely creating files, filling up space, and deleting files on your computer, etc. Just like humans: it may stop at nothing to achieve its goals!
-l: Specifies the limit on the number of continuous executions. This can prevent infinite loops.
–speak: Enables voice mode. But it does not play sound within the browser; it generates audio files.
OK, after understanding these, let’s have a little experience~
Small Trial
Let’s give it a very simple task: let autogpt help “create a website that praises a chicken playing basketball.”First, execute the <span>python -m autogpt</span> command, then sequentially input the AI name, AI role, and goal:Then autogpt will start working, and we can see its thoughts, plans, and the actions it intends to take. For example, it plans to search for more information online, using the Google search command.We can input <span>y</span> to agree with what it wants to do, or we can input any content and suggestions to influence its actions.Here I’ll just agree with it~Then, surprisingly, it said it wanted to watch videos online to learn! Wow, AI also wants to slack off?After agreeing, it directly downloaded the video file, but unexpectedly, since my server does not have a browser, it couldn’t watch the video! It had to go back and search Google again.So we input <span>y</span> to agree:Guess what happened? It wanted to watch the video again! It was caught in a loop…So you can imagine, if you let autogpt run automatically for a day, besides your OpenAI Key balance being drained, you might not achieve any results.So humans have to step in; I instructed it: stop watching videos, any text will do!As a result… it indicated it wanted to browse other webpages, not listening!So I had to be more firm! “Stop researching, immediately develop the website for me!”This time it listened, and the plan executed the <span>write_to_file</span> command to generate the website:Input <span>y</span> to allow it, and then it generated the <span>index.html</span> file in our workspace:The website is complete! Let’s open it locally to verify, and we see the text “Chickens can not only be eaten, they can also play basketball.” It also shared an article and a video!The video is from YouTube, and when I opened it, I burst out laughing:Although it may be a bit of a shortcut, nonetheless, autogpt has managed to complete a website in a short time, which is quite impressive!However, after completing this website, autogpt showed no signs of stopping, still obsessively searching for videos of chickens playing basketball on YouTube.So friends, continuous mode is truly dangerous; if AI operates without human control, it can be very perilous!