gpt-engineer-org / gpt-engineer

Platform to experiment with the AI Software Engineer. Terminal based. NOTE: Very different from https://gptengineer.app
MIT License
51.92k stars 6.76k forks source link

Rate limit reached for 10KTPM-200RPM... #551

Closed pdavis68 closed 1 year ago

pdavis68 commented 1 year ago

Expected Behavior

Expected GPT Engineer to do it's thing!

Current Behavior

It read my prompt. Asked a dozen questions which I answered in detail. Then:

Nothing more to clarify.

INFO:openai:error_code=rate_limit_exceeded error_message='Rate limit reached for 10KTPM-200RPM in organization org-[orgid here] on tokens per min. Limit: 10000 / min. Please try again in 6ms. Contact us through our help center at help.openai.com if you continue to have issues.' error_param=None error_type=tokens message='OpenAI API error received' stream_error=False

Failure Information (for bugs)

This, I believe is the relevant portion of the stack:

File "c:\python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\python310\scripts\gpt-engineer.exe__main__.py", line 7, in sys.exit(app()) File "c:\python310\lib\site-packages\gpt_engineer\main.py", line 64, in main messages = step(ai, dbs) File "c:\python310\lib\site-packages\gpt_engineer\steps.py", line 154, in gen_clarified_code messages = ai.next(messages, dbs.preprompts["use_qa"]) File "c:\python310\lib\site-packages\gpt_engineer\ai.py", line 37, in next response = openai.ChatCompletion.create( File "c:\python310\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create return super().create(*args, **kwargs)


Is there a way to rate limit the app? This is the only thing I was using it for.

My prompt was pretty detailed. About 150 lines.

bostone commented 1 year ago

Same thing here. I spent an hour writing a detailed prompt then another one answering 15 questions. Then ... CRASH


INFO:openai:error_code=rate_limit_exceeded error_message='Rate limit reached for 10KTPM-200RPM in organization org-******* on tokens per min. Limit: 10000 / min. Please try again in 6ms. Contact us through our help center at help.openai.com if you continue to have issues.' error_param=None error_type=tokens message='OpenAI API error received' stream_error=False
Traceback (most recent call last):

  File "/Users/robert.stone/.pyenv/versions/3.11.1/bin/gpt-engineer", line 8, in <module>
    sys.exit(app())
             ^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/gpt_engineer/main.py", line 64, in main
    messages = step(ai, dbs)
               ^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/gpt_engineer/steps.py", line 154, in gen_clarified_code
    messages = ai.next(messages, dbs.preprompts["use_qa"])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/gpt_engineer/ai.py", line 37, in next
    response = openai.ChatCompletion.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/openai/api_requestor.py", line 298, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/openai/api_requestor.py", line 700, in _interpret_response
    self._interpret_response_line(

  File "/Users/robert.stone/.pyenv/versions/3.11.1/lib/python3.11/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
    raise self.handle_error_response(

openai.error.RateLimitError: Rate limit reached for 10KTPM-200RPM in organization org-******* on tokens per min. Limit: 10000 / min. Please try again in 6ms. Contact us through our help center at help.openai.com if you continue to have issues.
Nilay2711 commented 1 year ago

Anyone found solution for this?

I tried using sleep for upto 5 mins... Still not working...

majacaci00 commented 1 year ago

seeing same issue ^^ :(

SGJIII commented 1 year ago

Same. Need to solve or at least know if I break into smaller components will it work.

raygorous commented 1 year ago

same issue. any suggestions?

AntonOsika commented 1 year ago

Doesn't seem like an issue with gpt-engineer but openai, happy to hear suggestions will close otherwise

snlamm commented 1 year ago

I rotated my openai api key and that seemed to fix the issue...at least for now

Nilay2711 commented 1 year ago

I rotated my openai api key and that seemed to fix the issue...at least for now @snlamm Hey Can you please elaborate? Rotate the openai key like how?

niklasfink commented 1 year ago

The problem is that your prompt and clarifications are too extensive for your OpenAI plan. Depending on your OpenAI plan, your token limit can be around 10K/min and if you have written a long prompt or the application has too many lines of code generated, you can easily get over this limit.

On Azure OpenAI for gpt-4-32k you have a token limit of 60K/min and can use 32K token per request by default. I think OpenAI also enabled such sizes for enterprises now.

The only thing gpt-engineer could do is already warn upfront that your prompt is probably too too long, but I don’t think this is worth the effort at the moment, because the OpenAI error already explains the issue.