Skip to content

DoclingRemoteConfig

Base classes

Name Children Inherits
BaseConverterConfig
docler_config.converter_configs
Base configuration for document converters.

⋔ Inheritance diagram

graph TD
  3488698160["converter_configs.DoclingRemoteConfig"]
  2232753316["converter_configs.BaseConverterConfig"]
  1396724084["provider.ProviderConfig"]
  1261767679["main.BaseSettings"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2232753316 --> 3488698160
  1396724084 --> 2232753316
  1261767679 --> 1396724084
  3879467795 --> 1261767679
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseConverterConfig

Configuration for remote Docling service.

Source code in src/docler_config/converter_configs.py
class DoclingRemoteConfig(BaseConverterConfig):
    """Configuration for remote Docling service."""

    type: Literal["docling_remote"] = Field("docling_remote", init=False)
    """Type discriminator for remote docling converter."""

    languages: set[SupportedLanguage] = Field(default_factory=default_languages)
    """List of supported languages for the converter."""

    api_key: SecretStr | None = None
    """Optional API key for auth."""

    endpoint: HttpUrl = HttpUrl("http://localhost:5001")
    """Base URL of the Docling service."""

    timeout: float = Field(default=300.0, gt=0)
    """HTTP timeout in seconds (large PDFs take minutes). Env: DOCLING_REMOTE_TIMEOUT."""

    ocr_engine: DoclingEngine = "easy_ocr"
    """OCR engine to use."""

    pdf_backend: str = "dlparse_v4"
    """PDF backend to use."""

    table_mode: Literal["fast", "accurate"] = "fast"
    """Table mode to use."""

    force_ocr: bool = False
    """Whether to force OCR even on digital documents."""

    image_scale: float = Field(default=2.0, gt=0)
    """Scale factor for image resolution."""

    do_table_structure: bool = True
    """Extract table structure."""

    do_code_enrichment: bool = False
    """Enable code extraction."""

    do_formula_enrichment: bool = False
    """Enable formula extraction."""

    do_picture_classification: bool = False
    """Enable picture classification."""

    do_picture_description: bool = False
    """Enable picture description."""

    model_config = SettingsConfigDict(env_prefix="DOCLING_REMOTE_")

    def get_provider(self) -> DocumentConverter:
        """Get the converter instance."""
        from docler.converters.docling_remote_provider import DoclingRemoteConverter

        return DoclingRemoteConverter(**self.get_config_fields())

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

Optional API key for auth.

do_code_enrichment class-attribute instance-attribute

do_code_enrichment: bool = False

Enable code extraction.

do_formula_enrichment class-attribute instance-attribute

do_formula_enrichment: bool = False

Enable formula extraction.

do_picture_classification class-attribute instance-attribute

do_picture_classification: bool = False

Enable picture classification.

do_picture_description class-attribute instance-attribute

do_picture_description: bool = False

Enable picture description.

do_table_structure class-attribute instance-attribute

do_table_structure: bool = True

Extract table structure.

endpoint class-attribute instance-attribute

endpoint: HttpUrl = HttpUrl('http://localhost:5001')

Base URL of the Docling service.

force_ocr class-attribute instance-attribute

force_ocr: bool = False

Whether to force OCR even on digital documents.

image_scale class-attribute instance-attribute

image_scale: float = Field(default=2.0, gt=0)

Scale factor for image resolution.

languages class-attribute instance-attribute

languages: set[SupportedLanguage] = Field(default_factory=default_languages)

List of supported languages for the converter.

ocr_engine class-attribute instance-attribute

ocr_engine: DoclingEngine = 'easy_ocr'

OCR engine to use.

pdf_backend class-attribute instance-attribute

pdf_backend: str = 'dlparse_v4'

PDF backend to use.

table_mode class-attribute instance-attribute

table_mode: Literal['fast', 'accurate'] = 'fast'

Table mode to use.

timeout class-attribute instance-attribute

timeout: float = Field(default=300.0, gt=0)

HTTP timeout in seconds (large PDFs take minutes). Env: DOCLING_REMOTE_TIMEOUT.

type class-attribute instance-attribute

type: Literal['docling_remote'] = Field('docling_remote', init=False)

Type discriminator for remote docling converter.

get_provider

get_provider() -> DocumentConverter

Get the converter instance.

Source code in src/docler_config/converter_configs.py
def get_provider(self) -> DocumentConverter:
    """Get the converter instance."""
    from docler.converters.docling_remote_provider import DoclingRemoteConverter

    return DoclingRemoteConverter(**self.get_config_fields())

:fa-brands-github: Show source on GitHub