> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/lumina-ai-inc/chunkr/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Configuration options for document processing tasks

The Configuration object controls how Chunkr processes your documents. It includes settings for OCR, segmentation, chunking, and post-processing.

## Configuration Fields

<ResponseField name="ocr_strategy" type="OcrStrategy" required>
  Controls the Optical Character Recognition (OCR) strategy.

  <Expandable title="OcrStrategy enum values">
    * `All` - Processes all pages with OCR (Latency penalty: \~0.5 seconds per page)
    * `Auto` - Selectively applies OCR only to pages with missing or low-quality text. When text layer is present, the bounding boxes from the text layer are used
  </Expandable>
</ResponseField>

<ResponseField name="segmentation_strategy" type="SegmentationStrategy" required>
  Controls the segmentation strategy.

  <Expandable title="SegmentationStrategy enum values">
    * `LayoutAnalysis` - Analyzes pages for layout elements (e.g., `Table`, `Picture`, `Formula`, etc.) using bounding boxes. Provides fine-grained segmentation and better chunking
    * `Page` - Treats each page as a single segment. Faster processing, but without layout element detection and only simple chunking
  </Expandable>
</ResponseField>

<ResponseField name="chunk_processing" type="ChunkProcessing" required>
  Controls the chunking and post-processing of each chunk.

  <Expandable title="ChunkProcessing properties">
    <ResponseField name="target_length" type="integer" default={512}>
      The target number of tokens in each chunk. If 0, each chunk will contain a single segment.
    </ResponseField>

    <ResponseField name="ignore_headers_and_footers" type="boolean" default={true}>
      Whether to ignore headers and footers in the chunking process. This is recommended as headers and footers break reading order across pages.
    </ResponseField>

    <ResponseField name="tokenizer" type="TokenizerType" default="Word">
      The tokenizer to use for the chunking process.

      <Expandable title="TokenizerType options">
        Can be either a predefined tokenizer or any Hugging Face tokenizer ID:

        **Predefined tokenizers:**

        * `Word` - Split text by word boundaries
        * `Cl100kBase` - For OpenAI models (GPT-3.5, GPT-4, text-embedding-ada-002)
        * `xlm-roberta-base` - For RoBERTa-based multilingual models
        * `bert-base-uncased` - BERT base uncased tokenizer

        **Custom tokenizers:**
        You can also specify any Hugging Face tokenizer by providing its model ID as a string (e.g., `"facebook/bart-large"`, `"Qwen/Qwen-tokenizer"`).
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="segment_processing" type="SegmentProcessing" required>
  Controls the post-processing of each segment type. See [Segment Processing](/api/models/segments#segment-processing) for detailed configuration options.
</ResponseField>

<ResponseField name="high_resolution" type="boolean" default={true} required>
  Whether to use high-resolution images for cropping and post-processing. (Latency penalty: \~7 seconds per page)
</ResponseField>

<ResponseField name="error_handling" type="ErrorHandlingStrategy" required>
  Controls how errors are handled during processing.

  <Expandable title="ErrorHandlingStrategy enum values">
    * `Fail` - Stops processing and fails the task when any error occurs
    * `Continue` - Attempts to continue processing despite non-critical errors (e.g., LLM refusals)
  </Expandable>
</ResponseField>

<ResponseField name="llm_processing" type="LlmProcessing" required>
  Controls the LLM used for the task.

  <Expandable title="LlmProcessing properties">
    <ResponseField name="model_id" type="string">
      The ID of the model to use for the task. If not provided, the default model will be used. Please check the documentation for available models.
    </ResponseField>

    <ResponseField name="fallback_strategy" type="FallbackStrategy" default="Default">
      The fallback strategy to use for LLMs in the task.

      <Expandable title="FallbackStrategy options">
        * `None` - No fallback will be used
        * `Default` - Use the system default fallback model
        * `Model(string)` - Use a specific model as fallback
      </Expandable>
    </ResponseField>

    <ResponseField name="max_completion_tokens" type="integer">
      The maximum number of tokens to generate.
    </ResponseField>

    <ResponseField name="temperature" type="number" default={0.0}>
      The temperature to use for the LLM.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="expires_in" type="integer">
  The number of seconds until the task is deleted. Expired tasks cannot be updated, polled, or accessed via web interface.
</ResponseField>

<ResponseField name="input_file_url" type="string">
  The presigned URL of the input file.
</ResponseField>

## Deprecated Fields

<ResponseField name="target_chunk_length" type="integer" deprecated>
  **DEPRECATED**: Use `chunk_processing.target_length` instead.
</ResponseField>

<ResponseField name="json_schema" type="object" deprecated>
  **DEPRECATED**: The extracted JSON schema from the document.
</ResponseField>

<ResponseField name="model" type="Model" deprecated>
  **DEPRECATED**: Model selection.

  <Expandable title="Model enum values (deprecated)">
    * `Fast`
    * `HighQuality`
  </Expandable>
</ResponseField>
