{"record":{"id":"b3f1e380439939c1","repo":"roboflow/supervision","slug":"invalid-value-type-type-value-must-be-an-inst","errorCode":null,"errorMessage":"Invalid value type: {type(value)}. Must be an instance of {cls.__name__} or str.","messagePattern":"Invalid value type: (.+?)\\. Must be an instance of (.+?) or str\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/detection/vlm.py","lineNumber":68,"sourceCode":"    @classmethod\n    def list(cls) -> list[str]:\n        return [c.value for c in cls]\n\n    @classmethod\n    def from_value(cls, value: LMM | str) -> LMM:\n        warn_deprecated(\n            \"`LMM` is deprecated since `supervision-0.27.0` and will be removed in \"\n            \"`supervision-0.31.0`. Use `VLM` instead.\"\n        )\n        if isinstance(value, cls):\n            return value\n        if isinstance(value, str):\n            value = value.lower()\n            try:\n                return cls(value)\n            except ValueError:\n                raise ValueError(f\"Invalid value: {value}. Must be one of {cls.list()}\")\n        raise ValueError(\n            f\"Invalid value type: {type(value)}. Must be an instance of \"\n            f\"{cls.__name__} or str.\"\n        )\n\n\nclass VLM(Enum):\n    \"\"\"\n    Enum specifying supported Vision-Language Models (VLMs).\n\n    Attributes:\n        PALIGEMMA: Google's PaliGemma vision-language model.\n        FLORENCE_2: Microsoft's Florence-2 vision-language model.\n        QWEN_2_5_VL: Qwen2.5-VL open vision-language model from Alibaba.\n        QWEN_3_VL: Qwen3-VL open vision-language model from Alibaba.\n        GOOGLE_GEMINI_2_0: Google Gemini 2.0 vision-language model.\n        GOOGLE_GEMINI_2_5: Google Gemini 2.5 vision-language model.\n        GOOGLE_GEMINI_3_5: Google Gemini 3.5 vision-language model.\n        MOONDREAM: The Moondream vision-language model.","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/detection/vlm.py#L50-L86","documentation":"Error \"Invalid value type: {type(value)}. Must be an instance of {cls.__name__} or str.\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/detection/vlm.py:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either the enum member (e.g. VLM.PALIGEMMA) or its string value, not another type.","Convert your value with the enum's constructor, e.g. VLM(value) or cls(value), before passing it in."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}