{"record":{"id":"ba7c8105f12ad16b","repo":"docling-project/docling","slug":"connections-to-remote-services-is-only-allowed-whe-ba7c81","errorCode":null,"errorMessage":"Connections to remote services is only allowed when set explicitly. pipeline_options.enable_remote_services=True.","messagePattern":"Connections to remote services is only allowed when set explicitly\\. pipeline_options\\.enable_remote_services=True\\.","errorType":"exception","errorClass":"OperationNotAllowed","httpStatus":null,"severity":"error","filePath":"docling/models/stages/picture_description/picture_description_api_model.py","lineNumber":46,"sourceCode":"        enabled: bool,\n        enable_remote_services: bool,\n        artifacts_path: Optional[Union[Path, str]],\n        options: PictureDescriptionApiOptions,\n        accelerator_options: AcceleratorOptions,\n    ):\n        super().__init__(\n            enabled=enabled,\n            enable_remote_services=enable_remote_services,\n            artifacts_path=artifacts_path,\n            options=options,\n            accelerator_options=accelerator_options,\n        )\n        self.options: PictureDescriptionApiOptions\n        self.concurrency = self.options.concurrency\n\n        if self.enabled:\n            if not enable_remote_services:\n                raise OperationNotAllowed(\n                    \"Connections to remote services is only allowed when set explicitly. \"\n                    \"pipeline_options.enable_remote_services=True.\"\n                )\n\n    def _annotate_images(\n        self, images: Iterable[Image.Image]\n    ) -> Iterable[ApiImageRequestResult]:\n        # Note: technically we could make a batch request here,\n        # but not all APIs will allow for it. For example, vllm won't allow more than 1.\n        def _api_request(image):\n            return api_image_request(\n                image=image,\n                prompt=self.options.prompt,\n                url=self.options.url,\n                timeout=self.options.timeout,\n                headers=self.options.headers,\n                usage_response_key=self.options.usage_response_key,\n                **self.options.params,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/stages/picture_description/picture_description_api_model.py#L28-L64","documentation":"The API-based picture description model calls out to a remote HTTP endpoint. Because that exfiltrates document content, Docling refuses to run it unless the user explicitly opts in with enable_remote_services=True on the pipeline options; otherwise OperationNotAllowed is raised at model init.","triggerScenarios":"Using PictureDescriptionApiOptions (e.g. pointing at an OpenAI-compatible/vLLM endpoint) while pipeline_options.enable_remote_services is left at its default False.","commonSituations":"Copy-pasting examples that configure picture_description_api_model without adding enable_remote_services=True; privacy-conscious defaults surprising users who intended to call their own local-but-remote-hosted vLLM service.","solutions":["Opt in explicitly: pipeline_options = PdfPipelineOptions(); pipeline_options.enable_remote_services = True.","If the service is actually local, still set the flag (it governs any non-local socket), or switch to a local VLM model to avoid remote calls entirely.","For privacy-sensitive documents, keep the flag off and use a locally hosted model (picture_description_vlm_model)."],"exampleFix":"# before\npipeline_options.ocr_options ...\nmodel = PictureDescriptionApiModel(options=PictureDescriptionApiOptions(url=...))\n\n# after\npipeline_options.enable_remote_services = True\nmodel = PictureDescriptionApiModel(\n    enabled=True,\n    enable_remote_services=True,\n    options=PictureDescriptionApiOptions(url=...),\n)","handlingStrategy":"validation","validationCode":"if options.url and not pipeline_options.enable_remote_services:\n    raise PermissionError(\n        \"picture description API requires explicit opt-in: \"\n        \"pipeline_options.enable_remote_services = True\"\n    )","typeGuard":null,"tryCatchPattern":"from docling_core.transforms.node_errors import OperationNotAllowed\n\ntry:\n    model = PictureDescriptionApiModel(options=opts, enable_remote_services=False)\nexcept OperationNotAllowed:\n    log.error(\"remote calls blocked; enable_remote_services=True required for API descriptions\")\n    raise","preventionTips":["Centralize the enable_remote_services decision in one deployment config.","For sensitive documents keep the flag off and use local VLM models.","Audit configs for API-based picture description models to confirm the flag is intentional."],"tags":["privacy","remote-services","pictures","configuration","security"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}