Skip to content

Added ability to configure concurrent_requests in litellm_model.py #911

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dameikle
Copy link

@dameikle dameikle commented Aug 9, 2025

This pull request updates the way concurrent API requests are configured for the LiteLLM model endpoint. Instead of using a hardcoded value, the number of concurrent requests is now configurable through the model's configuration object, making the code more flexible and easier to tune for different environments.

Configuration improvements:

  • Added a new field concurrent_requests to the LiteLLMModelConfig class, allowing the number of concurrent API requests to be set via configuration instead of being hardcoded.
  • Updated the LiteLLMClient class to use the new concurrent_requests configuration value, removing the old hardcoded CONCURRENT_CALLS attribute.

Concurrency handling:

  • Modified the __call_api_parallel method to use the configurable concurrent_requests value when creating the ThreadPoolExecutor, improving flexibility and maintainability.

Copy link
Member

@NathanHB NathanHB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey ! thanks for the fix, if the tests pass we are good to merge

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@dameikle
Copy link
Author

hey ! thanks for the fix, if the tests pass we are good to merge

Thanks for the review @NathanHB 🙇 I've updated with the suggested change.

Copy link
Member

@NathanHB NathanHB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this is good to merge, i just missed that you need to add the new parametr to the docstring, thanks !

@dameikle
Copy link
Author

Hey, this is good to merge, i just missed that you need to add the new parametr to the docstring, thanks !

Sorry totally should have thought of that. Update made now

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.

3 participants