Skip to content

docler_config

Class info

Re-exported classes

Class Module Description
AIDocumentAnnotatorConfig docler_config.annotator_configs Configuration for AI-based document and chunk annotator.
AIImageAnnotatorConfig docler_config.annotator_configs Configuration for AI-based image annotator.
AiChunkerConfig docler_config.chunker_configs Configuration for AI-based chunker.
AzureConfig docler_config.converter_configs Configuration for Azure Document Intelligence converter.
BaseAnnotatorConfig docler_config.annotator_configs Base configuration for annotators.
BaseChunkerConfig docler_config.chunker_configs Base configuration for text chunkers.
BaseConverterConfig docler_config.converter_configs Base configuration for document converters.
BaseProcessorConfig docler_config.processor_configs Base configuration for document processors.
DataLabConfig docler_config.converter_configs Configuration for DataLab-based converter.
DoclingConverterConfig docler_config.converter_configs Configuration for docling-based converter.
LLMConverterConfig docler_config.converter_configs Configuration for LLM-based converter.
LLMProofReaderConfig docler_config.processor_configs Configuration for LLM-based proof reader that improves OCR output.
LlamaIndexChunkerConfig docler_config.chunker_configs Configuration for LlamaIndex chunkers.
LlamaParseConfig docler_config.converter_configs Configuration for LlamaParse-based converter.
MarkItDownConfig docler_config.converter_configs Configuration for MarkItDown-based converter.
MarkdownChunkerConfig docler_config.chunker_configs Configuration for markdown-based chunker.
MarkerConfig docler_config.converter_configs Configuration for Marker-based converter.
MistralConfig docler_config.converter_configs Configuration for Mistral-based converter.
UpstageConfig docler_config.converter_configs Configuration for Upstage Document AI converter.

🛈 DocStrings

Configuration models for Docler components.

LlamaParseMode module-attribute

LlamaParseMode = Literal['parse_page_without_llm', 'parse_page_with_llm', 'parse_page_with_agent']

Legacy LlamaParse parse modes still accepted by the API.

parse_page_with_lvm and parse_document_with_llm were retired upstream; use a LlamaParseTier instead.

AIDocumentAnnotatorConfig

Bases: BaseAnnotatorConfig

Configuration for AI-based document and chunk annotator.

Source code in src/docler_config/annotator_configs.py
class AIDocumentAnnotatorConfig(BaseAnnotatorConfig):
    """Configuration for AI-based document and chunk annotator."""

    type: Literal["ai_document"] = Field(default="ai_document", init=False)
    """Type discriminator for AI document annotator."""

    model: ModelIdentifier = DEFAULT_ANNOTATOR_MODEL
    """LLM model to use for annotation."""

    system_prompt: str = DEFAULT_DOC_SYSTEM_PROMPT
    """System prompt for the annotation task."""

    user_prompt: str = DEFAULT_DOC_PROMPT_TEMPLATE
    """Template for the annotation prompt."""

    max_context_length: int = Field(default=1500, ge=1)
    """Maximum length of context for annotation."""

    batch_size: int = Field(default=5, ge=1)
    """Number of chunks to process in parallel."""

    def get_provider(self) -> AIDocumentAnnotator:
        """Get the annotator instance."""
        from docler.annotators.ai_document_annotator import AIDocumentAnnotator

        return AIDocumentAnnotator(**self.get_config_fields())

batch_size class-attribute instance-attribute

batch_size: int = Field(default=5, ge=1)

Number of chunks to process in parallel.

max_context_length class-attribute instance-attribute

max_context_length: int = Field(default=1500, ge=1)

Maximum length of context for annotation.

model class-attribute instance-attribute

model: ModelIdentifier = DEFAULT_ANNOTATOR_MODEL

LLM model to use for annotation.

system_prompt class-attribute instance-attribute

system_prompt: str = DEFAULT_DOC_SYSTEM_PROMPT

System prompt for the annotation task.

type class-attribute instance-attribute

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

Type discriminator for AI document annotator.

user_prompt class-attribute instance-attribute

user_prompt: str = DEFAULT_DOC_PROMPT_TEMPLATE

Template for the annotation prompt.

get_provider

