Skip to content

Added ability to configure concurrent_requests in litellm_model.py - #911

Merged
NathanHB merged 5 commits into
huggingface:mainfrom
dameikle:litellm_concurrent_requests
Aug 14, 2025
Merged

NathanHB merged 5 commits into
huggingface:mainfrom
dameikle:litellm_concurrent_requests

Conversation

@dameikle

@dameikle dameikle commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

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.

@NathanHB NathanHB left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor 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.

@NathanHB NathanHB left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor 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

@NathanHB
NathanHB merged commit b0edbc3 into huggingface:main Aug 14, 2025
NathanHB added a commit that referenced this pull request Sep 19, 2025
)

* Added ability to configure concurrent_requests in litellm_model.py

* Update src/lighteval/models/endpoints/litellm_model.py

Co-authored-by: Nathan Habib <[email protected]>

* Updated docstring for new concurrent_requests parameter in LiteLLMModelConfig

---------

Co-authored-by: Nathan Habib <[email protected]>
rakkit pushed a commit to SDLAML/lighteval that referenced this pull request Jun 21, 2026
…uggingface#911)

* Added ability to configure concurrent_requests in litellm_model.py

* Update src/lighteval/models/endpoints/litellm_model.py

Co-authored-by: Nathan Habib <[email protected]>

* Updated docstring for new concurrent_requests parameter in LiteLLMModelConfig

---------

Co-authored-by: Nathan Habib <[email protected]>
artemorloff pushed a commit to artemorloff/lighteval that referenced this pull request Jul 16, 2026
…uggingface#911)

* Added ability to configure concurrent_requests in litellm_model.py

* Update src/lighteval/models/endpoints/litellm_model.py

Co-authored-by: Nathan Habib <[email protected]>

* Updated docstring for new concurrent_requests parameter in LiteLLMModelConfig

---------

Co-authored-by: Nathan Habib <[email protected]>
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