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,