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

Throttling of batch API requests to avoid excessive rate limit errors -> faster batch processing #369

Open
pchalasani opened this issue Jan 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pchalasani
Copy link
Contributor

Add a variant of this openai cookbook example to pro-actively throttle API requests. The current Langroid chat and achat methods do have the usual retry-with-exponential backoff etc here but this approach is "blind" in the sense that there is no pro-active throttling attempt. As a result when we do large batch jobs (e.g. using run_batch_tasks there might be just too much time wasted in hitting rate limits and retrying. A pro-active throttling approach like in the script below should work better.

https://github.com/openai/openai-cookbook/blob/main/examples/api_request_parallel_processor.py

@pchalasani pchalasani added the enhancement New feature or request label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant