{"record":{"id":"4580b92353694683","repo":"BerriAI/litellm","slug":"ocr-is-not-supported-for-provider-custom-llm-pro","errorCode":null,"errorMessage":"OCR is not supported for provider: {custom_llm_provider}","messagePattern":"OCR is not supported for provider: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/ocr/main.py","lineNumber":120,"sourceCode":"    )\n\n    suppress_dynamic_api_base: Final = (\n        not caller_supplied_api_base\n        and custom_llm_provider == \"azure_ai\"\n        and is_azure_document_intelligence_model(model)\n    )\n    if dynamic_api_key:\n        api_key = dynamic_api_key\n    if dynamic_api_base and not suppress_dynamic_api_base:\n        api_base = dynamic_api_base\n\n    ocr_provider_config: Final = ProviderConfigManager.get_provider_ocr_config(\n        model=model,\n        provider=litellm.LlmProviders(custom_llm_provider),\n    )\n\n    if ocr_provider_config is None:\n        raise ValueError(f\"OCR is not supported for provider: {custom_llm_provider}\")\n\n    verbose_logger.debug(\"OCR call - model: %s, provider: %s\", model, custom_llm_provider)\n\n    litellm_params: Final = GenericLiteLLMParams.model_validate(kwargs)\n\n    supported_params: Final = ocr_provider_config.get_supported_ocr_params(model=model)\n    non_default_params: Final = {}\n    for param in supported_params:\n        if param in kwargs:\n            non_default_params[param] = kwargs.pop(param)\n\n    optional_params: Final = ocr_provider_config.map_ocr_params(\n        non_default_params=non_default_params,\n        optional_params={},\n        model=model,\n    )\n\n    verbose_logger.debug(\"OCR optional_params after mapping: %s\", optional_params)","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/ocr/main.py#L102-L138","documentation":"Raised during OCR request preparation when ProviderConfigManager has no OCR handler registered for the resolved provider — i.e. litellm.LlmProviders(custom_llm_provider) names a provider for which LiteLLM implements no /ocr transformation. The request never leaves the router; the caller must use a provider with OCR support (or go through a supported integration such as azure_ai document intelligence).","triggerScenarios":"Thrown at litellm/ocr/main.py:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a provider that supports OCR (e.g. mistral, vertex_ai) for the OCR request.","Check the litellm docs for the list of OCR-capable providers and adjust the model/provider prefix."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}