[Misc] Validate Pooling cache_salt Values (#46966)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
Taneem Ibrahim committed
Jul 4, 2026 at 09:19 UTC
1d354c694eedf241b836319dba497345a5aa1167
1 file changed
+15
vllm/entrypoints/pooling/base/protocol.py
+15
@@ -69,6 +69,21 @@ class PoolingBasicRequestMixin(OpenAIBaseModel):
69
)
70
# --8<-- [end:pooling-common-extra-params]
71
72
+ @model_validator(mode="before")
73
+ @classmethod
74
+ def check_cache_salt_support(cls, data):
75
+ if not isinstance(data, dict):
76
+ return data
77
+
78
+ if data.get("cache_salt") is not None and (
79
+ not isinstance(data["cache_salt"], str) or not data["cache_salt"]
80
+ ):
81
+ raise VLLMValidationError(
82
+ "Parameter 'cache_salt' must be a non-empty string if provided.",
83
+ parameter="cache_salt",
84
+ )
85
+ return data
86
+
87
def _build_pooling_tok_params(
88
self,
89
model_config: ModelConfig,