[Data][LLM] Add support for classification and scoring models in Ray Data LLM#59499
Merged
kouroshHakha merged 6 commits intoray-project:masterfrom Dec 18, 2025
Merged
Conversation
…ata LLM Add CLASSIFY and SCORE task types to vLLMTaskType enum to enable batch inference with sequence classification models (e.g., educational content classifiers, sentiment analyzers) and cross-encoder scoring models. - Add CLASSIFY and SCORE to vLLMTaskType enum - Route classify/score tasks to engine.encode() with PoolingParams - Add classification_example.py documentation example - Update working-with-llms.rst with classification section - Add classification config example to basic_llm_example.py Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for classification and scoring models to Ray Data's LLM batch inference capabilities, which previously only supported generation and embedding tasks. The changes are well-implemented, introducing classify and score task types and updating the vLLM engine stage to handle them. The documentation and examples have also been updated accordingly. I've provided a few suggestions to improve the robustness of the example code and enhance the maintainability of the core logic.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: kourosh hakhamaneshi <31483498+kouroshHakha@users.noreply.github.com>
…ha/ray into kh/add-score-data-llm Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
jeffreywang-anyscale
approved these changes
Dec 17, 2025
Contributor
jeffreywang-anyscale
left a comment
There was a problem hiding this comment.
Looks like you addressed Gemini comments in the latest revision. LGTM.
richardliaw
approved these changes
Dec 18, 2025
Yicheng-Lu-llll
pushed a commit
to Yicheng-Lu-llll/ray
that referenced
this pull request
Dec 22, 2025
…Data LLM (ray-project#59499) Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: kourosh hakhamaneshi <31483498+kouroshHakha@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
peterxcli
pushed a commit
to peterxcli/ray
that referenced
this pull request
Feb 25, 2026
…Data LLM (ray-project#59499) Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: kourosh hakhamaneshi <31483498+kouroshHakha@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for sequence classification and scoring models in Ray Data LLM batch inference. Previously, only
generateandembedtask types were supported. This change enables users to run batch inference with models likenvidia/nemocurator-fineweb-nemotron-4-edu-classifierfor educational content classification.Motivation
vLLM supports multiple task types for different model architectures:
generate- Text generation (LLMs)embed- Embedding modelsclassify- Sequence classification modelsscore- Cross-encoder scoring modelsRay Data LLM only supported
generateandembed. This PR addsclassifyandscoreto enable batch inference with classification models.Usage
Testing
classification_example.pyis automatically picked up by CI via the existing glob pattern inBUILD.bazelnvidia/nemocurator-fineweb-nemotron-4-edu-classifier