Setting Up Auto-GPT Any Other Way is Dangerous!

πŸ‘¨β€πŸ’» My goal was to give you the guide I wished I had when setting up Auto-GPT the first time so you don’t have make the same mistakes I made.

Although Finxter already has a setup guide for Auto-GPT, I felt that most resources you find online don’t tell you the proper steps (including our previous tutorial). For security reasons, the official recommendation is using Docker and not pulling the repository from Git and running it on your own machine! Ignore at your own perill!

What Is Auto-GPT Anyway?

Auto-GPT is an innovative and experimental open-source application designed to help you achieve your goals using GPT-4 and GPT-3.5 large language model (LLM) technology. πŸš€

Here’s the promise. You tell it your goals — such as “Auto-GPT, you are a business genius, go make me money”. It autonomously generates plans and executes them without the need for human input.

What sets Auto-GPT apart is its ability to chain together multiple instances of GPT-4 or GPT-3.5, it creates elaborate plans, learns using feedback loops, and prompts itself and is even able to write and execute programs. A truly powerful idea that has the potential to change the world. πŸ’ͺ🏼

See an example run here (source):

πŸ’‘ Recommended: 10 High-IQ Things GPT-4 Can Do That GPT-3.5 Can’t

To begin harnessing the capabilities of Auto-GPT, you’ll need to install and set it up on your machine. Don’t worry; the process is straightforward and accessible, even if you’re new to AI-based applications.

Once you’ve successfully installed and configured Auto-GPT, you’re all set to explore its magic.

By the way, I have written a full guide on 30 ways to make money with Auto-GPT, feel free to check it out! πŸ‘‡

As you explore the world of Auto-GPT, keep in mind its experimental nature, and enjoy the exciting possibilities it offers! πŸ˜ƒ

πŸ’‘ Recommended: What is AutoGPT and How to Get Started?

Run Auto-GPT With Docker!

πŸ“‹ Requirements

Pick one of the following ways to install and run Auto-GPT:

  1. Docker (recommended) πŸ’«
  2. Python 3.10 or later
  3. VSCode + devcontainer

You should use Docker because it allows you to keep it updated more easily — the code is still rapidly evolving! That’s why I focus on Docker in this article! Why should I teach a way that is not recommended?

πŸ—οΈ Getting an API key

You should have a paid account from OpenAI (it’s really cheap) or your Auto-GPT program will crash due to too few credits. Some Finxters reported on our website that the free account will not work, I don’t know from personal experience as I have a paid account.

Get your OpenAI API key from the official OpenAI website: https://platform.openai.com/account/api-keys.

Here’s what it looks like on my account:

Name the key (e.g., AutoGpT) and hit “Create secret key”:

Now copy the secret key and paste it somewhere safe for later use in your Auto-GPT configuration. This is the only time you can actually see the secret key!

You can follow my detailed guide on setting up OpenAI API here:

πŸ’‘ Recommended: OpenAI API – or How I Made My Python Code Intelligent

You can set up a paid account at Manage account > Billing > Overview. Also make sure to monitor your costs and set usage limits. Auto-GPT is very hungry and it will eventually eat all the tokens you give it when running it long enough. πŸ˜‰

Setting up Auto-GPT with Docker

Step 1: Ensure Docker is installed

Step 2: Pull the latest image from Docker Hub

docker pull significantgravitas/auto-gpt

Step 3: Create an Auto-GPT folder

Step 4: In the Auto-GPT folder, create a file called docker-compose.yml and paste this into the file: πŸ‘‡

version: "3.9"
services:
  auto-gpt:
    image: significantgravitas/auto-gpt
    depends_on:
      - redis
    env_file:
      - .env
    environment:
      MEMORY_BACKEND: ${MEMORY_BACKEND:-redis}
      REDIS_HOST: ${REDIS_HOST:-redis}
    profiles: ["exclude-from-up"]
    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace
      - ./data:/app/data
      ## allow auto-gpt to write logs to disk
      - ./logs:/app/logs
      ## uncomment following lines if you have / want to make use of these files
      #- ./azure.yaml:/app/azure.yaml
      #- ./ai_settings.yaml:/app/ai_settings.yaml
  redis:
    image: "redis/redis-stack-server:latest"

Step 5: Create the necessary configuration files as follows:

Configuration: Locate the .env.template file in the Auto-GPT main folder, depending on your OS (Windows, macOS) this may be a hidden file. Duplicate it as .env, for example using: cp .env.template .env. Edit this .env file, filling your OpenAI API Key after OPENAI_API_KEY=, without quotes or spaces. Add other service keys/tokens if needed. Remove # to activate settings. Save and close the file.

By default, Auto-GPT uses a browser in headless mode, i.e., HEADLESS_BROWSER=True. If you use Docker, don’t change this setting or it’ll crash!

Step 6: Now you can run it! πŸ‘‡πŸ‘‡πŸ‘‡

Run with Docker (docker-compose)

Check your version of Docker Compose:

docker-compose version

You need Docker Compose version 1.29.0 or later. To upgrade, follow the installation instructions in the Docker docs.

Now run the following commands in your Auto-GPT folder.

Step 1: Build the Image:

docker-compose build auto-gpt

Step 2: Run Auto-GPT:

docker-compose run --rm auto-gpt

(Optional) Pass extra arguments such as --gpt3only and --continuous:

docker-compose run --rm auto-gpt --gpt3only --continuous

Congratulations, Auto-GPT is now running. Learn about all Auto-GPT command line arguments in our quick guide.

You can also check out an example run on this Finxter blog article or keep reading some ideas on how to use it first:

πŸ’‘ Recommended: 30 Creative AutoGPT Use Cases to Make Money Online