{"record":{"id":"0e2e4d26df5ccac6","repo":"vllm-project/vllm","slug":"tokenizer-must-be-a-string-got-type-self-tokeniz","errorCode":null,"errorMessage":"tokenizer must be a string, got {type(self.tokenizer).__name__}: {self.tokenizer!r}. Please provide a valid tokenizer path or HuggingFace model ID.","messagePattern":"tokenizer must be a string, got (.+?): (.+?)\\. Please provide a valid tokenizer path or HuggingFace model ID\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/model.py","lineNumber":918,"sourceCode":"            return value\n        return handler(value)\n\n    @field_validator(\"tokenizer_mode\", mode=\"after\")\n    def _lowercase_tokenizer_mode(cls, tokenizer_mode: str) -> str:\n        return tokenizer_mode.lower()\n\n    @field_validator(\"quantization\", mode=\"before\")\n    @classmethod\n    def validate_quantization_before(cls, value: Any) -> Any:\n        if isinstance(value, str):\n            return value.lower()\n        return value\n\n    @model_validator(mode=\"after\")\n    def validate_model_config_after(self: \"ModelConfig\") -> \"ModelConfig\":\n        \"\"\"Called after __post_init__\"\"\"\n        if not isinstance(self.tokenizer, str):\n            raise ValueError(\n                f\"tokenizer must be a string, got \"\n                f\"{type(self.tokenizer).__name__}: {self.tokenizer!r}. \"\n                \"Please provide a valid tokenizer path or HuggingFace model ID.\"\n            )\n        if not isinstance(self.max_model_len, int) or self.max_model_len < 1:\n            raise ValueError(\n                f\"max_model_len must be a positive integer, \"\n                f\"got {type(self.max_model_len).__name__}: {self.max_model_len!r}. \"\n                \"Example: max_model_len=2048\"\n            )\n        return self\n\n    def _resolve_mm_device_do_normalize(\n        self, mm_device_do_normalize: bool | None\n    ) -> bool:\n        if mm_device_do_normalize is None:\n            if envs.VLLM_USE_RUST_FRONTEND:\n                logger.debug(","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/model.py#L900-L936","documentation":"Error \"tokenizer must be a string, got {type(self.tokenizer).__name__}: {self.tokenizer!r}. Please provide a valid tokenizer path or HuggingFace model ID.\" thrown in vllm-project/vllm.","triggerScenarios":"Raised at vllm/config/model.py:918 when validation fails: tokenizer must be a string (valid tokenizer path or HuggingFace model ID). Typically triggered by an incompatible or incomplete vLLM configuration, an unsupported platform/backend combination, or a runtime resource/dependency that is missing.","commonSituations":"Commonly encountered at vllm/config/model.py:918 during vLLM startup/config validation or runtime setup when: (1) conflicting CLI flags or config fields are combined, (2) the current platform (CUDA/ROCm/CPU/XPU) or installed optional packages do not support the requested feature, or (3) a required value is absent or out of range. Resolve by correcting the configuration as described in the message, or by selecting a supported alternative.","solutions":["Pass the tokenizer as a string path or HuggingFace model ID, not an object."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}