Skip to content

hughperkins/scalable-gpt-developer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scalable-gpt-developer

scalable-gpt-developer

First, DISCLAIMER

DISCLAIMER

This will call gpt-4 api lots of times, over and over, until it stops seeing anything that needs changing.

This could cost you lots of money.

I take no responsiblity for your using this and spending lots of money.

YOU are responsible for choosing to run this, and baby-sitting it whils it runs, making sure it doesn't run more times than you are comfortable, or like, forever.

IT CAN TOTALLY RUN FOREVER for whatever reason. Eg bug or whatever. YOU are responsbile for stopping it after it has made as many calls to openai as you are comfortable with.

What problem does this try to solve?

Getting gpt-4 to generate appliations that won't fit in the gpt-4 input or output token limits.

It does this by getting gpt-4 to generate an api spec for many tiny classes/files, and then getting gpt-4 to iteratively generate each file, one by one, updating the api spec if necessary. If the api spec is updated, each file is checked to see if it needs any changes. Once all files have been generated, and no changes are required, no more api spec changes, then the program exits.

What this does

It takes in a task, by default tasks/react_app1.txt, and asks gpt-4 to generate an api spec for lots of tiny classes/files. Then it goes through one file at a time, and makes a new request to gpt-4, to get it to write the full implementation of the file, given the task, and the current api spec.

In the request for each file, gpt-4 can choose to update the api specs.

Each implemented file is written to disk, by default into app folder. Also, any updates to api_spec are written there too.

This program will continue looping over files, until no files are revised, and no api spec changes are made.

If a file already exists, then the program will load the contents of that file, and provide the contents, along with the task description, and the latest api spec, and ask if any changs are needed. If no, then next file is considered, otherwise that file is updated with the new contents.

how to use

python scalable_gpt_developer/run.py \
    [--in-task-file PATH_TO_TASK_DESCRIPTION_TEXT_FILE ] \
    [--in-working-dir PATH_TO_DIRECTORY_INTO_WHICH_TO_GENERATE_FILES] \
    [--wipe-working-dir] \
    [--model MODEL_TYPE]

If you give --wipe-working-dir, then the entire tree at PATH_TO_DIRECTORY_INTO_WHICH_TO_GENERATE_FILES will be WIPED. Do NOT give this option if you don't want to lose every file in that folder.

--model can be any valid openai chat model, e.g. gpt-3.5-turbo or gpt-4. gpt-4 is the default, and gives much better results, but is also slower, and costs 30 times more (yes! 30 times!).

Example

app contents was generated by running using tasks/react_app1.txt task file.

test_app_react is just a React starter app, into which I copied the files from app/client/src. It doesnt run yet, but it seems close-ish...

Note that to run this you have to do:

npm install
npm install react-modal   # gpt4 didnt add this to package.json, for reasons unknown

About

scalable-gpt-developer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published