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

Added Semaphore for restricting amount of concurrent LLM calls #1043

Merged

Conversation

KolodziejczykWaldemar
Copy link
Contributor

This PR introduces a semaphore-based approach to limit the number of concurrent async tasks when executing test cases. The main changes include:

  • Implementation of asyncio.Semaphore to control concurrency.
  • Modification of the main execution loop to use the new semaphore-controlled function.

Impact on LLM Requests
This change significantly reduces the number of simultaneous requests made to the Language Model (LLM) API. By limiting concurrent tasks to a configurable number (default set to 10), we achieve:

  • Better management of API rate limits.
  • Reduced risk of encountering "too many requests" errors.
  • More consistent and predictable request patterns.

Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
evals-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 8:01pm

@penguine-ip
Copy link
Contributor

Extremely useful, thanks! @KolodziejczykWaldemar

@penguine-ip penguine-ip merged commit 0c50b9b into confident-ai:main Oct 3, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants