{"record":{"id":"1189fa211e04eb71","repo":"BerriAI/litellm","slug":"transform-ocr-request-must-be-implemented-by-provi","errorCode":null,"errorMessage":"transform_ocr_request must be implemented by provider","messagePattern":"transform_ocr_request must be implemented by provider","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/ocr/transformation.py","lineNumber":176,"sourceCode":"    ) -> OCRRequestData:\n        \"\"\"\n        Transform OCR request to provider-specific format.\n        Override in provider-specific implementations.\n\n        Note: By the time this method is called, any file-type documents have already\n        been converted to document_url/image_url format with base64 data URIs by\n        the preprocessing in litellm/ocr/main.py.\n\n        Args:\n            model: Model name\n            document: Document to process - always a dict with type=\"document_url\" or type=\"image_url\"\n            optional_params: Optional parameters for the request\n            headers: Request headers\n\n        Returns:\n            OCRRequestData with data and files fields\n        \"\"\"\n        raise NotImplementedError(\"transform_ocr_request must be implemented by provider\")\n\n    async def async_transform_ocr_request(\n        self,\n        model: str,\n        document: DocumentType,\n        optional_params: dict,\n        headers: dict,\n        **kwargs,\n    ) -> OCRRequestData:\n        \"\"\"\n        Async transform OCR request to provider-specific format.\n        Optional method - providers can override if they need async transformations\n        (e.g., Azure AI for URL-to-base64 conversion).\n\n        Default implementation falls back to sync transform_ocr_request.\n\n        Args:\n            model: Model name","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/base_llm/ocr/transformation.py#L158-L194","documentation":"Error \"transform_ocr_request must be implemented by provider\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/base_llm/ocr/transformation.py:176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a provider that implements OCR; transform_ocr_request is abstract in the base class.","Implement transform_ocr_request in the custom provider's transformation class.","Verify the model string routes to a provider with OCR support."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}