feat(llm_client): thread-pooled vLLM batch with max_concurrency; add …#80
feat(llm_client): thread-pooled vLLM batch with max_concurrency; add …#80funaileo wants to merge 1 commit into
Conversation
|
Hi @funaileo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
…hybrid test (mock/live)
8aa96fd to
480e762
Compare
…hybrid test (mock/live)
Pull Request
Description
Please share details of what you have added and why?
This PR refactors the LLMClient._vllm_batch_completion method to use a thread-pooled concurrent request pattern while maintaining ordered results and isolating errors per request.
Adds a dedicated _vllm_post_once() helper for single request execution
Introduces max_concurrency configuration (default 8, overridable via SDK_VLLM_MAX_CONCURRENCY)
Replaces sequential loop with a ThreadPoolExecutor, improving throughput for vLLM backends
Preserves result order and handles partial failures gracefully
Adds tests/unit/test_llm_client_hybrid.py, a hybrid test that:
Uses real vLLM if LIVE_VLLM_BASE is reachable
Falls back to mock mode automatically otherwise
This resolves previously non-concurrent batch behavior and provides deterministic, CI-safe test coverage.
Fixes # (issue)
#67
Type of change
Please non-releavant options