Convert Figma logo to code with AI

gpt-engineer-org logogpt-engineer

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

51,964
6,769
51,964
15

Top Related Projects

The ChatGPT Retrieval Plugin lets you easily find personal or work documents by asking questions in natural language.

Integrate cutting-edge LLM technology quickly and easily into your apps

93,526

🦜🔗 Build context-aware reasoning applications

166,386

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.

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

Quick Overview

GPT-Engineer is an AI-powered tool that generates entire codebases from natural language descriptions. It leverages large language models to interpret user requirements and produce functional code, aiming to streamline the software development process.

Pros

  • Rapidly generates entire codebases from simple descriptions
  • Supports multiple programming languages and frameworks
  • Can create complex project structures and file hierarchies
  • Continuously improving through community contributions and updates

Cons

  • Generated code may require human review and refinement
  • Dependence on external AI models may raise privacy concerns
  • May not always capture nuanced or highly specific requirements
  • Could potentially impact traditional software development jobs

Getting Started

  1. Clone the repository:

    git clone https://github.com/gpt-engineer-org/gpt-engineer.git
    cd gpt-engineer
    
  2. Install 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 <project_directory>
    

Replace <project_directory> with the path to your project folder containing a prompt file with your project description.

Competitor Comparisons

The ChatGPT Retrieval Plugin lets you easily find personal or work documents by asking questions in natural language.

Pros of chatgpt-retrieval-plugin

  • Focuses on enhancing ChatGPT's ability to retrieve and process external data
  • Provides a flexible plugin architecture for customizing data sources and retrieval methods
  • Offers integration with various vector databases for efficient similarity search

Cons of chatgpt-retrieval-plugin

  • Limited to retrieval and data processing tasks, not full-scale software development
  • Requires more setup and configuration compared to gpt-engineer's simpler approach
  • May have a steeper learning curve for users unfamiliar with vector databases and retrieval systems

Code Comparison

chatgpt-retrieval-plugin:

from typing import Dict, List
from datastore.datastore import DataStore
from services.openai import get_embeddings

def process_documents(documents: List[Dict], datastore: DataStore):
    for doc in documents:
        embedding = get_embeddings(doc["text"])
        datastore.upsert([(doc["id"], doc, embedding)])

gpt-engineer:

from typing import List
from gpt_engineer.ai import AI
from gpt_engineer.steps import generate_code

def create_project(prompt: str, steps: List[str]):
    ai = AI()
    for step in steps:
        code = generate_code(ai, prompt, step)
        print(f"Generated code for {step}:\n{code}\n")

This comparison highlights the different focus areas of the two projects. chatgpt-retrieval-plugin emphasizes data retrieval and processing, while gpt-engineer is geared towards generating code for entire software projects based on prompts and predefined steps.

Integrate cutting-edge LLM technology quickly and easily into your apps

