{"record":{"id":"121b57647fa81cc0","repo":"docling-project/docling","slug":"threadedlayoutvlmpipeline-only-supports-doctags-re","errorCode":null,"errorMessage":"ThreadedLayoutVlmPipeline only supports DOCTAGS response format, but got {self.vlm_options.response_format}. Please set vlm_options.response_format=ResponseFormat.DOCTAGS","messagePattern":"ThreadedLayoutVlmPipeline only supports DOCTAGS response format, but got (.+?)\\. Please set vlm_options\\.response_format=ResponseFormat\\.DOCTAGS","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"docling/experimental/datamodel/threaded_layout_vlm_pipeline_options.py","lineNumber":45,"sourceCode":"        GRANITEDOCLING_2STAGE_TRANSFORMERS\n    )\n\n    # Layout model configuration\n    layout_options: BaseLayoutOptions = Field(\n        default_factory=lambda: LayoutObjectDetectionOptions(skip_cell_assignment=True),\n    )\n\n    # Threading and batching controls\n    layout_batch_size: int = 4\n    vlm_batch_size: int = 4\n    batch_timeout_seconds: float = 2.0\n    queue_max_size: int = 50\n\n    @model_validator(mode=\"after\")\n    def validate_response_format(self):\n        \"\"\"Validate that VLM response format is DOCTAGS (required for this pipeline).\"\"\"\n        if self.vlm_options.response_format != ResponseFormat.DOCTAGS:\n            raise ValueError(\n                f\"ThreadedLayoutVlmPipeline only supports DOCTAGS response format, \"\n                f\"but got {self.vlm_options.response_format}. \"\n                f\"Please set vlm_options.response_format=ResponseFormat.DOCTAGS\"\n            )\n        return self\n","sourceCodeStart":27,"sourceCodeEnd":51,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/experimental/datamodel/threaded_layout_vlm_pipeline_options.py#L27-L51","documentation":"Pydantic ValidationError raised by the model_validator on ThreadedLayoutVlmPipelineOptions: this experimental threaded pipeline can only consume VLM output in DOCTAGS format, so any other vlm_options.response_format is rejected at options-construction time.","triggerScenarios":"Building ThreadedLayoutVlmPipelineOptions with vlm_options whose response_format is MARKDOWN or JSON (e.g. reusing VlmPipelineOptions configured for the standard VLM pipeline).","commonSituations":"Copy-pasting options from StandardPdfPipeline VLM usage where MARKDOWN is common; sharing a global vlm_options object between the standard and threaded pipelines.","solutions":["Set response_format=ResponseFormat.DOCTAGS on the nested vlm_options before constructing ThreadedLayoutVlmPipelineOptions.","Do not share one VlmOptions instance across pipeline types; clone and adjust per pipeline.","If you need MARKDOWN/JSON output, use the standard VlmPipeline instead of the threaded variant."],"exampleFix":"# before\nvlm_opts = VlmOptions(response_format=ResponseFormat.MARKDOWN)\nopts = ThreadedLayoutVlmPipelineOptions(vlm_options=vlm_opts)  # ValidationError\n\n# after\nvlm_opts = VlmOptions(response_format=ResponseFormat.DOCTAGS)\nopts = ThreadedLayoutVlmPipelineOptions(vlm_options=vlm_opts)","handlingStrategy":"validation","validationCode":"from docling.datamodel.pipeline_options_vlm_model import ResponseFormat\nif vlm_opts.response_format != ResponseFormat.DOCTAGS:\n    vlm_opts = vlm_opts.model_copy(update={'response_format': ResponseFormat.DOCTAGS})","typeGuard":"def is_doctags(opts) -> bool:\n    return getattr(getattr(opts, 'vlm_options', opts), 'response_format', None) is not None and opts.vlm_options.response_format == ResponseFormat.DOCTAGS","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    opts = ThreadedLayoutVlmPipelineOptions(vlm_options=vlm_opts)\nexcept ValidationError as e:\n    if 'DOCTAGS' in str(e):\n        vlm_opts.response_format = ResponseFormat.DOCTAGS\n        opts = ThreadedLayoutVlmPipelineOptions(vlm_options=vlm_opts)","preventionTips":["Construct vlm_options with response_format=ResponseFormat.DOCTAGS inline for the threaded pipeline.","Never share a mutable vlm_options object between standard and threaded pipelines."],"tags":["vlm","validation","pipeline-options","doctags"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}