Overview
VLM processing in Chunkr allows you to:- Generate enhanced content using fine-tuned models (
strategy: LLM) - Add custom LLM-powered analysis to any segment type
- Process complex tables with better structure understanding
- Extract mathematical formulas as LaTeX
- Generate custom descriptions for images and diagrams
Generation Strategies
Auto Strategy
Uses heuristic-based generation - fast and efficient:LLM Strategy
Uses Chunkr’s fine-tuned Vision-Language Models:LLM strategy uses the page image as context to generate more accurate structured content
Default VLM Configuration
Some segment types use LLM strategy by default:Custom LLM Prompts
Add custom LLM-powered analysis to any segment using thellm field:
Python
segment.llm and can be included in chunks via embed_sources.
Extended Context
Use the full page image as context for LLM generation:false
Configuring LLM Models
Chunkr supports global LLM configuration to control which models are used for VLM processing.LLM Processing Configuration
Python
- Model ID
- Fallback Strategy
- Max Completion Tokens
- Temperature
Image Cropping
Control when segment images are cropped and stored:- Auto
- All
segment.image as presigned URLs.
Complete VLM Example
Python
Accessing VLM Output
VLM-generated content is available in multiple fields:Python
Embed Sources with VLM
Control which VLM outputs are included in chunk embeddings:Python
embed field will contain:
- The HTML table structure (
Content) - The LLM summary (
LLM)
Order matters! Sources appear in the embed field in the order specified.
Use Cases
Enhanced Table Extraction
Enhanced Table Extraction
Mathematical Formula Extraction
Mathematical Formula Extraction
Image Description for RAG
Image Description for RAG
Document Summarization
Document Summarization
Performance Considerations
Tips:- Use
strategy: LLMonly for complex content (tables, formulas, pictures) - Use
strategy: Autofor simple text segments - Set
extended_context: falseunless you need full page context - Configure
max_completion_tokensappropriately to control costs - Use
temperature: 0.0for consistent, deterministic output
Error Handling with VLM
Control how VLM errors are handled:Fail: Stop processing on any error (default)Continue: Continue processing despite LLM refusals or failures
Use
Continue for fault-tolerant processing when some VLM failures are acceptableBest Practices
- Use VLM strategically - Only apply to segments that benefit from visual understanding
- Write clear prompts - Be specific about what you want in custom
llmprompts - Enable high resolution - Set
high_resolution: truefor better VLM input quality - Test and iterate - Experiment with different prompts and configurations
- Monitor costs - VLM processing can be expensive at scale
- Choose appropriate models - Different models have different strengths and costs
Next Steps
- Learn about custom chunking to optimize VLM output usage
- See processing documents for core API usage
- Review the migration guide for content generation changes