

GPT Engineer
50.6k 6.6kWhat is GPT-Engineer ?
Specify what you want it to build, the AI asks for clarification, and then builds it.
GPT-engineer lets you:
-
Specify a software in natural language
-
Sit back and watch as an AI writes and executes the code
-
Ask the AI to implement improvements
GPT-Engineer Features
You can specify the “identity” of the AI agent by editing the files in the preprompts
folder.
Editing the preprompts
, and evolving how you write the project prompt, is how you make the agent remember things between projects.
You can also automatically copy all preprompts
files into your project folder using the cli parameter --use-custom-preprompts
. This way you can have custom preprompts for all of your projects without the need to edit the main files.
You can also run with open source models, like WizardCoder. See the documentation for example instructions.
Getting Started with GPT-Engineer
Install gpt-engineer
For stable release:
python -m pip install gpt-engineer
For development:
-
git clone https://github.com/gpt-engineer-org/gpt-engineer.git
-
cd gpt-engineer
-
poetry install
-
poetry shell
to activate the virtual environment
We actively support Python 3.10 - 3.11. The last version to support python 3.8 - 3.9 was 0.2.6.
Setup API Key
Choose one of:
-
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]
-
.env file:
-
Create a copy of
.env.template
named.env
-
Add your OPENAI_API_KEY in .env
-
-
Custom model:
- See docs, supports local model, azure, etc.
Check the Windows README for windows usage.
Other ways to run:
-
Use Docker (instructions)
-
Do everything in your browser:
Creating 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:
gpte projects/my-new-project
from the gpt-engineer directory root with your new folder inprojects/
Improving 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:
gpte projects/my-old-project
from the gpt-engineer directory root with your folder inprojects/
By running gpt-engineer you agree to our terms.
Note
- To run this tool, the new command
gpte
is recommended for better user experience. However, the earlier default commandsgpt-engineer
andge
are also supported.