Skip to content

Design discussion: native query-document scoring in the vLLM backend #9025

Open

Description

@Midhilesh4890

Proposal: native query-document scoring in the vLLM backend

Target tracker: triton-inference-server/server. Independent of multi-prompt
generation. This is a design proposal with a version-fenced local prototype.

At base 22f3280b6a62ccf12734a3ca4ea961488fcf0bf4, task selection
recognizes only generate/embed. Request implementations
call generate or encode; no query-document score tensor contract exists.
A retrieval application needs one query and D documents scored in their original
order without starting another vLLM HTTP server.

Proposal: documents TYPE_STRING [D] is optional and selects scoring; text_input
TYPE_STRING [1] carries the query. Return scores FP32 [D] in input order in one
decoupled final response. No sorting/top-k or classification API is added.
Empty/invalid inputs, generation parameters, multimodal data, LoRA and token
streaming are rejected. Cancellation/failure aborts outstanding child IDs, with
no partial-score success response. Generation and embedding stay unchanged.

The inspected async EngineClient has encode(prompt, pooling_params, request_id,
...) rather than a query-document score method. PoolingParams(task="score") is
not a valid shortcut. vLLM's serving layer performs pair tokenization, query/document
processing, template handling, and score conversion. The prototype reuses
ServingScores, ScoreTextRequest, the built-in model registry and compatibility
checks in-process; it does not copy model rules or start HTTP routes/server.

The concrete adapter is fenced to 0.29.0/0.30.0; 0.20.1 has a different constructor.
Compatible pooling tasks are embed, token_embed, or classify with one label,
subject to vLLM/model restrictions. An optional SCORE_CHAT_TEMPLATE model parameter
uses vLLM's template loader. Scores retain native model/activation semantics;
they are not universally probabilities. Ordinary late interaction is used;
flash late interaction is disabled in this prototype.

Sources: 0.29 scoring serving,
0.30 processors,
0.30 engine protocol.
Related: backend embeddings #104,
frontend embedding batches #8961.
Related-work search coverage is incomplete for broad terms; no claim of exhaustive absence.

Maintainer decisions: is reuse of version-sensitive serving APIs acceptable, or
should vLLM expose a stable asynchronous score adapter first? Confirm version policy,
input names/task selection, template configuration and endpoint scope. Alternatives
are a narrower cross-encoder-only feature, an upstream vLLM helper, or retaining
client-side scoring until the shared interface exists. No dependency upgrade is
proposed to hide the API limitation.

Validation: mocked parsing/order/failure/cancellation tests, runnable gRPC client
and direct same-version vLLM reference. Numerical parity must be checked for at
least a bi-encoder and cross-encoder using identical revisions, dtype, pooling
configuration and templates. GPU execution/model compatibility is not established
by the CPU tests. Current prototype supports only gRPC streaming inference.

Activity

  1. Midhilesh4890 commented on Oct 17, 2026

    @Midhilesh4890
    Author

    I have a local prototype ready to develop into a PR for this proposal. GPU/container validation is still outstanding. I would welcome feedback on the design and API; based on the maintainers' feedback and suggestions, I will revise and improve the implementation before opening a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions