{"record":{"id":"6e7da76c31be1105","repo":"vllm-project/vllm","slug":"pooling-type","errorCode":null,"errorMessage":"{pooling_type}","messagePattern":"\\{pooling_type\\}","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"vllm/config/pooler.py","lineNumber":160,"sourceCode":"                    \"Cannot set both `pooling_type` and `tok_pooling_type`\"\n                )\n\n            if pooling_type in SEQ_POOLING_TYPES:\n                logger.debug(\n                    \"Resolved `pooling_type=%r` to `seq_pooling_type=%r`.\",\n                    pooling_type,\n                    pooling_type,\n                )\n                self.seq_pooling_type = pooling_type  # type: ignore[assignment]\n            elif pooling_type in TOK_POOLING_TYPES:\n                logger.debug(\n                    \"Resolved `pooling_type=%r` to `tok_pooling_type=%r`.\",\n                    pooling_type,\n                    pooling_type,\n                )\n                self.tok_pooling_type = pooling_type  # type: ignore[assignment]\n            else:\n                raise NotImplementedError(pooling_type)\n\n    def get_seq_pooling_type(self) -> SequencePoolingType:\n        if self.seq_pooling_type is None:\n            raise ValueError(\n                \"seq_pooling_type is not set; it should be resolved by\"\n                \" ModelConfig before calling get_seq_pooling_type()\"\n            )\n        return self.seq_pooling_type\n\n    def get_tok_pooling_type(self) -> TokenPoolingType:\n        if self.tok_pooling_type is None:\n            raise ValueError(\n                \"tok_pooling_type is not set; it should be resolved by\"\n                \" ModelConfig before calling get_tok_pooling_type()\"\n            )\n        return self.tok_pooling_type\n\n    def compute_hash(self) -> str:","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/pooler.py#L142-L178","documentation":"Raised as NotImplementedError in PoolerConfig.__post_init__ when pooling_type is a string that is neither in SEQ_POOLING_TYPES ('CLS','LAST','MEAN') nor TOK_POOLING_TYPES ('ALL','STEP'). The Literal typing should catch bad strings at pydantic validation, but this branch guards direct object construction or bypassed validation.","triggerScenarios":"Building PoolerConfig with pooling_type='AVG', 'max', 'mean_pooling', or any other unsupported value outside the two Literal sets.","commonSituations":"Misspelled or case-mismatched pooling names ('mean' vs 'MEAN', 'last_token' vs 'LAST'); configs ported from other frameworks using their pooling vocabulary.","solutions":["Use one of the supported values: for sequence pooling 'CLS' | 'LAST' | 'MEAN'; for token pooling 'ALL' | 'STEP'.","Use uppercase exactly — values are case-sensitive Literals.","Set the more specific seq_pooling_type / tok_pooling_type field if unsure which category applies."],"exampleFix":"# before\nPoolerConfig(pooling_type='mean')\n\n# after\nPoolerConfig(pooling_type='MEAN')","handlingStrategy":"validation","validationCode":"SEQ = {\"CLS\", \"LAST\", \"MEAN\"}\nTOK = {\"ALL\", \"STEP\"}\n\ndef is_valid_pooling_type(v: str) -> bool:\n    return v in SEQ | TOK\n\nassert is_valid_pooling_type(user_value.upper()), f\"unsupported pooling_type {user_value!r}\"","typeGuard":"from typing import Literal, TypeGuard\nfrom vllm.config.pooler import SequencePoolingType, TokenPoolingType\n\ndef is_seq_pooling_type(v: str) -> TypeGuard[SequencePoolingType]:\n    return v in (\"CLS\", \"LAST\", \"MEAN\")","tryCatchPattern":null,"preventionTips":["Normalize pooling names to uppercase before passing them in.","Source the allowed values from vllm.config.pooler.SEQ_POOLING_TYPES / TOK_POOLING_TYPES rather than hardcoding."],"tags":["pooling","invalid-value","configuration"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}