AI PDF Extraction
The AI PDF Extractor tab turns documents into data in two deliberate steps: a deterministic Extract, then an optional AI-powered Rationalize. Load a PDF from your machine or from Google Cloud Storage to begin.
Step 1 — Extract
Datagrunt’s layout engine parses the PDF into raw structured JSON — every text element, table, and position, with confidence scores — plus a markdown rendering, and both layout and full-page images.
No AI is involved in this step. Extraction is deterministic, and the raw layout lands in your session’s documents schema, immediately queryable from the Query Editor like any other table. The document preview sits beside the output, with tabs for the JSON and markdown renderings and for the extracted images.
Step 2 — Rationalize
Raw layout JSON is faithful, but it usually isn’t the table you actually want. Describe your target schema in plain language —
“extract the line items into a flat table with columns for description, quantity, unit price, and total”
— and an LLM restructures the extraction to conform. The result is saved to the rationalized schema as a clean table, ready to join against everything else in your session. You can optionally have the model work from the rendered page images instead of the layout JSON, which helps with visually complex documents.
Choosing where the LLM runs
| Provider | Setup | Notes |
|---|---|---|
| Gemini API | Set GEMINI_API_KEY in .env |
Pick from available Gemini models in the UI. |
| Vertex AI | Application Default Credentials (gcloud auth application-default login) |
Uses your Google Cloud project; no API key needed. |
| Local Ollama | Check Use local LLM (Ollama) | Pick any model you have pulled. Your document never leaves your machine. Under containers, see the Ollama setup note. |
The local path works end-to-end on-device — e.g. a Gemma model via Ollama restructuring an invoice into typed line items saved as rationalized.invoice, with no cloud round-trip involved.