GPT-Engineer: AI-driven code generation artifact, in just a few days gained 19k stars on GitHub
With the rapid development of AI technology, we ushered in a new star project - GPT-Engineer. The project garnered the attention of many developers overnight on GitHub, gaining 19k stars in just a few days. The charm of GPT-Engineer is that it can automatically generate code and build a complete code base according to user needs. What's even more amazing is that it can even learn and imitate the user's programming style, allowing programming projects to be completed in minutes.
Project address: https://github.com/AntonOsika/gpt-engineer
GPT-Engineer is characterized by diversity and practicality. It only needs a hint and can generate a complete code base. It asks clarification questions, generates technical specifications, and writes all the necessary code. It's easy to add your own inference steps, modifications, and experiments, and the project is open source. This means that future developers can create a project as easily as chatting with a friend, without writing a single line of code. This is not just a project, but a vision of the future. GPT-Engineer heralds that future software creation will be an era of man-machine communication.
According to GitHub's introduction, the main project concepts of GPT-Engineer include: easy to use, able to provide value to users; flexible and easy to add new "AI steps"; support advanced prompts, can remember user feedback; Switch between humans quickly; all calculations are "resumable" and persisted to the file system.
GPT-Engineer is unique in that it does not blindly accept the requirements submitted by developers, but asks detailed questions to allow developers to clarify possible ambiguities in the requirements. This process is divided into two phases: requirements refinement phase and software construction phase.
In the requirements refinement stage, the requirements text files submitted by developers are fed into GPT-Engineer and placed in the initial message of OpenAI’s GPT, along with instructions for identifying clarification questions. The GPT-Engineer system receives feedback from OpenAI GPT-4, understands which requirements need clarification, and responds to questions that prompt users for clarification. This process is repeated until all questions are clarified to the satisfaction of OpenAI GPT-4.
In the software construction stage, the requirements refined in the previous stage are packaged together with OpenAI's GPT instructions (ie, system prompts) and another set of output instructions that GPT-Engineer wants to see (ie, user prompts). After receiving the response from OpenAI GPT-4, GPT-Engineer creates source code files for the software project that the user provides instructions for.
Let us illustrate this process with an example. Suppose you want to make a multiplayer web version of Snake. You only need to enter some key hints, such as using a Python backend with MVC components, the view needs to stream the state to all players, and directly run the html and js with the code you generated. Then, GPT-Engineer will let you continue to answer some detailed questions, such as game rules and mechanics, player interconnection, game state updates, user interface, game controls, game end conditions, and code structure. After you simply answer these questions, GPT-Engineer will give a list of files, classes and methods needed to achieve the goal based on this information. Finally, a perfect snake game code is completed.
User feedback shows that GPT-Engineer's "clarify questions" function is its real highlight, because in the actual programming process, fixing problems in the generated code often takes more time than writing the code itself. This feature is seen as a big step in the right direction. However, some users expressed confusion about the difference between GPT-Engineer and GPT-4.
Although there is no doubt about the popularity of GPT-Engineer, some users have made some criticisms after the actual test. They believe that the setup process of GPT-Engineer is complicated, and it does not actually create files, but only allows users to run it once from the command line. They believe that the ability of GPT-Engineer is equivalent to that of ChatGPT4, but in actual use, there is still a certain gap between ideal and reality.
In addition, GPT-Engineer's benchmark has also caused some controversy. Although GPT-Engineer can quickly develop a currency_converter, it has problems coding a pomodoro_timer. This also caused users to question its practical application ability.
Despite some issues, GPT-Engineer's installation process is fairly straightforward. GPT-Engineer provides two installation methods: stable version and development version. For most users, installing the stable version is probably the best option, as it has been thoroughly tested and is less prone to issues.
Install the stable version:
First, open your command line tool. On Windows, this might be Command Prompt or PowerShell; on Mac or Linux, this might be Terminal. Then, type the following command and press Enter:
pip install gpt-engineer. This will install GPT-Engineer via Python's package manager, pip. If pip is not already installed on your computer, you may need to install Python first, as pip is usually installed with Python.
Install the development version:
First, you need to clone the GitHub repository of GPT-Engineer. In your command line tool, enter the following command and press enter:
git clone https://github.com/AntonOsika/gpt-engineer.git. This will download the code for GPT-Engineer to your computer.
Then, use the
cdcommand to enter the GPT-Engineer project directory you just downloaded. For example, if you downloaded GPT-Engineer in your user directory, you can type
cd gpt-engineerand press Enter.
In the project directory, enter the following command and press Enter:
make install. This will install GPT-Engineer and all its dependencies.
Finally, enter the following command and press Enter:
source venv/bin/activate. This will activate GPT-Engineer's Python virtual environment in which you can run GPT-Engineer.