get_provider() -> AIDocumentAnnotator

Get the annotator instance.

Source code in src/docler_config/annotator_configs.py
def get_provider(self) -> AIDocumentAnnotator:
    """Get the annotator instance."""
    from docler.annotators.ai_document_annotator import AIDocumentAnnotator

    return AIDocumentAnnotator(**self.get_config_fields())

AIImageAnnotatorConfig

Bases: BaseAnnotatorConfig

Configuration for AI-based image annotator.

Source code in src/docler_config/annotator_configs.py
class AIImageAnnotatorConfig(BaseAnnotatorConfig):
    """Configuration for AI-based image annotator."""

    type: Literal["ai_image"] = Field(default="ai_image", init=False)
    """Type discriminator for AI image annotator."""

    model: ModelIdentifier = DEFAULT_IMAGE_ANNOTATOR_MODEL
    """Vision model to use for image annotation."""

    system_prompt: str = DEFAULT_IMAGE_SYSTEM_PROMPT
    """System prompt for the image analysis task."""

    user_prompt: str = DEFAULT_IMAGE_PROMPT_TEMPLATE
    """User prompt template for image analysis."""

    batch_size: int = Field(default=3, ge=1)
    """Number of images to process concurrently."""

    def get_provider(self) -> AIImageAnnotator:
        """Get the annotator instance."""
        from docler.annotators.ai_image_annotator import AIImageAnnotator

        return AIImageAnnotator(**self.get_config_fields())

batch_size class-attribute instance-attribute

batch_size: int = Field(default=3, ge=1)

Number of images to process concurrently.

model class-attribute instance-attribute

model: ModelIdentifier = DEFAULT_IMAGE_ANNOTATOR_MODEL

Vision model to use for image annotation.

system_prompt class-attribute instance-attribute

system_prompt: str = DEFAULT_IMAGE_SYSTEM_PROMPT

System prompt for the image analysis task.

type class-attribute instance-attribute

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

Type discriminator for AI image annotator.

user_prompt class-attribute instance-attribute

user_prompt: str = DEFAULT_IMAGE_PROMPT_TEMPLATE

User prompt template for image analysis.

get_provider

get_provider() -> AIImageAnnotator

Get the annotator instance.

Source code in src/docler_config/annotator_configs.py
def get_provider(self) -> AIImageAnnotator:
    """Get the annotator instance."""
    from docler.annotators.ai_image_annotator import AIImageAnnotator

    return AIImageAnnotator(**self.get_config_fields())

AiChunkerConfig

Bases: BaseChunkerConfig

Configuration for AI-based chunker.

Source code in src/docler_config/chunker_configs.py
class AiChunkerConfig(BaseChunkerConfig):
    """Configuration for AI-based chunker."""

    type: Literal["ai"] = Field(default="ai", init=False)
    """Type discriminator for AI chunker."""

    model: ModelIdentifier = DEFAULT_CHUNKER_MODEL
    """LLM model to use for chunking."""

    system_prompt: str = DEFAULT_CHUNKER_SYSTEM_PROMPT
    """Custom prompt to override default chunk extraction prompt."""

    user_prompt: str = DEFAULT_CHUNKER_USER_TEMPLATE
    """Custom prompt to override default chunk extraction prompt."""

    def get_provider(self) -> AIChunker:
        """Get the chunker instance."""
        from docler.chunkers.ai_chunker import AIChunker

        return AIChunker(**self.get_config_fields())

model class-attribute instance-attribute

model: ModelIdentifier = DEFAULT_CHUNKER_MODEL

LLM model to use for chunking.

system_prompt class-attribute instance-attribute

system_prompt: str = DEFAULT_CHUNKER_SYSTEM_PROMPT

Custom prompt to override default chunk extraction prompt.

type class-attribute instance-attribute

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

Type discriminator for AI chunker.

user_prompt class-attribute instance-attribute

user_prompt: str = DEFAULT_CHUNKER_USER_TEMPLATE

Custom prompt to override default chunk extraction prompt.

get_provider

get_provider() -> AIChunker

Get the chunker instance.

