Using Saved Configurations
Save and reuse parse and extract configurations for consistent, repeatable extraction workflows.
Saved configurations let you define your parse and extract settings once — either in the LlamaCloud UI or via the API — and then reference them by ID when creating extraction jobs. This is useful when you want to:
- Standardize extraction across your team with a shared configuration
- Simplify job creation by replacing inline config with a single ID
- Decouple parse settings from extract settings so you can mix and match
- Iterate on configuration in the UI playground, then use the same settings programmatically
Concepts
Section titled “Concepts”There are two types of saved configurations relevant to extraction:
| Configuration Type | Product Type | What It Controls |
|---|---|---|
| Parse configuration | parse_v2 | How documents are parsed (tier, options) before extraction |
| Extract configuration | extract_v2 | Full extraction settings: schema, tier, extraction target, and optionally a reference to a parse configuration |
Both are managed through the Product Configurations API (/api/v1/beta/configurations).
For extract configurations, use the canonical version field. Pin it to the date you create or update the configuration in YYYY-MM-DD format, for example 2026-03-31, to keep behavior stable. The date resolves to the most recent available extract version for the selected tier at or before that date.
Creating Configurations via the API
Section titled “Creating Configurations via the API”Create a Parse Configuration
Section titled “Create a Parse Configuration”A parse configuration saves your LlamaParse settings so they can be reused across multiple extraction jobs.
import osfrom llama_cloud import LlamaCloud
client = LlamaCloud(api_key=os.environ["LLAMA_CLOUD_API_KEY"])
# Create a saved parse configurationparse_config = client.configurations.create( name="High Quality Parse", parameters={ "product_type": "parse_v2", "version": "latest", "tier": "agentic", },)
print(f"Parse config ID: {parse_config.id}")# e.g. "cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"import LlamaCloud from '@llamaindex/llama-cloud';
const client = new LlamaCloud({ apiKey: process.env.LLAMA_CLOUD_API_KEY!,});
// Create a saved parse configurationconst parseConfig = await client.configurations.create({ name: 'High Quality Parse', parameters: { product_type: 'parse_v2', version: 'latest', tier: 'agentic', },});
console.log(`Parse config ID: ${parseConfig.id}`);package main
import ( "context" "fmt" "log"
llamacloud "github.com/run-llama/llama-parse-go")
func main() { ctx := context.Background() client := llamacloud.NewClient()
// Create a saved parse configuration parseConfig, err := client.Configurations.New(ctx, llamacloud.ConfigurationNewParams{ ConfigurationCreate: llamacloud.ConfigurationCreateParam{ Name: "High Quality Parse", Parameters: llamacloud.ConfigurationCreateParametersUnionParam{ OfParseV2: &llamacloud.ParseV2Parameters{ Tier: llamacloud.ParseV2ParametersTierAgentic, Version: llamacloud.ParseV2ParametersVersionLatest, }, }, }, }) if err != nil { log.Fatal(err) }
fmt.Printf("Parse config ID: %s\n", parseConfig.ID)}import ai.llamaindex.llamacloud.client.LlamaCloudClient;import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;import ai.llamaindex.llamacloud.models.configurations.ConfigurationCreate;import ai.llamaindex.llamacloud.models.configurations.ConfigurationCreateParams;import ai.llamaindex.llamacloud.models.configurations.ConfigurationResponse;import ai.llamaindex.llamacloud.models.configurations.ParseV2Parameters;
LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();
// Create a saved parse configurationConfigurationResponse parseConfig = client.configurations().create( ConfigurationCreateParams.builder() .configurationCreate( ConfigurationCreate.builder() .name("High Quality Parse") .parameters( ParseV2Parameters.builder() .tier(ParseV2Parameters.Tier.AGENTIC) .version(ParseV2Parameters.Version.LATEST) .build()) .build()) .build());
System.out.println("Parse config ID: " + parseConfig.id());export LLAMA_CLOUD_API_KEY="llx-..."
# Create a saved parse configurationPARSE_CONFIG_ID=$(llp configurations create \ --name "High Quality Parse" \ --parameters '{"product_type": "parse_v2", "version": "latest", "tier": "agentic"}' \ | jq -r '.id')
echo "Parse config ID: $PARSE_CONFIG_ID"curl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v1/beta/configurations?project_id={PROJECT_ID}' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ -d '{ "name": "High Quality Parse", "parameters": { "product_type": "parse_v2", "version": "latest", "tier": "agentic" } }'Create an Extract Configuration
Section titled “Create an Extract Configuration”An extract configuration saves your schema, extraction tier, and other settings. You can optionally reference a saved parse configuration inside it.
from pydantic import BaseModel, Fieldfrom typing import Optional
# Define your extraction schemaclass InvoiceData(BaseModel): vendor_name: str = Field(description="Name of the vendor or supplier") invoice_number: str = Field(description="Unique invoice identifier") total_amount: float = Field(description="Total amount due") currency: str = Field(description="Currency code (e.g. USD, EUR)") due_date: Optional[str] = Field(None, description="Payment due date")
# Create a saved extract configuration that references the parse configextract_config = client.configurations.create( name="Invoice Extraction", parameters={ "product_type": "extract_v2", "parse_config_id": parse_config.id, # Reference the parse config "data_schema": InvoiceData.model_json_schema(), "extraction_target": "per_doc", "tier": "agentic", "version": "2026-03-31", "cite_sources": True, },)
print(f"Extract config ID: {extract_config.id}")// Define your extraction schema as a JSON Schema literalconst invoiceSchema = { type: 'object', properties: { vendor_name: { type: 'string', description: 'Name of the vendor or supplier' }, invoice_number: { type: 'string', description: 'Unique invoice identifier' }, total_amount: { type: 'number', description: 'Total amount due' }, currency: { type: 'string', description: 'Currency code (e.g. USD, EUR)' }, due_date: { type: 'string', description: 'Payment due date', nullable: true }, }, required: ['vendor_name', 'invoice_number', 'total_amount', 'currency'],};
// Create a saved extract configuration that references the parse configconst extractConfig = await client.configurations.create({ name: 'Invoice Extraction', parameters: { product_type: 'extract_v2', parse_config_id: parseConfig.id, data_schema: invoiceSchema, extraction_target: 'per_doc', tier: 'agentic', version: '2026-03-31', cite_sources: true, },});
console.log(`Extract config ID: ${extractConfig.id}`);// Define your extraction schema as a JSON Schema literaldataSchema := map[string]*llamacloud.ExtractV2ParametersDataSchemaUnion{ "type": {OfString: llamacloud.String("object")}, "properties": {OfAnyMap: map[string]any{ "vendor_name": map[string]any{"type": "string", "description": "Name of the vendor or supplier"}, "invoice_number": map[string]any{"type": "string", "description": "Unique invoice identifier"}, "total_amount": map[string]any{"type": "number", "description": "Total amount due"}, "currency": map[string]any{"type": "string", "description": "Currency code (e.g. USD, EUR)"}, "due_date": map[string]any{"type": "string", "description": "Payment due date", "nullable": true}, }}, "required": {OfAnyArray: []any{"vendor_name", "invoice_number", "total_amount", "currency"}},}
// Create a saved extract configuration that references the parse configextractConfig, err := client.Configurations.New(ctx, llamacloud.ConfigurationNewParams{ ConfigurationCreate: llamacloud.ConfigurationCreateParam{ Name: "Invoice Extraction", Parameters: llamacloud.ConfigurationCreateParametersUnionParam{ OfExtractV2: &llamacloud.ExtractV2Parameters{ ParseConfigID: llamacloud.String(parseConfig.ID), DataSchema: dataSchema, ExtractionTarget: llamacloud.ExtractV2ParametersExtractionTargetPerDoc, Tier: llamacloud.ExtractV2ParametersTierAgentic, Version: llamacloud.String("2026-03-31"), CiteSources: llamacloud.Bool(true), }, }, },})if err != nil { log.Fatal(err)}
fmt.Printf("Extract config ID: %s\n", extractConfig.ID)import ai.llamaindex.llamacloud.core.JsonValue;import ai.llamaindex.llamacloud.models.configurations.ExtractV2Parameters;import java.util.List;import java.util.Map;
// Define your extraction schema as a JSON Schema literalExtractV2Parameters.DataSchema dataSchema = ExtractV2Parameters.DataSchema.builder() .putAdditionalProperty("type", JsonValue.from("object")) .putAdditionalProperty("properties", JsonValue.from(Map.of( "vendor_name", Map.of("type", "string", "description", "Name of the vendor or supplier"), "invoice_number", Map.of("type", "string", "description", "Unique invoice identifier"), "total_amount", Map.of("type", "number", "description", "Total amount due"), "currency", Map.of("type", "string", "description", "Currency code (e.g. USD, EUR)"), "due_date", Map.of("type", "string", "description", "Payment due date", "nullable", true)))) .putAdditionalProperty("required", JsonValue.from(List.of("vendor_name", "invoice_number", "total_amount", "currency"))) .build();
// Create a saved extract configuration that references the parse configConfigurationResponse extractConfig = client.configurations().create( ConfigurationCreateParams.builder() .configurationCreate( ConfigurationCreate.builder() .name("Invoice Extraction") .parameters( ExtractV2Parameters.builder() .parseConfigId(parseConfig.id()) .dataSchema(dataSchema) .extractionTarget(ExtractV2Parameters.ExtractionTarget.PER_DOC) .tier(ExtractV2Parameters.Tier.AGENTIC) .version("2026-03-31") .citeSources(true) .build()) .build()) .build());
System.out.println("Extract config ID: " + extractConfig.id());DATA_SCHEMA='{ "type": "object", "properties": { "vendor_name": {"type": "string", "description": "Name of the vendor or supplier"}, "invoice_number": {"type": "string", "description": "Unique invoice identifier"}, "total_amount": {"type": "number", "description": "Total amount due"}, "currency": {"type": "string", "description": "Currency code (e.g. USD, EUR)"}, "due_date": {"type": "string", "description": "Payment due date", "nullable": true} }, "required": ["vendor_name", "invoice_number", "total_amount", "currency"]}'
# Create a saved extract configuration that references the parse configEXTRACT_CONFIG_ID=$(llp configurations create \ --name "Invoice Extraction" \ --parameters "{\"product_type\": \"extract_v2\", \"parse_config_id\": \"$PARSE_CONFIG_ID\", \"data_schema\": $DATA_SCHEMA, \"extraction_target\": \"per_doc\", \"tier\": \"agentic\", \"version\": \"2026-03-31\", \"cite_sources\": true}" \ | jq -r '.id')
echo "Extract config ID: $EXTRACT_CONFIG_ID"curl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v1/beta/configurations?project_id={PROJECT_ID}' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ -d '{ "name": "Invoice Extraction", "parameters": { "product_type": "extract_v2", "parse_config_id": "{PARSE_CONFIG_ID}", "data_schema": { "type": "object", "properties": { "vendor_name": {"type": "string", "description": "Name of the vendor or supplier"}, "invoice_number": {"type": "string", "description": "Unique invoice identifier"}, "total_amount": {"type": "number", "description": "Total amount due"}, "currency": {"type": "string", "description": "Currency code (e.g. USD, EUR)"}, "due_date": {"type": "string", "description": "Payment due date", "nullable": true} }, "required": ["vendor_name", "invoice_number", "total_amount", "currency"] }, "extraction_target": "per_doc", "tier": "agentic", "version": "2026-03-31", "cite_sources": true } }'Running Extraction with a Saved Configuration
Section titled “Running Extraction with a Saved Configuration”Once you have a saved extract configuration, you can create extraction jobs by passing just the configuration_id — no inline config needed.
import time
# Upload a filefile_obj = client.files.create(file="./invoices/invoice_001.pdf", purpose="extract")
# Extract using the saved configuration — no inline config neededjob = client.extract.create( file_input=file_obj.id, configuration_id=extract_config.id,)
# Poll for completionwhile job.status not in ("COMPLETED", "FAILED", "CANCELLED"): time.sleep(2) job = client.extract.get(job.id)
if job.status == "COMPLETED": invoice = InvoiceData.model_validate(job.extract_result) print(f"Vendor: {invoice.vendor_name}") print(f"Total: {invoice.currency} {invoice.total_amount}")import fs from 'fs';import LlamaCloud from '@llamaindex/llama-cloud';
const client = new LlamaCloud({ apiKey: process.env.LLAMA_CLOUD_API_KEY!,});
// Upload a fileconst fileObj = await client.files.create({ file: fs.createReadStream('./invoices/invoice_001.pdf'), purpose: 'extract',});
// Extract using the saved configuration — no inline config neededlet job = await client.extract.create({ file_input: fileObj.id, configuration_id: 'cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // your saved config ID});
// Poll for completionwhile (!['COMPLETED', 'FAILED', 'CANCELLED'].includes(job.status)) { await new Promise((r) => setTimeout(r, 2000)); job = await client.extract.get(job.id);}
if (job.status === 'COMPLETED') { console.log('Extracted:', job.extract_result);}// Upload a filef, err := os.Open("./invoices/invoice_001.pdf")if err != nil { log.Fatal(err)}defer f.Close()
fileObj, err := client.Files.New(ctx, llamacloud.FileNewParams{ File: f, Purpose: "extract",})if err != nil { log.Fatal(err)}
// Extract using the saved configuration — no inline config neededjob, err := client.Extract.New(ctx, llamacloud.ExtractNewParams{ ExtractV2JobCreate: llamacloud.ExtractV2JobCreateParam{ FileInput: fileObj.ID, ConfigurationID: llamacloud.String(extractConfig.ID), },})if err != nil { log.Fatal(err)}
// Poll for completionfor job.Status != "COMPLETED" && job.Status != "FAILED" && job.Status != "CANCELLED" { time.Sleep(2 * time.Second) job, err = client.Extract.Get(ctx, job.ID, llamacloud.ExtractGetParams{}) if err != nil { log.Fatal(err) }}
if job.Status == "COMPLETED" { fmt.Println(job.ExtractResult.RawJSON())}import ai.llamaindex.llamacloud.models.extract.ExtractCreateParams;import ai.llamaindex.llamacloud.models.extract.ExtractGetParams;import ai.llamaindex.llamacloud.models.extract.ExtractV2Job;import ai.llamaindex.llamacloud.models.extract.ExtractV2JobCreate;import ai.llamaindex.llamacloud.models.files.FileCreateParams;import ai.llamaindex.llamacloud.models.files.FileCreateResponse;import java.nio.file.Paths;
// Upload a fileFileCreateResponse fileObj = client.files().create( FileCreateParams.builder() .file(Paths.get("./invoices/invoice_001.pdf")) .purpose("extract") .build());
// Extract using the saved configuration — no inline config neededExtractV2Job job = client.extract().create( ExtractCreateParams.builder() .extractV2JobCreate( ExtractV2JobCreate.builder() .fileInput(fileObj.id()) .configurationId(extractConfig.id()) .build()) .build());
// Poll for completionwhile (!job.status().equals("COMPLETED") && !job.status().equals("FAILED") && !job.status().equals("CANCELLED")) { Thread.sleep(2000); job = client.extract().get(ExtractGetParams.builder().jobId(job.id()).build());}
if (job.status().equals("COMPLETED")) { System.out.println(job.extractResult());}# Upload a fileFILE_ID=$(llp files create --file ./invoices/invoice_001.pdf --purpose extract | jq -r '.id')
# Extract using the saved configuration — no inline config neededJOB_ID=$(llp extract create \ --file-input "$FILE_ID" \ --configuration-id "$EXTRACT_CONFIG_ID" \ | jq -r '.id')
# Poll for completionwhile true; do JOB=$(llp extract get --job-id "$JOB_ID") STATUS=$(echo "$JOB" | jq -r '.status') case "$STATUS" in COMPLETED|FAILED|CANCELLED) break ;; esac sleep 2done
echo "$JOB" | jq '.extract_result'# Extract using a saved configuration IDcurl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v2/extract?project_id={PROJECT_ID}' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ -d '{ "file_input": "{FILE_ID}", "configuration_id": "{EXTRACT_CONFIG_ID}" }'Using parse_config_id with Inline Config
Section titled “Using parse_config_id with Inline Config”You don’t need a saved extract configuration to use a saved parse configuration. You can reference a parse_config_id directly inside an inline configuration block:
# Use a saved parse config with an inline extract configjob = client.extract.create( file_input=file_obj.id, configuration={ "parse_config_id": parse_config.id, "data_schema": InvoiceData.model_json_schema(), "extraction_target": "per_doc", "tier": "agentic", },)// invoiceSchema defined earlier (see Create an Extract Configuration above)let job = await client.extract.create({ file_input: fileObj.id, configuration: { parse_config_id: 'cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', data_schema: invoiceSchema, extraction_target: 'per_doc', tier: 'agentic', },});// Use a saved parse config with an inline extract configschema := map[string]*llamacloud.ExtractConfigurationDataSchemaUnionParam{ "type": {OfString: llamacloud.String("object")}, "properties": {OfAnyMap: map[string]any{ "vendor_name": map[string]any{"type": "string", "description": "Name of the vendor"}, "total_amount": map[string]any{"type": "number", "description": "Total amount due"}, }}, "required": {OfAnyArray: []any{"vendor_name", "total_amount"}},}
job, err := client.Extract.New(ctx, llamacloud.ExtractNewParams{ ExtractV2JobCreate: llamacloud.ExtractV2JobCreateParam{ FileInput: fileObj.ID, Configuration: llamacloud.ExtractConfigurationParam{ ParseConfigID: llamacloud.String(parseConfig.ID), DataSchema: schema, ExtractionTarget: llamacloud.ExtractConfigurationExtractionTargetPerDoc, Tier: llamacloud.ExtractConfigurationTierAgentic, }, },})if err != nil { log.Fatal(err)}import ai.llamaindex.llamacloud.models.extract.ExtractConfiguration;
// Use a saved parse config with an inline extract configExtractConfiguration.DataSchema schema = ExtractConfiguration.DataSchema.builder() .putAdditionalProperty("type", JsonValue.from("object")) .putAdditionalProperty("properties", JsonValue.from(Map.of( "vendor_name", Map.of("type", "string", "description", "Name of the vendor"), "total_amount", Map.of("type", "number", "description", "Total amount due")))) .putAdditionalProperty("required", JsonValue.from(List.of("vendor_name", "total_amount"))) .build();
ExtractV2Job job = client.extract().create( ExtractCreateParams.builder() .extractV2JobCreate( ExtractV2JobCreate.builder() .fileInput(fileObj.id()) .configuration( ExtractConfiguration.builder() .parseConfigId(parseConfig.id()) .dataSchema(schema) .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .tier(ExtractConfiguration.Tier.AGENTIC) .build()) .build()) .build());# Use a saved parse config with an inline extract configSCHEMA='{"type": "object", "properties": {"vendor_name": {"type": "string", "description": "Name of the vendor"}, "total_amount": {"type": "number", "description": "Total amount due"}}, "required": ["vendor_name", "total_amount"]}'
llp extract create \ --file-input "$FILE_ID" \ --configuration "{\"parse_config_id\": \"$PARSE_CONFIG_ID\", \"data_schema\": $SCHEMA, \"extraction_target\": \"per_doc\", \"tier\": \"agentic\"}"curl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v2/extract?project_id={PROJECT_ID}' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ -d '{ "file_input": "{FILE_ID}", "configuration": { "parse_config_id": "{PARSE_CONFIG_ID}", "data_schema": { "type": "object", "properties": { "vendor_name": {"type": "string", "description": "Name of the vendor"}, "total_amount": {"type": "number", "description": "Total amount due"} }, "required": ["vendor_name", "total_amount"] }, "extraction_target": "per_doc", "tier": "agentic" } }'This is useful when you want consistent parsing across jobs but need different extraction schemas for different use cases.
Batch Processing with Saved Configurations
Section titled “Batch Processing with Saved Configurations”Saved configurations simplify batch workflows — just pass the same configuration_id for every file:
import osimport asynciofrom pathlib import Pathfrom llama_cloud import AsyncLlamaCloud
async_client = AsyncLlamaCloud(api_key=os.environ["LLAMA_CLOUD_API_KEY"])EXTRACT_CONFIG_ID = extract_config.id # Your saved config ID
async def process_file(file_path: Path) -> dict: file_obj = await async_client.files.create( file=str(file_path), purpose="extract" )
job = await async_client.extract.create( file_input=file_obj.id, configuration_id=EXTRACT_CONFIG_ID, )
while job.status not in ("COMPLETED", "FAILED", "CANCELLED"): await asyncio.sleep(2) job = await async_client.extract.get(job.id)
if job.status == "COMPLETED": return {"file": file_path.name, "data": job.extract_result} return {"file": file_path.name, "error": job.error_message}
async def main(): files = list(Path("./invoices").glob("*.pdf")) semaphore = asyncio.Semaphore(10)
async def bounded(path): async with semaphore: return await process_file(path)
results = await asyncio.gather(*[bounded(f) for f in files])
for r in results: if "data" in r: print(f" {r['file']}: {r['data']}") else: print(f" {r['file']}: ERROR - {r['error']}")
asyncio.run(main())import * as fs from 'fs';import * as path from 'path';import LlamaCloud from '@llamaindex/llama-cloud';
const client = new LlamaCloud({ apiKey: process.env.LLAMA_CLOUD_API_KEY!,});
const EXTRACT_CONFIG_ID = 'cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
async function processFile(filePath: string) { const fileObj = await client.files.create({ file: fs.createReadStream(filePath), purpose: 'extract', });
let job = await client.extract.create({ file_input: fileObj.id, configuration_id: EXTRACT_CONFIG_ID, });
while (!['COMPLETED', 'FAILED', 'CANCELLED'].includes(job.status)) { await new Promise((r) => setTimeout(r, 2000)); job = await client.extract.get(job.id); }
return { file: path.basename(filePath), status: job.status, data: job.extract_result, error: job.error_message, };}
// Process files with bounded concurrencyconst filePaths = ['invoice_001.pdf', 'invoice_002.pdf', 'invoice_003.pdf'];const concurrency = 10;
for (let i = 0; i < filePaths.length; i += concurrency) { const batch = filePaths.slice(i, i + concurrency); const results = await Promise.all(batch.map(processFile)); results.forEach((r) => console.log(`${r.file}: ${r.status}`));}package main
import ( "context" "fmt" "os" "path/filepath" "sync" "time"
llamacloud "github.com/run-llama/llama-parse-go")
func main() { ctx := context.Background() client := llamacloud.NewClient() sem := make(chan struct{}, 10) // Limit concurrency
extractConfigID := "cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // Your saved config ID
type result struct { file string data llamacloud.ExtractV2JobExtractResultUnion err error }
processFile := func(filePath string) result { sem <- struct{}{} defer func() { <-sem }()
name := filepath.Base(filePath)
f, err := os.Open(filePath) if err != nil { return result{file: name, err: err} } defer f.Close()
fileObj, err := client.Files.New(ctx, llamacloud.FileNewParams{ File: f, Purpose: "extract", }) if err != nil { return result{file: name, err: err} }
job, err := client.Extract.New(ctx, llamacloud.ExtractNewParams{ ExtractV2JobCreate: llamacloud.ExtractV2JobCreateParam{ FileInput: fileObj.ID, ConfigurationID: llamacloud.String(extractConfigID), }, }) if err != nil { return result{file: name, err: err} }
for job.Status != "COMPLETED" && job.Status != "FAILED" && job.Status != "CANCELLED" { time.Sleep(2 * time.Second) job, err = client.Extract.Get(ctx, job.ID, llamacloud.ExtractGetParams{}) if err != nil { return result{file: name, err: err} } }
return result{file: name, data: job.ExtractResult} }
filePaths := []string{"invoice_001.pdf", "invoice_002.pdf", "invoice_003.pdf"} results := make([]result, len(filePaths))
var wg sync.WaitGroup for i, path := range filePaths { wg.Add(1) go func(i int, path string) { defer wg.Done() results[i] = processFile(path) }(i, path) } wg.Wait()
for _, r := range results { if r.err != nil { fmt.Printf(" %s: ERROR - %v\n", r.file, r.err) } else { fmt.Printf(" %s: %s\n", r.file, r.data.RawJSON()) } }}import ai.llamaindex.llamacloud.models.extract.ExtractCreateParams;import ai.llamaindex.llamacloud.models.extract.ExtractGetParams;import ai.llamaindex.llamacloud.models.extract.ExtractV2Job;import ai.llamaindex.llamacloud.models.extract.ExtractV2JobCreate;import ai.llamaindex.llamacloud.models.files.FileCreateParams;import ai.llamaindex.llamacloud.models.files.FileCreateResponse;import java.nio.file.Paths;import java.util.ArrayList;import java.util.List;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.Future;
ExecutorService pool = Executors.newFixedThreadPool(10); // Limit concurrencyString extractConfigId = "cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Your saved config ID
List<String> filePaths = List.of("invoice_001.pdf", "invoice_002.pdf", "invoice_003.pdf");List<Future<ExtractV2Job>> futures = new ArrayList<>();
for (String filePath : filePaths) { futures.add(pool.submit(() -> { FileCreateResponse fileObj = client.files().create( FileCreateParams.builder() .file(Paths.get(filePath)) .purpose("extract") .build());
ExtractV2Job job = client.extract().create( ExtractCreateParams.builder() .extractV2JobCreate( ExtractV2JobCreate.builder() .fileInput(fileObj.id()) .configurationId(extractConfigId) .build()) .build());
while (!job.status().equals("COMPLETED") && !job.status().equals("FAILED") && !job.status().equals("CANCELLED")) { Thread.sleep(2000); job = client.extract().get(ExtractGetParams.builder().jobId(job.id()).build()); }
return job; }));}
for (Future<ExtractV2Job> future : futures) { System.out.println(future.get().extractResult());}pool.shutdown();EXTRACT_CONFIG_ID="cfg-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # Your saved config ID
for FILE in ./invoices/*.pdf; do FILE_ID=$(llp files create --file "$FILE" --purpose extract | jq -r '.id')
JOB_ID=$(llp extract create \ --file-input "$FILE_ID" \ --configuration-id "$EXTRACT_CONFIG_ID" \ | jq -r '.id')
while true; do JOB=$(llp extract get --job-id "$JOB_ID") STATUS=$(echo "$JOB" | jq -r '.status') case "$STATUS" in COMPLETED|FAILED|CANCELLED) break ;; esac sleep 2 done
if [ "$STATUS" = "COMPLETED" ]; then echo " $(basename "$FILE"): $(echo "$JOB" | jq -c '.extract_result')" else echo " $(basename "$FILE"): ERROR - $(echo "$JOB" | jq -r '.error_message')" fidoneListing Saved Configurations
Section titled “Listing Saved Configurations”You can list your saved configurations filtered by product type:
# List all extract configurationsfor cfg in client.configurations.list(product_type=["extract_v2"]): print(f" {cfg.name} ({cfg.id})")
# List all parse configurationsfor cfg in client.configurations.list(product_type=["parse_v2"]): print(f" {cfg.name} ({cfg.id})")// List all extract configurationsfor await (const cfg of client.configurations.list({ product_type: ['extract_v2'] })) { console.log(` ${cfg.name} (${cfg.id})`);}
// List all parse configurationsfor await (const cfg of client.configurations.list({ product_type: ['parse_v2'] })) { console.log(` ${cfg.name} (${cfg.id})`);}// List all extract configurationsextractConfigs := client.Configurations.ListAutoPaging(ctx, llamacloud.ConfigurationListParams{ ProductType: []string{"extract_v2"},})for extractConfigs.Next() { cfg := extractConfigs.Current() fmt.Printf(" %s (%s)\n", cfg.Name, cfg.ID)}if err := extractConfigs.Err(); err != nil { log.Fatal(err)}
// List all parse configurationsparseConfigs := client.Configurations.ListAutoPaging(ctx, llamacloud.ConfigurationListParams{ ProductType: []string{"parse_v2"},})for parseConfigs.Next() { cfg := parseConfigs.Current() fmt.Printf(" %s (%s)\n", cfg.Name, cfg.ID)}if err := parseConfigs.Err(); err != nil { log.Fatal(err)}import ai.llamaindex.llamacloud.models.configurations.ConfigurationListParams;
// List all extract configurationsclient.configurations().list( ConfigurationListParams.builder() .addProductType(ConfigurationListParams.ProductType.EXTRACT_V2) .build()) .autoPager() .forEach(cfg -> System.out.println(" " + cfg.name() + " (" + cfg.id() + ")"));
// List all parse configurationsclient.configurations().list( ConfigurationListParams.builder() .addProductType(ConfigurationListParams.ProductType.PARSE_V2) .build()) .autoPager() .forEach(cfg -> System.out.println(" " + cfg.name() + " (" + cfg.id() + ")"));# List extract configurationsllp configurations list --product-type extract_v2 | jq -r '.[] | " \(.name) (\(.id))"'
# List parse configurationsllp configurations list --product-type parse_v2 | jq -r '.[] | " \(.name) (\(.id))"'# List extract configurationscurl -X 'GET' \ 'https://api.cloud.llamaindex.ai/api/v1/beta/configurations?project_id={PROJECT_ID}&product_type=extract_v2' \ -H 'accept: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
# List parse configurationscurl -X 'GET' \ 'https://api.cloud.llamaindex.ai/api/v1/beta/configurations?project_id={PROJECT_ID}&product_type=parse_v2' \ -H 'accept: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"When to Use Saved Configurations
Section titled “When to Use Saved Configurations”| Scenario | Approach |
|---|---|
| Quick prototyping, one-off jobs | Inline configuration — fastest to get started |
| Consistent settings across many jobs | Saved configuration_id — define once, use everywhere |
| Same parse settings, different extract schemas | Saved parse_config_id in inline config |
| Team sharing a standard pipeline | Saved configuration_id — everyone uses the same config |
| UI-to-code workflow | Configure in UI playground → save → use config ID in SDK |