-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Resolver] Unhandled RateLimitError when calling litellm.completion in issue_definitions.py #5030
Comments
I could take a shot at this! I'm thinking of implementing
This would help with consistency in retry methods. |
Please see also: #5087 |
Just curious here, sorry if I'm missing something obvious, why are we using
e.g.
|
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 7 days. |
I think this has been addressed by reusing the The rest of the problem here is tracked in other issues, for example on implementing an automated routing mechanism or other features that would improve the behavior with rate limits. (example) I'll close this, but please feel free to reopen if you see fit. |
Unhandled RateLimitError when calling
litellm.completion
inissue_definitions.py
Description
When running
resolve_issue.py
, the script throws multiple errors due to an unhandledRateLimitError
from the Anthropic API. This occurs during the call tolitellm.completion
in theguess_success
method ofissue_definitions.py
. The error indicates that the number of tokens has exceeded the per-minute rate limit imposed by the Anthropic API.Context
Steps to Reproduce
RateLimitError
from the LLM.Expected Behavior
The app should handle the
RateLimitError
gracefully by:Actual Behavior
The app crashes and outputs the following error stack trace:
Error Logs
Possible Solutions
We can handle this issue by implementing one or more of the following solutions:
a) Set up an environment variable for Maximum Requests Per Minute
LLM_MAX_REQUESTS_PER_MINUTE
.b) Configure an Environment Variable for Anthropic API Tier
ANTHROPIC_API_TIER
.c) Auto-detect Rate Limit Exceeded and Implement Retry Logic
RateLimitError
occurs and handle it gracefully.RateLimitError
exception in theguess_success
method.sleep()
function to wait before retrying the request.Additional Context
Please let me know if any additional information is required to resolve this issue.
Moved from All-Hands-AI/openhands-resolver#348
The text was updated successfully, but these errors were encountered: