Skip to main content

Auto Mode

Automatically routes each page to Balanced or Premium preset

Overview

Auto Mode analyzes each page individually and dynamically chooses between Balanced and Premium parsing. This allows for higher accuracy while reducing unnecessary cost.

Under the Hood

When auto_mode=True is enabled, LlamaParse first attempts to parse each page using Balanced Mode. If specific conditions are met, it will automatically reparse that page using Premium Mode for improved fidelity.

This mode enables flexibility but may result in variable and less predictable costs depending on the content of the file.

To use this mode, set auto_mode=True.

parser = LlamaParse(
auto_mode=True
)


Trigger on Table

If you want to upgrade parsing to Premium when a table is detected on the page, set auto_mode_trigger_on_table_in_page=True.

parser = LlamaParse(
auto_mode_trigger_on_table_in_page=True
)


Trigger on Image

If you want to upgrade parsing to Premium when images are present on a page, set auto_mode_trigger_on_image_in_page=True.

parser = LlamaParse(
auto_mode_trigger_on_image_in_page=True
)


Trigger on RegExp

To trigger Premium parsing when a regular expression matches text on the page, set auto_mode_trigger_on_regexp_in_page to your pattern (ECMA262 format).

parser = LlamaParse(
auto_mode_trigger_on_regexp_in_page="/((total cost)|(tax))/g"
)


Trigger on Text

To trigger Premium parsing when specific text appears on a page, use auto_mode_trigger_on_text_in_page.

parser = LlamaParse(
auto_mode_trigger_on_text_in_page="total"
)