Skip to content

feat(llm_client): thread-pooled vLLM batch with max_concurrency; add …#80

Open
funaileo wants to merge 1 commit into
meta-llama:mainfrom
funaileo:feat/vllm-batch-threadpool
Open

feat(llm_client): thread-pooled vLLM batch with max_concurrency; add …#80
funaileo wants to merge 1 commit into
meta-llama:mainfrom
funaileo:feat/vllm-batch-threadpool

Conversation

@funaileo
Copy link
Copy Markdown

…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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change
  • Documentation update

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Oct 29, 2025

Hi @funaileo!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@funaileo funaileo force-pushed the feat/vllm-batch-threadpool branch from 8aa96fd to 480e762 Compare October 29, 2025 00:38
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant