crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

crashes on first occurrence of OpenAI rate limit

Open aliensouls opened this issue 1 year ago • 1 comments

it looks like the agents cannot retry or retry with exponential backoff intervals, when receiving rate limiting from openai api. the tokens per minute can be reached easily, if many agents work with large contexts, so the agents should simply wait and retry - but at the moment it halts the crew and never resumes. would it be possible to add a timeout and make it retry, instead of halting all operation when throttling from openai or any other api gets received?

example of implementation: https://github.com/openai/openai-cookbook/blob/main/examples/api_request_parallel_processor.py#L123

should I submit a PR? I'm new to this project, but if you could point me to the correct place where this processing takes place, I might be able to help.

aliensouls avatar Mar 25 '24 02:03 aliensouls

I see something like that already implemented class RPMController(BaseModel): but doesn't seem to work in my case.. where is the limit specified? all limits are different per each model, and also every account tier, so my current low tier also makes the limits lower than others - is it hardcoded or received from openai specifically about my account? in any case, it doesn't work (I crash on "tokens per minute limit reached, please wait" error from openai api, during one of the tasks, and it goes kaboom 💥

aliensouls avatar Mar 25 '24 02:03 aliensouls

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 20 '24 10:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 25 '24 12:08 github-actions[bot]