From 1d354c694eedf241b836319dba497345a5aa1167 Mon Sep 17 00:00:00 2001 From: Taneem Ibrahim Date: Sat, 4 Jul 2026 09:19:28 -0500 Subject: [PATCH] [Misc] Validate Pooling cache_salt Values (#46966) Signed-off-by: Taneem Ibrahim Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> --- vllm/entrypoints/pooling/base/protocol.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vllm/entrypoints/pooling/base/protocol.py b/vllm/entrypoints/pooling/base/protocol.py index 81ad303ad9..04ebc18817 100644 --- a/vllm/entrypoints/pooling/base/protocol.py +++ b/vllm/entrypoints/pooling/base/protocol.py @@ -69,6 +69,21 @@ class PoolingBasicRequestMixin(OpenAIBaseModel): ) # --8<-- [end:pooling-common-extra-params] + @model_validator(mode="before") + @classmethod + def check_cache_salt_support(cls, data): + if not isinstance(data, dict): + return data + + if data.get("cache_salt") is not None and ( + not isinstance(data["cache_salt"], str) or not data["cache_salt"] + ): + raise VLLMValidationError( + "Parameter 'cache_salt' must be a non-empty string if provided.", + parameter="cache_salt", + ) + return data + def _build_pooling_tok_params( self, model_config: ModelConfig,