{"record":{"id":"3151dce8b2bc118b","repo":"vllm-project/vllm","slug":"unsupported-task-pooling-task-r-supported-tasks","errorCode":null,"errorMessage":"Unsupported task: {pooling_task!r} Supported tasks: {supported_tasks}","messagePattern":"Unsupported task: (.+?) Supported tasks: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"vllm/config/model.py","lineNumber":1736,"sourceCode":"                str(diff_sampling_param),\n                scope=\"local\",\n            )\n\n        return diff_sampling_param\n\n    def get_pooling_task(\n        self, supported_tasks: tuple[SupportedTask, ...]\n    ) -> PoolingTask | None:\n        if self.pooler_config is None:\n            return None\n\n        pooling_task = self.pooler_config.task\n\n        if pooling_task is not None:\n            if self.pooler_config.task in supported_tasks:\n                return self.pooler_config.task\n            else:\n                raise RuntimeError(\n                    f\"Unsupported task: {pooling_task!r} \"\n                    f\"Supported tasks: {supported_tasks}\"\n                )\n\n        if \"token_classify\" in supported_tasks:\n            for architecture in self.architectures:\n                if \"ForTokenClassification\" in architecture:\n                    return \"token_classify\"\n\n        priority: list[PoolingTask] = [\n            \"embed&token_classify\",\n            \"embed\",\n            \"classify\",\n            \"token_embed\",\n            \"token_classify\",\n            \"plugin\",\n        ]\n        for task in priority:","sourceCodeStart":1718,"sourceCodeEnd":1754,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/model.py#L1718-L1754","documentation":"get_pooling_task resolves which pooling task to run; when the user explicitly set a task in --pooling-task but that task is not among the tasks the model supports, it raises RuntimeError listing the supported set. This is a task/model compatibility failure, not a parsing error.","triggerScenarios":"PoolerConfig.task is set and get_pooling_task(supported_tasks) is called (e.g. serving with --task / --pooling-task classify) where the task string is not in the runner's supported tuple — including typo'd or runner-mismatched task names.","commonSituations":"Passing --task classify (a generation/score task) to an embedding runner, or 'score' to a classification model; mixing up vLLM task names across versions ('embed' vs 'embedding'); copy-pasting serve flags between different pooling models.","solutions":["Use one of the tasks listed in the error's Supported tasks list for that runner/model pair (e.g. 'embed', 'classify', 'score', 'reward').","Omit the explicit task and let get_pooling_task infer it from the architecture (e.g. ForTokenClassification auto-selects 'token_classify').","If you need a different task, serve the model with the runner that supports it (e.g. --runner pooling vs generate) or pick a model trained for that task."],"exampleFix":"# before\nvllm serve BAAI/bge-m3 --task classify\n# after\nvllm serve BAAI/bge-m3 --task embed","handlingStrategy":"validation","validationCode":"def task_supported(task: str | None, supported: tuple) -> bool:\n    return task is None or task in supported\n# validate --pooling-task against the runner's supported tuple before serving","typeGuard":"from typing import Iterable\ndef is_supported_task(task: object, supported: Iterable[str]) -> bool:\n    return isinstance(task, str) and task in supported","tryCatchPattern":"except RuntimeError as e:\n    if 'Unsupported task' in str(e):\n        parse the supported list from the message and surface it to the operator config UI","preventionTips":["Source task names from the runner's supported_tasks tuple, not from memory or other frameworks.","Prefer omitting --task and letting vLLM infer from the architecture when unsure.","Pin task names per model in a checked-in serving manifest."],"tags":["pooling","task-config","config"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}