Overview
LLM Magic provides multiple extraction strategies to handle different document sizes and complexity levels. Each strategy balances speed, cost, and accuracy differently.Available Strategies
Access the list of available strategies:simple- Single-pass extractionsequential- Sequential batch processingsequential-auto-merge- Sequential with automatic mergingparallel- Parallel batch processingparallel-auto-merge- Parallel with automatic mergingdouble-pass- Two-pass extraction for maximum accuracydouble-pass-auto-merge- Two-pass with automatic merging
Simple Strategy
The simplest and fastest strategy. Processes only the first batch of artifacts.Best for: Short documents, quick summaries, single-page PDFsPros: Fastest, lowest costCons: Only processes first batch of artifacts
Sequential Strategy
Processes artifacts in batches sequentially, passing previous data to the next batch for context.Best for: Long documents, maintaining context across pagesPros: Maintains context, processes all artifactsCons: Slower than parallel, sequential processing
Parallel Strategy
Processes batches concurrently, then merges results using an LLM.Best for: Large documents where speed is criticalPros: Fastest for large documents, processes all artifactsCons: Higher cost, requires merge step, may lose some context
Double-Pass Strategy
Performs two passes: first parallel for broad coverage, then sequential for detail and accuracy.Best for: Complex documents requiring high accuracyPros: Highest accuracy, catches details missed in first passCons: Highest cost, slowest processing time
Auto-Merge Variants
Strategies ending in-auto-merge skip the LLM merge step and use automatic data merging:
Registering Custom Strategies
Extend the extraction system with custom strategies:Extractor:
Strategy Comparison
Simple
Speed: FastestCost: LowestAccuracy: BasicUse case: Short documents
Sequential
Speed: ModerateCost: ModerateAccuracy: GoodUse case: Long documents
Parallel
Speed: FastCost: HigherAccuracy: GoodUse case: Large documents
Double-Pass
Speed: SlowestCost: HighestAccuracy: BestUse case: Complex extraction
Performance Tips
Choosing Chunk Size
Choosing Chunk Size
Adjust chunk size based on your model’s context window:
Concurrency Settings
Concurrency Settings
Control how many batches process simultaneously:
Monitoring Progress
Monitoring Progress
Track extraction progress with callbacks: