[Pooling] Validate non-negative rerank top_n (#46119)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Taneem Ibrahim committed
Jun 22, 2026 at 11:40 UTC
f2069b005b815e8a1b44381712dc951157c42ad4
1 file changed
+1
-1
vllm/entrypoints/pooling/scoring/protocol.py
+1
-1
@@ -139,7 +139,7 @@ class RerankRequest(ScoringRequestMixin):
139
# --8<-- [start:rerank-request-params]
140
query: ScoreInput
141
documents: ScoreInput | list[ScoreInput]
142
- top_n: int = Field(default_factory=lambda: 0)
142
+ top_n: int = Field(default=0, ge=0)
143
# --8<-- [end:rerank-request-params]
144
145