roboflow/supervision · error · ValueError

Unsupported VLM value: {vlm}.

Error message

Unsupported VLM value: {vlm}.

What it means

Raised by Detections.from_vlm when the vlm argument does not match any supported vision-language-model backend. The dispatcher pattern-matches known VLM enums (Paligemma, Florence-2, Qwen, Google Gemini etc.) and this ValueError is the fall-through for anything else, including raw strings, misspelled names, or None.

Source

Thrown at src/supervision/detection/core.py:2139

                data=data,
            )

        if vlm == VLM.GOOGLE_GEMINI_3_5:
            if not isinstance(result, str):
                raise ValueError(
                    f"Invalid VLM result type: {type(result)}. Must be str."
                )
            gemini_result = from_google_gemini_3_5(result, **kwargs)
            data = {CLASS_NAME_DATA_FIELD: gemini_result[2]}
            return cls(
                xyxy=gemini_result[0],
                class_id=gemini_result[1],
                mask=gemini_result[4],
                confidence=gemini_result[3],
                data=data,
            )

        raise ValueError(f"Unsupported VLM value: {vlm}.")

    @classmethod
    def from_easyocr(cls, easyocr_results: list[Any]) -> Detections:
        """
        Create a Detections object from the
        [EasyOCR](https://github.com/JaidedAI/EasyOCR) result.

        Results are placed in the `data` field with the key `"class_name"`.
        When EasyOCR returns quadrilateral corners, the original corners are
        preserved in ``ORIENTED_BOX_COORDINATES``. Call EasyOCR with
        ``detail=1`` so bounding boxes are available; ``detail=0`` returns text
        strings only and cannot be converted into detections.

        Args:
            easyocr_results: The output Results instance from EasyOCR.

        Returns:
            A new Detections object.

View on GitHub (pinned to 7f254d9784)

Solutions

  1. Pass a supported sv.VLM enum value, e.g. sv.Detections.from_vlm(result, vlm=sv.VLM.GOOGLE_GEMINI_2_0 or the version installed in your supervision release).
  2. Check the VLM enum members available in your installed version: print(list(sv.VLM)) and use one of those exactly.
  3. For unsupported models, parse the model output yourself and construct sv.Detections(xyxy=..., class_id=..., confidence=...) manually.
  4. Upgrade supervision if the backend you need exists in a newer release.

Example fix

# before
dets = sv.Detections.from_vlm(result, vlm="gemini")

# after
import supervision as sv
dets = sv.Detections.from_vlm(result, vlm=sv.VLM.GOOGLE_GEMINI_2_0)
Defensive patterns

Strategy: type-guard

Validate before calling

import supervision as sv
supported = set(sv.VLM)
assert my_vlm in supported, f"unsupported VLM {my_vlm!r}; choose from {sorted(map(str, supported))}"

Type guard

import supervision as sv

def is_supported_vlm(value) -> bool:
    return isinstance(value, sv.VLM)

Try / catch

try:
    dets = sv.Detections.from_vlm(result, vlm=vlm)
except ValueError as e:
    if "Unsupported VLM" in str(e):
        dets = parse_result_manually(result)  # build sv.Detections yourself
    else:
        raise

Prevention

When it happens

Trigger: Calling sv.Detections.from_vlm(result, vlm="gpt-4v") or vlm="gemini" (unsupported/misspelled value), or passing the model output string instead of the VLM enum, or None when result type cannot disambiguate the backend.

Common situations: Newer/other VLM providers not yet integrated; users passing lowercase strings instead of the supervision VLM enum; passing a model name loaded from config without validating it against supported values; version differences where an enum member was added/renamed.

Related errors


AI-assisted analysis of roboflow/supervision@7f254d9784 (2026-08-15). Data as JSON: /api/errors/0a20f11697683428. Report an issue: GitHub.