{"record":{"id":"267c943c8492ddf9","repo":"vllm-project/vllm","slug":"max-model-len-must-be-a-positive-integer-got-typ","errorCode":null,"errorMessage":"max_model_len must be a positive integer, got {type(self.max_model_len).__name__}: {self.max_model_len!r}. Example: max_model_len=2048","messagePattern":"max_model_len must be a positive integer, got (.+?): (.+?)\\. Example: max_model_len=2048","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/model.py","lineNumber":924,"sourceCode":"\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(\n                    \"VLLM_USE_RUST_FRONTEND is set. \"\n                    \"Rust frontend does not currently support mm_device_do_normalize, \"\n                    \"forcing mm_device_do_normalize = False.\"\n                )\n                mm_device_do_normalize = False\n            else:","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/model.py#L906-L942","documentation":"Error \"max_model_len must be a positive integer, got {type(self.max_model_len).__name__}: {self.max_model_len!r}. Example: max_model_len=2048\" thrown in vllm-project/vllm.","triggerScenarios":"Raised at vllm/config/model.py:924 when validation fails: max_model_len must be a positive integer. 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:924 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":["Set max_model_len to a positive integer, e.g. max_model_len=2048."],"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"}