Quickstart

Installation

To install LangChain run:

$ python -m pip install gpt-engineer

For more details, see our [Installation guide](/instllation.html).

Setup API Key

Choose one of the following:

  • Export env variable (you can add this to .bashrc so that you don’t have to do it each time you start the terminal)

    $ export OPENAI_API_KEY=[your api key]
    
  • Add it to the .env file:

    • Create a copy of .env.template named .env

    • Add your OPENAI_API_KEY in .env

  • If you want to use a custom model, visit our docs on using open models and azure models.

  • To set API key on windows check the Windows README.

Building with gpt-engineer

Create new code (default usage)

  • Create an empty folder for your project anywhere on your computer

  • Create a file called prompt (no extension) inside your new folder and fill it with instructions

  • Run gpte <project_dir> with a relative path to your folder

  • For example, if you create a new project inside the gpt-engineer /projects directory:

    $ gpte projects/my-new-project
    

Improve Existing Code

  • Locate a folder with code which you want to improve anywhere on your computer

  • Create a file called prompt (no extension) inside your new folder and fill it with instructions for how you want to improve the code

  • Run gpte <project_dir> -i with a relative path to your folder

  • For example, if you want to run it against an existing project inside the gpt-engineer /projects directory:

    $ gpte projects/my-old-project -i
    

By running gpt-engineer you agree to our terms.

To run in the browser you can simply:

https://github.com/codespaces/badge.svg