Pros of Semantic Kernel

  • More comprehensive framework for building AI-powered applications
  • Supports multiple programming languages (C#, Python, Java)
  • Offers a wider range of AI integration capabilities beyond code generation

Cons of Semantic Kernel

  • Steeper learning curve due to its broader scope and complexity
  • Less focused on automated code generation compared to GPT Engineer
  • Requires more setup and configuration for specific use cases

Code Comparison

Semantic Kernel (C#):

var kernel = Kernel.Builder.Build();
var skill = kernel.ImportSkill(new TextSkill());
var result = await kernel.RunAsync("Hello world!", skill["Uppercase"]);

GPT Engineer (Python):

from gpt_engineer import GPTEngineer

engineer = GPTEngineer()
result = engineer.generate_code("Create a simple Hello World program")

Summary

Semantic Kernel is a more comprehensive AI development framework, offering broader capabilities across multiple languages. GPT Engineer focuses specifically on automated code generation using natural language prompts. While Semantic Kernel provides more flexibility, GPT Engineer offers a simpler approach for quick code generation tasks.

93,526

🦜🔗 Build context-aware reasoning applications

Pros of LangChain

  • More comprehensive and flexible framework for building LLM-powered applications
  • Extensive documentation and community support
  • Wider range of integrations with various LLMs and tools

Cons of LangChain

  • Steeper learning curve due to its broader scope
  • May be overkill for simpler projects or specific use cases
  • Requires more setup and configuration

Code Comparison

LangChain:

from langchain import OpenAI, LLMChain, PromptTemplate

llm = OpenAI(temperature=0.9)
prompt = PromptTemplate(input_variables=["product"], template="What is a good name for a company that makes {product}?")
chain = LLMChain(llm=llm, prompt=prompt)

GPT-Engineer:

from gpt_engineer import GPTEngineer

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

LangChain offers a more modular approach, allowing for fine-grained control over the LLM interaction process. GPT-Engineer, on the other hand, provides a higher-level abstraction focused specifically on code generation tasks. While LangChain is more versatile, GPT-Engineer offers a simpler interface for its specific use case of generating entire projects based on natural language descriptions.

Pros of TaskMatrix

  • Focuses on multi-modal AI agents, integrating vision and language models
  • Supports a wider range of tasks, including image generation and manipulation
  • Offers a more flexible architecture for handling diverse AI tasks

Cons of TaskMatrix

  • May be more complex to set up and use compared to GPT-Engineer
  • Potentially requires more computational resources due to its multi-modal nature
  • Less focused on specific code generation tasks

Code Comparison

TaskMatrix:

def execute_command(self, command):
    if command.startswith("generate_image"):
        return self.image_generator.generate(command)
    elif command.startswith("analyze_image"):
        return self.image_analyzer.analyze(command)
    # ... other command handlers

GPT-Engineer:

def generate_code(self, prompt):
    response = self.llm.generate(prompt)
    return self.code_parser.parse(response)

TaskMatrix offers a more diverse set of commands for various AI tasks, while GPT-Engineer focuses specifically on code generation. TaskMatrix's architecture allows for handling different types of inputs and outputs, whereas GPT-Engineer is more streamlined for code-related tasks.

166,386

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 beyond just code generation
  • Offers a more interactive and autonomous experience, with the ability to break down complex tasks into subtasks
  • Includes built-in internet search capabilities for gathering information

Cons of AutoGPT

  • Can be more complex to set up and use, with a steeper learning curve
  • May require more computational resources and API calls, potentially increasing costs
  • Less focused on specific code generation tasks compared to GPT Engineer

Code Comparison

GPT Engineer:

def run_gpt_engineer(prompt):
    project = GPTEngineer(prompt)
    project.generate_code()
    project.save_files()

AutoGPT:

def run_auto_gpt(goal):
    agent = AutoGPT(goal)
    agent.plan_tasks()
    agent.execute_tasks()
    agent.review_results()

While both projects utilize AI for task completion, GPT Engineer is more streamlined for code generation, whereas AutoGPT offers a broader range of capabilities with a more complex execution process.

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

Pros of gpt-engineer

  • More active development with frequent updates and contributions
  • Larger community and user base, leading to more feedback and improvements
  • Better documentation and examples for easier onboarding

Cons of gpt-engineer

  • May have more complexity due to additional features
  • Potentially slower performance with increased functionality
  • Higher learning curve for new users

Code Comparison

gpt-engineer:

def generate_code(prompt):
    response = openai.Completion.create(
        engine="davinci-codex",
        prompt=prompt,
        max_tokens=1000,
        n=1,
        stop=None,
        temperature=0.5,
    )
    return response.choices[0].text.strip()

gpt-engineer>:

def generate_code(prompt):
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=1000,
        temperature=0.7,
    )
    return response.choices[0].message.content.strip()

The main differences in the code snippets are:

  • gpt-engineer uses the Completion API, while gpt-engineer> uses the ChatCompletion API
  • gpt-engineer uses the "davinci-codex" engine, while gpt-engineer> uses the "gpt-3.5-turbo" model
  • gpt-engineer> has a slightly higher temperature setting for more creative outputs

Both repositories aim to generate code using AI, but gpt-engineer appears to be more established and feature-rich, while gpt-engineer> might be a newer or simplified version of the project.

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

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:

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