One converter, many files
Every earlier lesson constructed a fresh DocumentConverter() inside main(), that's the right shape for a single-file example. It is not the right shape for a real batch job: constructing a converter isn't free, its pipelines load model weights the first time each is used. Lesson 6's checkpoint already reused one converter across a loop, this lesson names the pattern explicitly and uses convert_all(), docling's built-in batch entry point, instead of writing the loop by hand.
converter = DocumentConverter()results = list(converter.convert_all([path1, path2, path3, ...]))convert_all() takes any iterable of sources (paths, URLs, or DocumentStreams, mixed formats included) and returns an iterator of ConversionResults, one per source, in order. It's functionally equivalent to calling .convert() in a loop, the value is that it's the documented, idiomatic entry point for "convert several things", so it's what to reach for instead of writing the loop yourself.
Why reuse actually matters here
This lesson converts four structurally different files (a PDF with a table, a DOCX, a PPTX, another PDF) with one DocumentConverter. Every one of them shares the same underlying layout and table-structure models where applicable, format-specific backends (DOCX, PPTX) don't load PDF-specific models at all, and PDF-specific models only get initialized once, not once per PDF. Constructing a new converter per file would repeat that initialization cost for no benefit, the models themselves don't change between files.
Checkpoint
convert_all(sources): docling's built-in batch entry point, takes any iterable of paths/URLs/streams, returns an iterator ofConversionResults.- Construct one
DocumentConverter, not one per file: model initialization cost is paid once, not repeated per document. - Mixed formats in one batch are fine:
convert_all()doesn't require every source to share a format.
If anything here still feels unclear, ask before moving to Lesson 16.