Skip to content
Guide
Extract
Guides

Configuration Options

Overview of configuration options for LlamaExtract, including extraction modes, system prompts, and extraction targets.

When creating a new extraction configuration, the schema is the most important part. However, there are a few other options that can significantly impact the extraction process.

These options determine how your schema is applied to the document:

  • Extraction Target: Determines the scope and granularity of extraction. Available options:

    • per_doc (default): Schema is applied to the entire document, returns a single JSON object
    • per_page: Schema is applied to each page independently, returns an array of JSON objects (one per page)
    • per_table_row: Schema is applied to each entity in an ordered list (table rows, bulleted lists, etc.), returns an array of JSON objects (one per entity)

    See the Core Concepts page for detailed guidance on when to use each mode.

Extract tiers determine how much effort LlamaExtract puts into producing structured data from a document.

Agentic Plus provides the highest extraction quality across document types, including short or straightforward documents. Use it when you want the best result and can accept higher cost and latency. It may take longer on long or complex documents as it puts more iterative effort into the result. It also supports the largest schemas (up to 3,200 fields); schemas above 200 fields incur a per-page credit multiplier — see pricing.

Agentic balances quality, cost, and latency across a broad range of documents, including mixed layouts and tables.

Cost Effective prioritizes lower cost and latency for straightforward extraction, especially at high volume. It works best when fields and layouts are predictable and ambiguity is limited.

Each extract tier has a default parse tier chosen to balance cost and quality. You can override the parse tier in Advanced Settings when your workload needs lower parsing cost or higher-quality document interpretation. See pricing for the default combinations and additive costs.

All tiers use the same version convention. Use latest while evaluating changes, then pin the resolved date in production. latest selects the newest version compatible with the requested options, while a date selects the newest release for that tier on or before the date.

Under Advanced Settings in the UI you can fine-tune how extraction runs:

  • Parse tier: Select the parsing tier used to interpret the input document before extraction. This uses the same v2 parse tiers as LlamaParse (for example, cost_effective, agentic, and agentic_plus). See Tiers for details.
  • Cite sources: Enable cite sources to attach citations to extracted fields so you can trace every value back to its origin in the document.
  • Confidence scores: Enable confidence scores to get per-field confidence signals alongside extracted output.
  • System prompt: Provide a system prompt to globally guide the extractor (for example, “Prefer the most recent fiscal year if multiple are present”, or “Return numbers as plain numerals without currency symbols”).
  • System Prompt: Any additional system level instructions for the extraction. Note that you should use the schema descriptions to pass field-level instructions, few-shot examples, formatting instructions, etc.
  • Page Range: Specify which pages to extract from by providing comma-separated page numbers or ranges (1-based indexing). For example, use 1,3,5-7,9 to extract pages 1, 3, pages 5 through 7, and page 9. You can also use ranges like 1-3,8-10 to extract the first three pages and pages 8 through 10. Page numbers are 1-based, meaning the first page is page 1. This option is useful when you only need to extract data from specific sections of large documents.

  • Context Window: Number of pages to pass as context for long document extraction. This is useful when extracting from large documents where you need context from surrounding pages. This is configurable via the extraction tier and system prompt. Larger values keep more of the surrounding document intact, which helps when you need to see multi-page tables or invoices in one pass. Smaller values advance through the file more aggressively and are better when you need exhaustive coverage of dense lists.

For additional extraction features that provide enhanced metadata and insights, see the Metadata Extensions page which covers:

  • Citations: Source tracing for extracted fields
  • Confidence Scores: Quantitative confidence measures

These extensions return additional metadata in the extract_metadata field but may impact processing time.

You can configure these options when creating an extraction job using either the REST API or Python SDK.

First, install the Python SDK:

Terminal window
pip install llama-cloud>=2.1

Here’s how to set various configuration options:

import time
from llama_cloud import LlamaCloud, AsyncLlamaCloud
client = LlamaCloud(api_key="your_api_key")
schema = {
"type": "object",
"properties": {
"company_name": {"type": "string", "description": "Name of the company"},
"revenue": {"type": "number", "description": "Annual revenue in USD"}
}
}
file_obj = client.files.create(file="path/to/your/document.pdf", purpose="extract")
file_id = file_obj.id
job = client.extract.create(
file_input=file_id,
configuration={
"data_schema": schema,
"extraction_target": "per_doc", # per_doc, per_page, per_table_row
"tier": "agentic", # cost_effective, agentic, agentic_plus
"version": "2026-03-31", # Pin behavior to the latest release available on this date
"system_prompt": "Focus on the most recent financial data",
"target_pages": "1-5,10-15", # Extract from specific pages
"cite_sources": True, # Enable citations
"confidence_scores": True, # Enable confidence scores
},
)
# Poll for completion
while job.status not in ("COMPLETED", "FAILED", "CANCELLED"):
time.sleep(2)
job = client.extract.get(job.id)

You can configure these options using the REST API when creating an extraction job:

Terminal window
curl -X 'POST' \
'https://api.cloud.llamaindex.ai/api/v2/extract?project_id={PROJECT_ID}' \
-H 'accept: application/json' \
-H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_input": "{FILE_ID}",
"configuration": {
"data_schema": {
"type": "object",
"properties": {
"company_name": {"type": "string", "description": "Name of the company"},
"revenue": {"type": "number", "description": "Annual revenue in USD"}
}
},
"extraction_target": "per_doc",
"tier": "agentic",
"version": "2026-03-31",
"system_prompt": "Focus on the most recent financial data",
"target_pages": "1-5,10-15",
"cite_sources": true,
"confidence_scores": true
}
}'
OptionTypeDefaultDescription
Schema Alignment
extraction_targetstring”per_doc”Extraction scope: per_doc, per_page, per_table_row. Agentic Plus supports per_doc only.
Tier
tierstring”agentic”Extraction tier: cost_effective, agentic (default), agentic_plus
versionstring”latest”Extract algorithm version. Use “latest” during development or pin to a date in YYYY-MM-DD format for stable production behavior.
System Prompt
system_promptstringnullAdditional system-level instructions
Page Range and Context
target_pagesstringnullComma-separated page numbers or ranges to process (1-based, e.g., “1,3,5-7”). Pages are processed in the order listed, so “3,1,2” feeds page 3 first, then 1, then 2.
max_pagesintegernullMaximum number of pages to process
Metadata Extensions
cite_sourcesbooleanfalseEnable source citations
confidence_scoresbooleanfalseEnable confidence scores
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/for-agents/mcp/ - Other LlamaIndex tooling for agents — the LlamaParse Platform MCP server, agent skills and plugins, and the n8n node — is mapped at https://developers.llamaindex.ai/for-agents/