Skip to content
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

Auto Recovery Logic for chat completion clients on different types of server errors #3632

Open
ekzhu opened this issue Oct 3, 2024 · 2 comments · May be fixed by #5615
Open

Auto Recovery Logic for chat completion clients on different types of server errors #3632

ekzhu opened this issue Oct 3, 2024 · 2 comments · May be fixed by #5615
Labels
help wanted Extra attention is needed proj-extensions size-medium takes up to a week
Milestone

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Oct 3, 2024

What feature would you like to be added?

It would be nice instead if we can support a model client that auto-recovers from various host-related errors with a configurable logic such as retries.

Here is a good example of an apparently transient error:

openai.APIStatusError: Error code: 424 - {'error': {'message': 'Error occurred while processing image(s).', 'type': 'failed_dependency', 'param': None, 'code': None}}

Moreover, even for rate limit errors like below, it doesn't always retry, there is some inconsistency happening

openai.RateLimitError: Error code: 429 - {'error': {'code': '429', 'message': 'Rate limit is exceeded. Try again in 1 seconds.'}}

Why is this needed?

Currently, the implementation of the chat completion client for OpenAI fails to recover and crashes for a host of errors (except for retries that are rate-limit related where it auto-retries), however, a host of other errors randomly occur and that forces the applications built on top of the client to have their own logic for auto-recovery.

@ekzhu
Copy link
Collaborator Author

ekzhu commented Oct 3, 2024

@husseinmozannar Moved your issue here.

@rysweet rysweet added this to the future milestone Oct 22, 2024
@jackgerrits jackgerrits modified the milestones: future, 0.4 Oct 22, 2024
@fniedtner fniedtner removed the feature label Oct 24, 2024
@jackgerrits jackgerrits added proj-extensions size-small takes 1-2 days size-medium takes up to a week and removed proj-core proj-extensions size-small takes 1-2 days labels Oct 24, 2024
@fniedtner fniedtner modified the milestones: 0.4, 0.4.1 Oct 24, 2024
@jackgerrits jackgerrits modified the milestones: 0.4.1, 0.4.x Jan 13, 2025
@ekzhu
Copy link
Collaborator Author

ekzhu commented Jan 28, 2025

Just encountered the rate limiting error again, I think it would be good to have a retry logic built into the client itself. it's a pain to always have to write the code around the client.

@ekzhu ekzhu added the help wanted Extra attention is needed label Jan 28, 2025
@ekzhu ekzhu changed the title Auto Recovery Logic for chat completion clients Auto Recovery Logic for chat completion clients on different types of server errors Feb 18, 2025
@ekzhu ekzhu linked a pull request Feb 21, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed proj-extensions size-medium takes up to a week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants