roboflow/supervision · warning · ValueError
Invalid value: {value}. Must be one of {cls.list()}
Error message
Invalid value: {value}. Must be one of {cls.list()} What it means
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.
Source
Thrown at src/supervision/detection/vlm.py:67
@classmethod
def list(cls) -> list[str]:
return [c.value for c in cls]
@classmethod
def from_value(cls, value: LMM | str) -> LMM:
warn_deprecated(
"`LMM` is deprecated since `supervision-0.27.0` and will be removed in "
"`supervision-0.31.0`. Use `VLM` instead."
)
if isinstance(value, cls):
return value
if isinstance(value, str):
value = value.lower()
try:
return cls(value)
except ValueError:
raise ValueError(f"Invalid value: {value}. Must be one of {cls.list()}")
raise ValueError(
f"Invalid value type: {type(value)}. Must be an instance of "
f"{cls.__name__} or str."
)
class VLM(Enum):
"""
Enum specifying supported Vision-Language Models (VLMs).
Attributes:
PALIGEMMA: Google's PaliGemma vision-language model.
FLORENCE_2: Microsoft's Florence-2 vision-language model.
QWEN_2_5_VL: Qwen2.5-VL open vision-language model from Alibaba.
QWEN_3_VL: Qwen3-VL open vision-language model from Alibaba.
GOOGLE_GEMINI_2_0: Google Gemini 2.0 vision-language model.
GOOGLE_GEMINI_2_5: Google Gemini 2.5 vision-language model.
GOOGLE_GEMINI_3_5: Google Gemini 3.5 vision-language model.View on GitHub (pinned to 7f254d9784)
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.
Example fix
# before
from supervision.detection.vlm import LMM
model = LMM.from_value("qwen-2.5-vl")
# after
from supervision.detection.vlm import VLM
model = VLM.from_value("qwen-2.5-vl") Defensive patterns
Strategy: validation
Validate before calling
from supervision.detection.vlm import LMM
valid = set(LMM.list())
if value.lower() not in valid:
raise ValueError(f"Unsupported LMM {value!r}; valid: {sorted(valid)}") Type guard
def is_valid_lmm_name(name: str) -> bool:
return name.lower() in set(LMM.list()) Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unsupported VLM value: {vlm}.
- Invalid vlm value: {vlm}. Must be one of {[e.value for e in
- Cannot pass both 'confidence' and 'keypoint_confidence'. 'co
- Invalid asset. It should be one of the following: {valid_ass
- {anchor} is not supported.
AI-assisted analysis of roboflow/supervision@7f254d9784 (2026-08-15).
Data as JSON: /api/errors/30ab0b2b81c352c5.
Report an issue: GitHub.