Convert Figma logo to code with AI

AntonOsika logogpt-engineer

Platform to experiment with the AI Software Engineer. Terminal based. NOTE: Very different from https://gptengineer.app

52,908
6,894
52,908
30

Top Related Projects

11,856

the first library to let you embed a developer agent in your own app!

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

32,205

The first real AI developer

173,689

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Quick Overview

GPT-Engineer is an AI-powered tool that generates entire codebases from natural language descriptions. It leverages large language models to create functional software projects based on user prompts, aiming to automate significant portions of the software development process.

Pros

  • Rapidly generates entire codebases from simple descriptions
  • Can create complex, multi-file projects with proper structure
  • Adaptable to various programming languages and frameworks
  • Potentially reduces development time and effort for certain tasks

Cons

  • Generated code may require human review and refinement
  • Accuracy and quality of output can vary depending on the complexity of the request
  • May not always follow best practices or produce optimized code
  • Potential for misuse or over-reliance on AI-generated code

Getting Started

To use GPT-Engineer, follow these steps:

  1. Clone the repository:

    git clone https://github.com/AntonOsika/gpt-engineer.git
    cd gpt-engineer
    
  2. Install the required dependencies:

    pip install -e .
    
  3. Set up your OpenAI API key:

    export OPENAI_API_KEY='your-api-key-here'
    
  4. Run GPT-Engineer:

    gpt-engineer projects/example
    
  5. Follow the prompts to describe your project and let GPT-Engineer generate the code.

Competitor Comparisons

11,856

the first library to let you embed a developer agent in your own app!

Pros of developer

  • More flexible and customizable, allowing users to define their own AI agents and workflows
  • Supports multiple AI models, including GPT-4, Claude, and PaLM
  • Includes a web interface for easier interaction and project management

Cons of developer

  • Less focused on generating complete projects from scratch
  • May require more setup and configuration for specific use cases
  • Documentation is less comprehensive compared to gpt-engineer

Code Comparison

developer:

from smol_dev.agents import CodeWriter, Reviewer
from smol_dev.prompts import generate_prompt

code_writer = CodeWriter()
reviewer = Reviewer()

prompt = generate_prompt("Create a simple web app")
code = code_writer.generate(prompt)
feedback = reviewer.review(code)

gpt-engineer:

from gpt_engineer import GPTEngineer

engineer = GPTEngineer()
project = engineer.create_project("Create a simple web app")
code = project.generate_code()

Both projects aim to assist developers in generating code using AI, but they differ in their approach and flexibility. developer offers more customization options and supports multiple AI models, while gpt-engineer provides a more streamlined experience focused on generating complete projects from start to finish.

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Pros of screenshot-to-code

  • Focuses specifically on converting UI designs to code, potentially offering more specialized and accurate results for this task
  • Includes a user-friendly web interface for easy interaction and visualization of the conversion process
  • Supports multiple frontend frameworks and languages, providing flexibility for different project requirements

Cons of screenshot-to-code

  • Limited to UI/frontend development, whereas gpt-engineer can handle a wider range of programming tasks
  • May require more precise input (screenshots) compared to gpt-engineer's text-based prompts
  • Potentially less customizable or extensible for complex project structures

Code Comparison

screenshot-to-code (HTML output example):

<div class="container">
  <h1>Welcome to My App</h1>
  <button class="btn btn-primary">Get Started</button>
</div>

gpt-engineer (Python project structure example):

project/
    __init__.py
    main.py
    utils/
        __init__.py
        helpers.py

Both projects leverage AI to assist in code generation, but they serve different purposes. screenshot-to-code is tailored for UI development from visual designs, while gpt-engineer offers a broader approach to software development tasks across various domains.

32,205

The first real AI developer

Pros of gpt-pilot

  • More comprehensive project management features, including task breakdown and progress tracking
  • Supports multiple programming languages and frameworks
  • Includes a user-friendly CLI interface for easier interaction

Cons of gpt-pilot

  • Potentially more complex setup and configuration process
  • May require more computational resources due to its broader feature set
  • Steeper learning curve for users new to AI-assisted development

Code Comparison

gpt-pilot:

from gpt_pilot.project_manager import ProjectManager

project = ProjectManager("my_project")
project.create_task("Implement user authentication")
project.generate_code()

gpt-engineer:

from gpt_engineer import GPTEngineer

engineer = GPTEngineer()
engineer.create_app("Create a simple web app")

Both projects aim to automate software development using AI, but gpt-pilot offers a more comprehensive suite of features for managing larger projects across multiple languages. gpt-engineer, on the other hand, provides a simpler, more straightforward approach that may be easier for beginners to grasp quickly. The choice between the two depends on the complexity of the project and the user's familiarity with AI-assisted development tools.

173,689

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Pros of AutoGPT

  • More versatile and capable of handling a wider range of tasks
  • Includes a memory system for improved context retention
  • Offers a web interface for easier interaction

