{"record":{"id":"30ab0b2b81c352c5","repo":"roboflow/supervision","slug":"invalid-value-value-must-be-one-of-cls-list","errorCode":null,"errorMessage":"Invalid value: {value}. Must be one of {cls.list()}","messagePattern":"Invalid value: (.+?)\\. Must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"src/supervision/detection/vlm.py","lineNumber":67,"sourceCode":"\n    @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.","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/detection/vlm.py#L49-L85","documentation":"Raised by the deprecated LMM enum's from_value classmethod when a string cannot be converted to an LMM member (after lowercasing). LMM was replaced by VLM in supervision-0.27.0 and is scheduled for removal in 0.31.0, so this error also signals you are on a legacy API surface with a smaller, outdated set of model values.","triggerScenarios":"Calling LMM.from_value('qwen-3-vl') or any name not in the legacy LMM enum; using old notebook code with new model names, or a typo in the model string.","commonSituations":"Running pre-0.27 example code on newer model names; models added to VLM after LMM was frozen; teams migrating from LMM to VLM piecemeal.","solutions":["Migrate to the VLM enum and VLM.from_value / from_vlm; LMM is deprecated and will be removed.","Print the supported values: python -c \"from supervision.detection.vlm import LMM; print(LMM.list())\" and use one exactly.","Pass the enum member LMM.PALIGEMMA etc. rather than a string."],"exampleFix":"# before\n from supervision.detection.vlm import LMM\n model = LMM.from_value(\"qwen-2.5-vl\")\n\n# after\n from supervision.detection.vlm import VLM\n model = VLM.from_value(\"qwen-2.5-vl\")","handlingStrategy":"validation","validationCode":"from supervision.detection.vlm import LMM\n\nvalid = set(LMM.list())\nif value.lower() not in valid:\n    raise ValueError(f\"Unsupported LMM {value!r}; valid: {sorted(valid)}\")","typeGuard":"def is_valid_lmm_name(name: str) -> bool:\n    return name.lower() in set(LMM.list())","tryCatchPattern":null,"preventionTips":["Migrate off LMM to VLM before supervision 0.31.0 removes it.","Never feed HuggingFace model ids into from_value.","Pin the supervision version while legacy LMM code is still in use."],"tags":["deprecation","enum","vlm","migration"],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}