{"record":{"id":"39520001e86faf5e","repo":"BerriAI/litellm","slug":"get-complete-url-must-be-implemented-by-provider","errorCode":null,"errorMessage":"get_complete_url must be implemented by provider","messagePattern":"get_complete_url must be implemented by provider","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/ocr/transformation.py","lineNumber":149,"sourceCode":"        \"\"\"\n        Validate environment and return headers.\n        Override in provider-specific implementations.\n        \"\"\"\n        return headers\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict | None = None,\n        **kwargs,\n    ) -> str:\n        \"\"\"\n        Get complete URL for OCR endpoint.\n        Override in provider-specific implementations.\n        \"\"\"\n        raise NotImplementedError(\"get_complete_url must be implemented by provider\")\n\n    def transform_ocr_request(\n        self,\n        model: str,\n        document: DocumentType,\n        optional_params: dict,\n        headers: dict,\n        **kwargs,\n    ) -> 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:","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/base_llm/ocr/transformation.py#L131-L167","documentation":"Base OCR transformation stub: the generic get_complete_url for OCR raises NotImplementedError because each OCR provider builds a different endpoint URL. Hitting it means a provider config was used that did not override URL construction, so litellm cannot know where to send the OCR request.","triggerScenarios":"Calling litellm.ocr / the document-reading API with a provider whose config inherits the base get_complete_url (missing override); a new OCR integration half-implemented; provider name typo resolving to a generic config.","commonSituations":"Adding a custom OCR provider but only implementing transform_ocr_request; version skew where an older litellm lacks a concrete provider's URL method; dispatch selecting the base config due to unknown provider string.","solutions":["Use a provider whose OCR config fully implements get_complete_url (e.g. the built-in azure/gemini document configs).","Custom providers: override get_complete_url to return the provider's OCR endpoint.","Verify the model string maps to the intended provider config in the provider registry.","Upgrade litellm if the provider's OCR support landed in a newer release."],"exampleFix":"# before\nclass MyOCRConfig(BaseOCRConfig):  # no get_complete_url\n    ...\nlitellm.ocr(model='my-proc/doc', document=doc)\n\n# after\nclass MyOCRConfig(BaseOCRConfig):\n    def get_complete_url(self, api_base, model, optional_params, litellm_params=None, **kwargs):\n        return f'{api_base}/v1/documents:parse'","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def ocr_config_is_complete(config) -> bool:\n    return type(config).get_complete_url is not BaseOCRConfig.get_complete_url","tryCatchPattern":"try:\n    url = config.get_complete_url(api_base, model, {})\nexcept NotImplementedError:\n    raise ConfigError(f'{type(config).__name__} lacks OCR URL construction; use a supported provider') from None","preventionTips":["At provider registration, assert required OCR hooks are overridden.","Prefer built-in OCR providers unless you can implement the full contract.","Pin litellm versions and re-run provider smoke tests on upgrade."],"tags":["ocr","not-implemented","url-construction","provider-config"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}