{"record":{"id":"4c84698120450af5","repo":"docling-project/docling","slug":"could-not-instantiate-the-right-type-of-vlm-pipeli","errorCode":null,"errorMessage":"Could not instantiate the right type of VLM pipeline: {vlm_options.inference_framework}","messagePattern":"Could not instantiate the right type of VLM pipeline: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"docling/pipeline/vlm_pipeline.py","lineNumber":203,"sourceCode":"                        enabled=True,\n                        artifacts_path=self.artifacts_path,\n                        accelerator_options=pipeline_options.accelerator_options,\n                        vlm_options=vlm_options,\n                    ),\n                ]\n            elif vlm_options.inference_framework == InferenceFramework.VLLM:\n                from docling.models.vlm_pipeline_models.vllm_model import VllmVlmModel\n\n                self.build_pipe = [\n                    VllmVlmModel(\n                        enabled=True,\n                        artifacts_path=self.artifacts_path,\n                        accelerator_options=pipeline_options.accelerator_options,\n                        vlm_options=vlm_options,\n                    ),\n                ]\n            else:\n                raise ValueError(\n                    f\"Could not instantiate the right type of VLM pipeline: {vlm_options.inference_framework}\"\n                )\n\n    def initialize_page(self, conv_res: ConversionResult, page: Page) -> Page:\n        with TimeRecorder(conv_res, \"page_init\"):\n            images_scale = self.pipeline_options.images_scale\n            if images_scale is not None:\n                page._default_image_scale = images_scale\n            _raise_if_unsupported_threaded_backend(\n                conv_res.input._backend, self.__class__.__name__\n            )\n            page._backend = conv_res.input._backend.load_page(page.page_no - 1)  # type: ignore\n            if page._backend is not None and page._backend.is_valid():\n                page.size = page._backend.get_size()\n\n                if self.force_backend_text:\n                    page.parsed_page = page._backend.get_segmented_page()\n","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/pipeline/vlm_pipeline.py#L185-L221","documentation":"When VlmPipeline builds its model stack, it dispatches on vlm_options.inference_framework and knows how to construct models for a fixed set of frameworks (Transformers, vLLM, API, etc.). Reaching the else branch means the enum value does not match any supported branch, so no model can be instantiated. In practice this happens when a custom InferenceFramework value or an unknown/unsupported framework is set on the VLM options.","triggerScenarios":"Setting VlmPipelineOptions.vlm_options.inference_framework to a value outside the handled branches (e.g. a user-extended enum member or a typo string when constructing options); passing a model preset whose inference_framework was mutated after creation; running a newer vlm_options schema against older pipeline code that lacks that framework's branch.","commonSituations":"model_copy(deep=True) on a preset then changing inference_framework to an experimental framework the installed docling does not support; version mismatch after upgrading one half of the VLM stack; constructing InlineVlmOptions manually with a wrong framework constant.","solutions":["Set inference_framework to a supported value from InferenceFramework in docling.datamodel.pipeline_options_vlm_model (e.g. API, TRANSFORMERS, VLLM) matching the installed docling version.","Prefer a built-in preset (e.g. SMOLDOCLING_VLLM, GRANITE_VISION_OLLAMA) over hand-built options so the framework is always consistent.","Upgrade docling to a release that supports the framework you need.","If extending InferenceFramework yourself, also patch the pipeline's build_pipe dispatch to handle the new member."],"exampleFix":"# before\nvlm_options = InlineVlmOptions(inference_framework='tensorrt', ...)  # unsupported\npipeline = VlmPipeline(VlmPipelineOptions(vlm_options=vlm_options))\n\n# after\nfrom docling.datamodel.pipeline_options_vlm_model import InferenceFramework\nvlm_options = InlineVlmOptions(inference_framework=InferenceFramework.VLLM, ...)","handlingStrategy":"validation","validationCode":"from docling.datamodel.pipeline_options_vlm_model import InferenceFramework\n\ndef framework_supported(fw) -> bool:\n    return fw in {InferenceFramework.API, InferenceFramework.TRANSFORMERS, InferenceFramework.VLLM}","typeGuard":null,"tryCatchPattern":"try:\n    pipeline = VlmPipeline(options)\nexcept ValueError as e:\n    if 'inference framework' in str(e) or 'instantiate' in str(e):\n        options.vlm_options.inference_framework = InferenceFramework.API","preventionTips":["Use built-in VLM presets whose inference_framework is guaranteed valid.","Don't mutate inference_framework on copied presets to unsupported values.","Match docling version with the framework you need."],"tags":["vlm","configuration","inference-framework","options"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}