Cons of AutoGPT

  • More complex setup and configuration process
  • Requires more computational resources
  • Steeper learning curve for users

Code Comparison

AutoGPT:

def execute_command(command_name, arguments):
    command_name = command_name.lower()

    if command_name in COMMAND_CATEGORIES:
        return COMMAND_CATEGORIES[command_name].execute(arguments)

gpt-engineer:

def run_gpt_engineer(prompt):
    messages = [{"role": "system", "content": SYSTEM_MESSAGE},
                {"role": "user", "content": prompt}]
    chat_completion = openai.ChatCompletion.create(model="gpt-4", messages=messages)

Both projects utilize GPT models, but AutoGPT implements a more complex command execution system, while gpt-engineer focuses on a straightforward prompt-based approach. AutoGPT offers greater flexibility and autonomy, whereas gpt-engineer provides a simpler, more focused solution for code generation tasks.

Pros of TaskMatrix

  • Offers a more comprehensive AI agent ecosystem with multiple specialized agents
  • Provides a visual interface for task planning and execution
  • Supports multi-modal interactions, including image processing and generation

Cons of TaskMatrix

  • More complex setup and configuration compared to gpt-engineer
  • Potentially higher computational requirements due to multiple agents
  • Less focused on pure code generation tasks

Code Comparison

TaskMatrix example (task planning):

task_planner = TaskPlanner()
task_plan = task_planner.plan_task("Create a simple web application")
for step in task_plan:
    execute_step(step)

gpt-engineer example (code generation):

engineer = GPTEngineer()
project_description = "Create a simple web application"
generated_code = engineer.generate_code(project_description)
engineer.save_code(generated_code)

Both projects aim to automate software development tasks using AI, but they take different approaches. TaskMatrix focuses on a multi-agent system for diverse tasks, while gpt-engineer specializes in code generation. The choice between them depends on the specific needs of the project and the desired level of automation across different aspects of software development.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

gpt-engineer

GitHub Repo stars Discord Follow License GitHub Issues or Pull Requests GitHub Release Twitter Follow

The OG code genereation experimentation platform!

If you are looking for the evolution that is an opinionated, managed service – check out gptengineer.app.

If you are looking for a well maintained hackable CLI for – check out aider.

gpt-engineer lets you:

  • Specify software in natural language
  • Sit back and watch as an AI writes and executes the code
  • Ask the AI to implement improvements

Getting Started

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.12. 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:

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: gpte projects/my-new-project from the gpt-engineer directory root with your new folder in projects/

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: gpte projects/my-old-project -i from the gpt-engineer directory root with your folder in projects/

Benchmark custom agents

  • gpt-engineer installs the binary 'bench', which gives you a simple interface for benchmarking your own agent implementations against popular public datasets.
  • The easiest way to get started with benchmarking is by checking out the template repo, which contains detailed instructions and an agent template.
  • Currently supported benchmark:

The community has started work with different benchmarking initiatives, as described in this Loom video.

Research

Some of our community members have worked on different research briefs that could be taken further. See this document if you are interested.

Terms

By running gpt-engineer, you agree to our terms.

Relation to gptengineer.app (GPT Engineer)

gptengineer.app is a commercial project for the automatic generation of web apps. It features a UI for non-technical users connected to a git-controlled codebase. The gptengineer.app team is actively supporting the open source community.

Features

Pre Prompts

You can specify the "identity" of the AI agent by overriding the preprompts folder with your own version of the preprompts. You can do so via the --use-custom-preprompts argument.

Editing the preprompts is how you make the agent remember things between projects.

Vision

By default, gpt-engineer expects text input via a prompt file. It can also accept image inputs for vision-capable models. This can be useful for adding UX or architecture diagrams as additional context for GPT Engineer. You can do this by specifying an image directory with the —-image_directory flag and setting a vision-capable model in the second CLI argument.

E.g. gpte projects/example-vision gpt-4-vision-preview --prompt_file prompt/text --image_directory prompt/images -i

Open source, local and alternative models

By default, gpt-engineer supports OpenAI Models via the OpenAI API or Azure OpenAI API, as well as Anthropic models.

With a little extra setup, you can also run with open source models like WizardCoder. See the documentation for example instructions.

Mission

The gpt-engineer community mission is to maintain tools that coding agent builders can use and facilitate collaboration in the open source community.

If you are interested in contributing to this, we are interested in having you.

If you want to see our broader ambitions, check out the roadmap, and join discord to learn how you can contribute to it.

gpt-engineer is governed by a board of long-term contributors. If you contribute routinely and have an interest in shaping the future of gpt-engineer, you will be considered for the board.

Significant contributors

Example

https://github.com/gpt-engineer-org/gpt-engineer/assets/4467025/40d0a9a8-82d0-4432-9376-136df0d57c99