gpt-engineer is a command-line platform for code generation experiments and the predecessor of lovable.dev. It allows users to specify software requirements in natural language, after which the AI writes and executes code, and can also ask the AI to implement improvements.
Main capabilities:
- Describe software in natural language, and the AI automatically writes and executes code.
- Request improvements to existing code, and the AI makes modifications.
- Supports customizing the AI agent's "identity" by overriding the preprompts folder, allowing the agent to remember information across projects.
- Supports image input (for models with vision capabilities), and UX or architecture diagrams can be added as additional context.
- Installs the bench binary, providing a simple interface for benchmarking custom agent implementations against popular public datasets (currently supports APPS, MBPP).
Usage: Installation: Stable version: python -m pip install gpt-engineer Development version: git clone https://github.com/gpt-engineer-org/gpt-engineer.git,然后 cd gpt-engineer, use poetry shell to activate the virtual environment. Supports Python 3.10 - 3.12; the last version to support Python 3.8 - 3.9 is 0.2.6. Set environment variables: export OPENAI_API_KEY=[your api key], or create a .env file (copy .env.template to .env and fill in OPENAI_API_KEY). Custom models: see the documentation; supports local models, Azure, etc. For Windows usage, see the Windows README. Other ways to run: use Docker (instructions available); do everything in the browser.
Create new code (default usage):
- Create an empty folder for the project anywhere on your computer.
- In the new folder, create a file named prompt (no extension) and fill in the instructions.
- Run gpte <project_dir>, using a relative path to point to the folder. For example: from the root of the gpt-engineer directory, run gpte projects/my-new-project; the new folder is located under projects/.
Improve existing code:
- Find the code folder you want to improve anywhere on your computer.
- In the new folder, create a file named prompt (no extension) and fill in the improvement instructions.
- Run gpte <project_dir> -i, using a relative path to point to the folder. For example: from the root of the gpt-engineer directory, run gpte projects/my-old-project -i; the folder is located under projects/.
Benchmark custom agents: gpt-engineer installs the bench binary, providing a simple interface for benchmarking custom agent implementations against popular public datasets. The easiest way to get started is to look at the template repository, which contains detailed instructions and an agent template. Currently supported benchmarks: APPS, MBPP. The community has begun different benchmarking initiatives.
Open source, local, and alternative models: By default, it supports using OpenAI models via the OpenAI API or Azure OpenAI API, as well as Anthropic models. With a little extra setup, you can also run open source models such as WizardCoder; see the example instructions in the documentation.
Use cases:
- Rapid prototyping: describe an application in natural language and automatically generate code.
- Code improvement: submit improvement requirements for an existing project, and the AI makes modifications.
- Agent benchmarking: evaluate the performance of custom coding agents on public datasets.
- Experimental code generation research.
Limitations:
- Running gpt-engineer means you agree to its terms.
- You need to provide your own API key (such as OPENAI_API_KEY).
- Image input requires a model with vision capabilities.
- Custom models and open source models require additional setup.
- More information about fees, pricing, specific platform support, etc. is not currently provided in the materials.