{"record":{"id":"2443a03556b10eb4","repo":"roboflow/supervision","slug":"invalid-lmm-string-lmm-must-be-one-of-m-val","errorCode":null,"errorMessage":"Invalid LMM string '{lmm}'. Must be one of {[m.value for m in LMM]}","messagePattern":"Invalid LMM string '(.+?)'\\. Must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/detection/core.py","lineNumber":1597,"sourceCode":"            ```\n        \"\"\"  # noqa: E501\n\n        warn_deprecated(\n            \"`Detections.from_lmm` is deprecated since `supervision-0.26.0` \"\n            \"and will be removed in `supervision-0.31.0`. \"\n            \"Use `Detections.from_vlm` instead.\"\n        )\n\n        # LMM and VLM are mirror enums (identical string values) so value-based\n        # lookup is exhaustive by construction — no hand-maintained mapping needed.\n        if isinstance(lmm, LMM):\n            vlm = VLM(lmm.value)\n\n        elif isinstance(lmm, str):\n            try:\n                lmm_enum = LMM(lmm.lower())\n            except ValueError:\n                raise ValueError(\n                    f\"Invalid LMM string '{lmm}'. Must be one of \"\n                    f\"{[m.value for m in LMM]}\"\n                )\n            vlm = VLM(lmm_enum.value)\n\n        else:\n            raise ValueError(\n                f\"Invalid type for 'lmm': {type(lmm)}. Must be LMM or str.\"\n            )\n\n        return cls.from_vlm(vlm=vlm, result=result, **kwargs)\n\n    @classmethod\n    def from_vlm(\n        cls, vlm: VLM | str, result: str | dict[str, Any], **kwargs: Any\n    ) -> Detections:\n        \"\"\"\n","sourceCodeStart":1579,"sourceCodeEnd":1615,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/detection/core.py#L1579-L1615","documentation":"Error \"Invalid LMM string '{lmm}'. Must be one of {[m.value for m in LMM]}\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/detection/core.py:1597 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass one of the valid LMM enum values as a string, e.g. 'paligemma' or another value listed in the error message.","Alternatively pass the LMM enum member directly instead of a string."],"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-15T22:17:37.221Z"}