gpt-engineer icon indicating copy to clipboard operation
gpt-engineer copied to clipboard

Rate Limits

Open ewimsatt opened this issue 2 years ago • 3 comments

I am running into OpenAI rate limits. Will you add a way for us to manually set rate limits (RPM and TPM) based on our plans?

Traceback (most recent call last):

File "", line 198, in _run_module_as_main

File "", line 88, in _run_code

File "/Users/ewimsatt/scripts/gpt-engineer/gpt_engineer/main.py", line 49, in app()

File "/Users/ewimsatt/scripts/gpt-engineer/gpt_engineer/main.py", line 45, in chat messages = step(ai, dbs) ^^^^^^^^^^^^^

File "/Users/ewimsatt/scripts/gpt-engineer/gpt_engineer/steps.py", line 64, in gen_spec messages = ai.next(messages, dbs.identity["spec"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/Users/ewimsatt/scripts/gpt-engineer/gpt_engineer/ai.py", line 34, in next response = openai.ChatCompletion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/Users/ewimsatt/anaconda3/envs/gpt-end/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/Users/ewimsatt/anaconda3/envs/gpt-end/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( ^^^^^^^^^^^^^^^^^^

File "/Users/ewimsatt/anaconda3/envs/gpt-end/lib/python3.11/site-packages/openai/api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/Users/ewimsatt/anaconda3/envs/gpt-end/lib/python3.11/site-packages/openai/api_requestor.py", line 700, in _interpret_response self._interpret_response_line(

File "/Users/ewimsatt/anaconda3/envs/gpt-end/lib/python3.11/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line raise self.handle_error_response(

openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

ewimsatt avatar Jun 18 '23 00:06 ewimsatt

"openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.”

Here you need to increase the hard limit: https://platform.openai.com/account/billing/limits

EntchenEric avatar Jun 19 '23 07:06 EntchenEric

Better to mod the code with while true try catch than set up the rate limit plan as plans varies

yhyu13 avatar Jun 19 '23 09:06 yhyu13

I am facing the same issue here.

Abodivic avatar Jun 20 '23 16:06 Abodivic

If you wish to reopen the issue please do following the new issue template.

patillacode avatar Jun 21 '23 13:06 patillacode

Hey @ewimsatt @Abodivic

try wrapping the openai base with reliableGPT - it'll handle model switching, in case any one gets rate limited by OpenAI (you can customize this as well).

from reliablegpt import reliableGPT
openai.ChatCompletion.create = reliableGPT(openai.ChatCompletion.create, user_email='[email protected]')

Source: https://github.com/BerriAI/reliableGPT

krrishdholakia avatar Jun 21 '23 22:06 krrishdholakia

hello @krrishdholakia Can you help me with reliableGpt?

Mitang321 avatar Jul 15 '23 18:07 Mitang321