Source code in src/docler_config/chunker_configs.py
def get_provider(self) -> AIChunker:
    """Get the chunker instance."""
    from docler.chunkers.ai_chunker import AIChunker

    return AIChunker(**self.get_config_fields())

AzureConfig

Bases: BaseConverterConfig

Configuration for Azure Document Intelligence converter.

Source code in src/docler_config/converter_configs.py
class AzureConfig(BaseConverterConfig):
    """Configuration for Azure Document Intelligence converter."""

    type: Literal["azure"] = Field("azure", init=False)
    """Type discriminator for Azure converter."""

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

    endpoint: str | None = None
    """Azure endpoint URL. Falls back to AZURE_DOC_INTELLIGENCE_ENDPOINT envvar."""

    api_key: SecretStr | None = None
    """Azure API key. Falls back to AZURE_DOC_INTELLIGENCE_KEY env var (read by the converter)."""

    model: AzureModel = "prebuilt-layout"
    """Pre-trained model to use."""

    additional_features: set[AzureFeatureFlag] = Field(default_factory=set)
    """Optional add-on capabilities like BARCODES, FORMULAS, OCR_HIGH_RESOLUTION etc."""

    model_config = SettingsConfigDict(env_prefix="AZURE_DOC_INTELLIGENCE_")

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

        return AzureConverter(**self.get_config_fields())

additional_features class-attribute instance-attribute

additional_features: set[AzureFeatureFlag] = Field(default_factory=set)

Optional add-on capabilities like BARCODES, FORMULAS, OCR_HIGH_RESOLUTION etc.

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

Azure API key. Falls back to AZURE_DOC_INTELLIGENCE_KEY env var (read by the converter).

endpoint class-attribute instance-attribute

endpoint: str | None = None

Azure endpoint URL. Falls back to AZURE_DOC_INTELLIGENCE_ENDPOINT envvar.

languages class-attribute instance-attribute

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

List of supported languages for the converter.

model class-attribute instance-attribute

model: AzureModel = 'prebuilt-layout'

Pre-trained model to use.

type class-attribute instance-attribute

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

Type discriminator for Azure 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.azure_provider import AzureConverter

    return AzureConverter(**self.get_config_fields())

BaseAnnotatorConfig

Bases: ProviderConfig

Base configuration for annotators.

Source code in src/docler_config/annotator_configs.py
class BaseAnnotatorConfig(ProviderConfig):
    """Base configuration for annotators."""

BaseChunkerConfig

Bases: ProviderConfig

Base configuration for text chunkers.

Source code in src/docler_config/chunker_configs.py
class BaseChunkerConfig(ProviderConfig):
    """Base configuration for text chunkers."""

BaseConverterConfig

Bases: ProviderConfig

Base configuration for document converters.

Source code in src/docler_config/converter_configs.py
class BaseConverterConfig(ProviderConfig):
    """Base configuration for document converters."""

    page_range: PageRangeString | None = None
    """Page range(s) to extract, like "1-5,7-10" (1-based)."""

    def get_provider(self) -> DocumentConverter:
        """Get the converter instance."""
        raise NotImplementedError

page_range class-attribute instance-attribute

page_range: PageRangeString | None = None

