Data Extraction¶
KARLI-hosted data-extraction models turn uploaded files into structured text that downstream components can consume. They are selected from the Read File component when its Extraction Backend is set to karli.
KARLI is currently the only provider offering this category of model.
Available Models¶
| Model | Accepts | Notes |
|---|---|---|
karli/default-data-extraction |
Any | KARLI-managed default; routes the file to a sensible extractor. |
karli/data-extraction-moe-latest |
Any | Mixture-of-Experts router — picks the optimal extractor per file type (and per page for PDFs). See details below. The only model that reports extraction progress. |
docling-project/docling |
Documents | Docling, run server-side by KARLI. |
datalab-to/marker |
Documents | Marker. |
opendatalab/MinerU |
Documents | MinerU. |
karli/multimodal-data-extraction |
Documents | Multimodal hybrid pipeline. |
openai/whisper-large-v3 |
Audio | Audio transcription via Whisper. |
The Read File component validates the uploaded file against the chosen model's accepted type before uploading — submitting, for example, a PDF to the Whisper model produces an error rather than an upload.
Mixture-of-Experts Routing¶
The karli/data-extraction-moe-latest model automatically selects the best extractor for each file type:
| File Category | Extensions | Extractor |
|---|---|---|
| Per-page router (see below) | ||
| Word documents | doc, docx | Docling |
| Presentations | ppt, pptx | Docling |
| Spreadsheets / tables | xls, xlsx, csv | Default |
| HTML | htm, html, xhtml | MarkItDown |
| Images | png, jpg, jpeg, gif, bmp, tiff, tif, webp | Vision |
| Audio | aac, mpeg, wav, webm, mp3, mp4 | Audio (Whisper) |
| eml, msg, pst | Default | |
| Plain text | txt | Default |
Per-page PDF routing¶
For PDFs the MoE model inspects each page individually, classifies its complexity, and dispatches it to the most suitable extractor:
| Page Category | Extractor | Needs Vision |
|---|---|---|
| Scanned page | Marker | Yes |
| Handwriting | Marker | Yes |
| Image-dominant | Marker | Yes |
| Complex layout | Marker | No |
| Plain text | MinerU | No |
| Mixed content | Marker | No |
This means a single PDF can be processed by multiple extractors — for example, a text-heavy page goes through MinerU while a scanned page is routed to Marker with vision support.
Request Shape¶
Extraction runs as an asynchronous task on the KARLI side:
- Submit — the component sends a multipart
POSTto{KARLI_BASE_URL}/data-extraction/submit. Form fieldextractorModelcarries the selected model (mapped to its KARLI identifier), and the file part carries the document or audio file. The response carries the task'staskId. - Follow — the component follows the task's event stream at
{KARLI_BASE_URL}/data-extraction/tasks/{taskId}/eventsuntil its result arrives. If the stream is unavailable or breaks off, it falls back to polling{KARLI_BASE_URL}/data-extraction/tasks/{taskId}every 5 seconds, for at most 30 minutes.
Every request authenticates with the priority described below.
The result is a JSON object whose segments are concatenated into a single text payload; segments with a title are emitted as ## <title> Markdown headers.
Progress reporting¶
While the task runs, the component reports its progress — pages done out of the total — in its logs and on the flow's run stream, from where Karli Studio shows it as a progress bar.
Only with the MoE model
Progress is currently reported only by karli/data-extraction-moe-latest. Other models are extracted the same way, but show no progress until the result arrives.
Authentication¶
Extraction requests authenticate using the following priority:
- JWT (if a Karli Studio session is active) — sent as
Authorization: Bearer <token>. KARLI_API_KEY(from the component attribute, provider variables, or theKARLI_API_KEYenvironment variable) — sent asX-API-Key: <key>.- Error — if neither is available, a
ValueErroris raised instructing the user to configureKARLI_API_KEYor access via Karli Studio.
External API users
If you call the Agentlab API directly and your flows include a FileComponent with document extraction, you must configure the KARLI_API_KEY provider variable or set the KARLI_API_KEY environment variable on the server. See the Model Providers overview for details.
See Document Extraction for how the Read File component uses these models in practice, including the downstream Data shape.