Page range(s) to extract, like "1-5,7-10" (1-based).

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."""
    raise NotImplementedError

BaseProcessorConfig

Bases: ProviderConfig

Base configuration for document processors.

Source code in src/docler_config/processor_configs.py
class BaseProcessorConfig(ProviderConfig):
    """Base configuration for document processors."""

DataLabConfig

Bases: BaseConverterConfig

Configuration for DataLab-based converter.

Source code in src/docler_config/converter_configs.py
class DataLabConfig(BaseConverterConfig):
    """Configuration for DataLab-based converter."""

    type: Literal["datalab"] = Field("datalab", init=False)
    """Type discriminator for DataLab converter."""

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

    api_key: SecretStr | None = None
    """DataLab API key. If None, will try env var DATALAB_API_KEY."""

    force_ocr: bool = False
    """Whether to force OCR on every page."""

    use_llm: bool = False
    """Whether to use LLM for enhanced accuracy."""

    max_pages: int | None = Field(default=None, ge=1)
    """Maximum number of pages to process."""

    model_config = SettingsConfigDict(env_prefix="DATALAB_")

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

        return DataLabConverter(**self.get_config_fields())

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

DataLab API key. If None, will try env var DATALAB_API_KEY.

force_ocr class-attribute instance-attribute

force_ocr: bool = False

Whether to force OCR on every page.

languages class-attribute instance-attribute

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

List of supported languages for the converter.

max_pages class-attribute instance-attribute

max_pages: int | None = Field(default=None, ge=1)

Maximum number of pages to process.

type class-attribute instance-attribute

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

Type discriminator for DataLab converter.

use_llm class-attribute instance-attribute

use_llm: bool = False

Whether to use LLM for enhanced accuracy.

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.datalab_provider import DataLabConverter

    return DataLabConverter(**self.get_config_fields())

DoclingConverterConfig

Bases: BaseConverterConfig

Configuration for docling-based converter.

Source code in src/docler_config/converter_configs.py
class DoclingConverterConfig(BaseConverterConfig):
    """Configuration for docling-based converter."""

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

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

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

    generate_images: bool = True
    """Whether to generate images."""

    ocr_engine: (
        DoclingEngine
        # | EasyOcrOptions
        # | TesseractCliOcrOptions
        # | TesseractOcrOptions
        # | OcrMacOptions
        # | RapidOcrOptions
    ) = "rapid_ocr"
    """OCR engine to use. Defaults to RapidOCR, which the `docling` extra installs."""

    model_config = SettingsConfigDict(env_prefix="DOCLING_")

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

        return DoclingConverter(**self.get_config_fields())

generate_images class-attribute instance-attribute

generate_images: bool = True

Whether to generate images.

image_scale class-attribute instance-attribute

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

Scale factor for image resizing.

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 = 'rapid_ocr'

OCR engine to use. Defaults to RapidOCR, which the docling extra installs.

type class-attribute instance-attribute

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

Type discriminator for 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_provider import DoclingConverter

    return DoclingConverter(**self.get_config_fields())

LLMConverterConfig

Bases: BaseConverterConfig

Configuration for LLM-based converter.

Source code in src/docler_config/converter_configs.py
class LLMConverterConfig(BaseConverterConfig):
    """Configuration for LLM-based converter."""

    type: Literal["llm"] = Field("llm", init=False)
    """Type discriminator for LLM converter."""

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

    model: ModelIdentifier = DEFAULT_CONVERTER_MODEL
    """LLM model to use."""

    system_prompt: str = LLM_SYSTEM_PROMPT
    """Optional system prompt to guide conversion."""

    user_prompt: str = LLM_USER_PROMPT
    """Custom prompt for the conversion task."""

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

        return LLMConverter(**self.get_config_fields())

languages class-attribute instance-attribute

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

List of supported languages for the converter.

model class-attribute instance-attribute

model: ModelIdentifier = DEFAULT_CONVERTER_MODEL

LLM model to use.

system_prompt class-attribute instance-attribute

system_prompt: str = LLM_SYSTEM_PROMPT

Optional system prompt to guide conversion.

type class-attribute instance-attribute

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

Type discriminator for LLM converter.

user_prompt class-attribute instance-attribute

user_prompt: str = LLM_USER_PROMPT

Custom prompt for the conversion task.

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.llm_provider import LLMConverter

    return LLMConverter(**self.get_config_fields())

LLMProofReaderConfig

Bases: BaseProcessorConfig

Configuration for LLM-based proof reader that improves OCR output.

Source code in src/docler_config/processor_configs.py
class LLMProofReaderConfig(BaseProcessorConfig):
    """Configuration for LLM-based proof reader that improves OCR output."""

    type: Literal["llm_proof_reader"] = Field(default="llm_proof_reader", init=False)
    """Type discriminator for LLM proof reader."""

    model: ModelIdentifier = DEFAULT_PROOF_READER_MODEL
    """LLM model to use for proof reading."""

    system_prompt: str = DEFAULT_PROOF_READER_SYSTEM_PROMPT
    """System prompt for the proof reading task."""

    prompt_template: str = DEFAULT_PROOF_READER_PROMPT_TEMPLATE
    """Template for the proof reading prompt."""

    chunker: ChunkerConfig | None = None
    """Optional chunker configuration. If None, processes entire document at once."""

    include_diffs: bool = True
    """Whether to include diffs in metadata."""

    add_metadata_only: bool = False
    """If True, only add metadata without modifying content."""

    def get_provider(self) -> DocumentProcessor[Any]:
        """Get the processor instance."""
        from docler.processors.ai_processor import LLMProofReader

        return LLMProofReader(**self.get_config_fields())

add_metadata_only class-attribute instance-attribute

add_metadata_only: bool = False

If True, only add metadata without modifying content.

chunker class-attribute instance-attribute

chunker: ChunkerConfig | None = None

Optional chunker configuration. If None, processes entire document at once.

include_diffs class-attribute instance-attribute

include_diffs: bool = True

Whether to include diffs in metadata.

model class-attribute instance-attribute

model: ModelIdentifier = DEFAULT_PROOF_READER_MODEL

LLM model to use for proof reading.

prompt_template class-attribute instance-attribute

prompt_template: str = DEFAULT_PROOF_READER_PROMPT_TEMPLATE

Template for the proof reading prompt.

system_prompt class-attribute instance-attribute

system_prompt: str = DEFAULT_PROOF_READER_SYSTEM_PROMPT

System prompt for the proof reading task.

type class-attribute instance-attribute

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

Type discriminator for LLM proof reader.

get_provider

get_provider() -> DocumentProcessor[Any]

Get the processor instance.

Source code in src/docler_config/processor_configs.py
def get_provider(self) -> DocumentProcessor[Any]:
    """Get the processor instance."""
    from docler.processors.ai_processor import LLMProofReader

    return LLMProofReader(**self.get_config_fields())

LlamaIndexChunkerConfig

Bases: BaseChunkerConfig

Configuration for LlamaIndex chunkers.

Source code in src/docler_config/chunker_configs.py
class LlamaIndexChunkerConfig(BaseChunkerConfig):
    """Configuration for LlamaIndex chunkers."""

    type: Literal["llamaindex"] = Field(default="llamaindex", init=False)

    chunker_type: Literal["sentence", "token", "fixed", "markdown"] = "markdown"
    """Which LlamaIndex chunker to use."""

    chunk_overlap: int = Field(default=200, ge=0)
    """Number of characters to overlap between chunks."""

    chunk_size: int = Field(default=1000, ge=1)
    """Target size of chunks."""

    include_metadata: bool = True
    """Whether to include document metadata in chunks."""

    include_prev_next_rel: bool = False
    """Whether to track relationships between chunks."""

    def get_provider(self) -> LlamaIndexChunker:
        """Get the chunker instance."""
        from docler.chunkers.llamaindex_chunker import LlamaIndexChunker

        return LlamaIndexChunker(**self.get_config_fields())

chunk_overlap class-attribute instance-attribute

chunk_overlap: int = Field(default=200, ge=0)

Number of characters to overlap between chunks.

chunk_size class-attribute instance-attribute

chunk_size: int = Field(default=1000, ge=1)

Target size of chunks.

chunker_type class-attribute instance-attribute

chunker_type: Literal['sentence', 'token', 'fixed', 'markdown'] = 'markdown'

Which LlamaIndex chunker to use.

include_metadata class-attribute instance-attribute

include_metadata: bool = True

Whether to include document metadata in chunks.

include_prev_next_rel class-attribute instance-attribute

include_prev_next_rel: bool = False

Whether to track relationships between chunks.

get_provider

get_provider() -> LlamaIndexChunker

Get the chunker instance.

Source code in src/docler_config/chunker_configs.py
def get_provider(self) -> LlamaIndexChunker:
    """Get the chunker instance."""
    from docler.chunkers.llamaindex_chunker import LlamaIndexChunker

    return LlamaIndexChunker(**self.get_config_fields())

LlamaParseConfig

Bases: BaseConverterConfig

Configuration for LlamaParse-based converter.

Source code in src/docler_config/converter_configs.py
class LlamaParseConfig(BaseConverterConfig):
    """Configuration for LlamaParse-based converter."""

    type: Literal["llamaparse"] = Field("llamaparse", init=False)
    """Type discriminator for LlamaParse converter."""

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

    api_key: SecretStr | None = None
    """LlamaParse API key. Falls back to LLAMAPARSE_API_KEY env var."""

    adaptive_long_table: bool = False
    """Whether to use adaptive long table."""

    parse_mode: LlamaParseMode = "parse_page_with_llm"
    """Legacy parse mode, used when no `tier` is set."""

    tier: LlamaParseTier | None = None
    """Parsing tier. Takes precedence over `parse_mode` when set."""

    skip_diagonal_text: bool = False
    """Whether to skip diagonal text."""

    disable_ocr: bool = False
    """Whether to disable OCR for images."""

    continuous_mode: bool = True
    """Merge tables spanning pages. Only supported with a `tier`."""

    html_tables: bool = False
    """Whether to output HTML tables instead of markdown."""

    model_config = SettingsConfigDict(env_prefix="LLAMAPARSE_")

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

        return LlamaParseConverter(**self.get_config_fields())

adaptive_long_table class-attribute instance-attribute

adaptive_long_table: bool = False

Whether to use adaptive long table.

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

LlamaParse API key. Falls back to LLAMAPARSE_API_KEY env var.

continuous_mode class-attribute instance-attribute

continuous_mode: bool = True

Merge tables spanning pages. Only supported with a tier.

disable_ocr class-attribute instance-attribute

disable_ocr: bool = False

Whether to disable OCR for images.

html_tables class-attribute instance-attribute

html_tables: bool = False

Whether to output HTML tables instead of markdown.

languages class-attribute instance-attribute

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

List of supported languages for the converter.

parse_mode class-attribute instance-attribute

parse_mode: LlamaParseMode = 'parse_page_with_llm'

Legacy parse mode, used when no tier is set.

skip_diagonal_text class-attribute instance-attribute

skip_diagonal_text: bool = False

Whether to skip diagonal text.

tier class-attribute instance-attribute

tier: LlamaParseTier | None = None

Parsing tier. Takes precedence over parse_mode when set.

type class-attribute instance-attribute

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

Type discriminator for LlamaParse 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.llamaparse_provider import LlamaParseConverter

    return LlamaParseConverter(**self.get_config_fields())

MarkItDownConfig

Bases: BaseConverterConfig

Configuration for MarkItDown-based converter.

Source code in src/docler_config/converter_configs.py
class MarkItDownConfig(BaseConverterConfig):
    """Configuration for MarkItDown-based converter."""

    type: Literal["markitdown"] = Field("markitdown", init=False)
    """Type discriminator for MarkItDown converter."""

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

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

        return MarkItDownConverter(**self.get_config_fields())

languages class-attribute instance-attribute

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

List of supported languages for the converter.

type class-attribute instance-attribute

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

Type discriminator for MarkItDown 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.markitdown_provider import MarkItDownConverter

    return MarkItDownConverter(**self.get_config_fields())

MarkdownChunkerConfig

Bases: BaseChunkerConfig

Configuration for markdown-based chunker.

Source code in src/docler_config/chunker_configs.py
class MarkdownChunkerConfig(BaseChunkerConfig):
    """Configuration for markdown-based chunker."""

    type: Literal["markdown"] = Field(default="markdown", init=False)
    """Type discriminator for markdown chunker."""

    min_chunk_size: int = Field(default=200, ge=1)
    """Minimum characters per chunk."""

    max_chunk_size: int = Field(default=1500, ge=1)
    """Maximum characters per chunk."""

    chunk_overlap: int = Field(default=200, ge=0)
    """Number of characters to overlap between chunks."""

    def get_provider(self) -> MarkdownChunker:
        """Get the chunker instance."""
        from docler.chunkers.markdown_chunker import MarkdownChunker

        return MarkdownChunker(**self.get_config_fields())

chunk_overlap class-attribute instance-attribute

chunk_overlap: int = Field(default=200, ge=0)

Number of characters to overlap between chunks.

max_chunk_size class-attribute instance-attribute

max_chunk_size: int = Field(default=1500, ge=1)

Maximum characters per chunk.

min_chunk_size class-attribute instance-attribute

min_chunk_size: int = Field(default=200, ge=1)

Minimum characters per chunk.

type class-attribute instance-attribute

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

Type discriminator for markdown chunker.

get_provider

get_provider() -> MarkdownChunker

Get the chunker instance.

Source code in src/docler_config/chunker_configs.py
def get_provider(self) -> MarkdownChunker:
    """Get the chunker instance."""
    from docler.chunkers.markdown_chunker import MarkdownChunker

    return MarkdownChunker(**self.get_config_fields())

MarkerConfig

Bases: BaseConverterConfig

Configuration for Marker-based converter.

Source code in src/docler_config/converter_configs.py
class MarkerConfig(BaseConverterConfig):
    """Configuration for Marker-based converter."""

    type: Literal["marker"] = Field("marker", init=False)
    """Type discriminator for Marker converter."""

    dpi: int = Field(default=192, gt=0)
    """DPI setting for image extraction."""

    llm_provider: MarkerLLMProvider | None = None
    """Language model provider to use for OCR."""

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

        return MarkerConverter(**self.get_config_fields())

dpi class-attribute instance-attribute

dpi: int = Field(default=192, gt=0)

DPI setting for image extraction.

llm_provider class-attribute instance-attribute

llm_provider: MarkerLLMProvider | None = None

Language model provider to use for OCR.

type class-attribute instance-attribute

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

Type discriminator for Marker 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.marker_provider import MarkerConverter

    return MarkerConverter(**self.get_config_fields())

MistralConfig

Bases: BaseConverterConfig

Configuration for Mistral-based converter.

Source code in src/docler_config/converter_configs.py
class MistralConfig(BaseConverterConfig):
    """Configuration for Mistral-based converter."""

    type: Literal["mistral"] = Field("mistral", init=False)
    """Type discriminator for Mistral converter."""

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

    api_key: SecretStr | None = None
    """Mistral API key. If None, will try env var MISTRAL_API_KEY."""

    model_config = SettingsConfigDict(env_prefix="MISTRAL_")

    # right now there only is one model
    # ocr_model: str = "mistral-ocr-latest"
    # """Mistral OCR model to use."""

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

        return MistralConverter(**self.get_config_fields())

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

Mistral API key. If None, will try env var MISTRAL_API_KEY.

languages class-attribute instance-attribute

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

List of supported languages for the converter.

type class-attribute instance-attribute

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

Type discriminator for Mistral 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.mistral_provider import MistralConverter

    return MistralConverter(**self.get_config_fields())

UpstageConfig

Bases: BaseConverterConfig

Configuration for Upstage Document AI converter.

Source code in src/docler_config/converter_configs.py
class UpstageConfig(BaseConverterConfig):
    """Configuration for Upstage Document AI converter."""

    type: Literal["upstage"] = Field("upstage", init=False)
    """Type discriminator for Upstage converter."""

    api_key: SecretStr | None = None
    """Upstage API key. Falls back to UPSTAGE_API_KEY env var."""

    base_url: HttpUrl = HttpUrl("https://api.upstage.ai/v1/document-ai/document-parse")
    """API endpoint URL."""

    # model: str = "document-parse"
    # """Model name for document parsing."""

    ocr: UpstageOCRType = "auto"
    """OCR mode ('auto' or 'force')."""

    base64_categories: set[UpstageCategory] = Field(default_factory=_default_base64_categories)
    """Element categories to encode in base64."""

    model_config = SettingsConfigDict(env_prefix="UPSTAGE_")

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

        return UpstageConverter(**self.get_config_fields())

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

Upstage API key. Falls back to UPSTAGE_API_KEY env var.

base64_categories class-attribute instance-attribute

base64_categories: set[UpstageCategory] = Field(default_factory=_default_base64_categories)

Element categories to encode in base64.

base_url class-attribute instance-attribute

base_url: HttpUrl = HttpUrl('https://api.upstage.ai/v1/document-ai/document-parse')

API endpoint URL.

ocr class-attribute instance-attribute

ocr: UpstageOCRType = 'auto'

OCR mode ('auto' or 'force').

type class-attribute instance-attribute

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

Type discriminator for Upstage 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.upstage_provider import UpstageConverter

    return UpstageConverter(**self.get_config_fields())