← BACK TO LEVEL SELECT

🤖 Agentic AI · ★★★ FEATURED

Chomper Demo — See What Your LLM Actually Reads

See how Chomper prepares documents for RAG beside a naive 400-word chunker, down to the exact text an LLM would receive.

Overview

Chomper Demo shows exactly what an LLM gets to read after a document is parsed for retrieval-augmented generation. It puts my document parser Chomper beside a naive chunker that cuts every 400 words, then maps both results back onto the original pages.

Open Chomper Demo →

The main Chomper project covers the parser and its internals. This page is about seeing its output, checking where it helps, and seeing where it still falls short.

What you can do with it

Pick one of five documents: a fictional Northwind Microfinance annual report, the real CC BY 4.0 FlyGM research paper (arXiv 2602.17997), a scanned letter, an investor deck in PPTX, or a loan agreement in DOCX.

You can also upload your own PDF, PPTX, or DOCX. The limit is about 4 MB and 100 pages. Uploads are parsed in memory and never stored.

The split view puts Chomper and the 400-word chunker side by side. Drag the divider, move through the pages, and turn each layer on or off:

  • Headers and footers that Chomper removed, with the reason for each removal.
  • Headings and the signal that found them: size, bold text, or numbering.
  • Tables and formulas kept as complete units.
  • Pictures and charts returned by Chomper but not read by it.
  • Chunk boundaries for both approaches.

The highlighting works both ways. Select text on a page and the exact text lights up in the chunk an LLM gets. Select text in a chunk and the exact words light up on the page. Every line is mapped to character offsets, and the build checks 100% coverage.

The scoreboard

The samples include checks where a fixed word count causes visible damage.

SampleCheckChomperNaive 400 words
Annual reportSentences cut02
Annual reportHeader/footer lines leaked020
Research paperSentences cut018
Research paperHeader/footer lines leaked017

These are results for the two included samples, not a claim that every document will score the same way.

STAGE MAP — samples and live uploads

flowchart TB
    subgraph OFFLINE["Offline sample build"]
        SAMPLE["PDF · PPTX · DOCX samples"] --> PIPE["Python pipeline<br/>run Chomper and naive chunker"]
        PIPE --> PAGES["Page renders · lines · headings · tables"]
        PIPE --> CHUNKS["Chunks for both approaches"]
        PAGES --> MAP["Span mapping<br/>lines to character offsets"]
        CHUNKS --> MAP
        MAP --> CHECKS["Integrity checks<br/>100% mapping coverage"]
        CHUNKS --> EMBED["Precomputed sample embeddings"]
        CHECKS --> STATIC["Static demo data"]
        EMBED --> STATIC
    end
    subgraph SITE["Static Vite + TypeScript site"]
        STATIC --> VIEW["Draggable split view<br/>pages beside chunks"]
        PDFJS["pdf.js<br/>render uploaded PDFs"] --> VIEW
        SEARCH["BM25 · meaning · hybrid search"] --> RESULTS["Chunks an LLM would receive"]
    end
    subgraph UPLOAD["Live upload path"]
        FILE["Your PDF · PPTX · DOCX<br/>about 4 MB · up to 100 pages"] --> API["Vercel Python function"]
        API --> SAME["The same pipeline code<br/>parsed in memory · never stored"]
        SAME --> VIEW
        SAME --> BROWSEREMBED["transformers.js<br/>embedding in the browser"]
        BROWSEREMBED --> SEARCH
    end
    VIEW --> SEARCH

The sample work happens before deployment. That keeps the site static while preserving the page renders, span maps, checks, and embeddings needed for the comparison. Uploads take the live path through a Vercel Python function running the same pipeline code.

How “Ask it” works

“Ask it” does retrieval only. No LLM writes an answer.

Type a question and choose one of three searches:

  1. Keyword uses BM25 to find literal term matches.
  2. Meaning uses all-MiniLM-L6-v2. Sample embeddings are precomputed; upload embeddings are computed in your browser with transformers.js.
  3. Hybrid combines both result lists with reciprocal-rank fusion.

The result is not a generated paragraph. It is the exact set of chunks an LLM would be handed, shown for Chomper and the naive chunker, with the reason each chunk matched.

Images: your prompt, your way

Chomper deliberately returns images as data plus page and position. It does not decide what an image means.

The demo lets you choose how a vision model should read one: describe it, turn a flowchart into Mermaid, turn a chart into a table, read its text, or write alt text. You can also provide your own prompt.

That path uses gpt-5.4-mini through a second Vercel Python function. The key lives only in Vercel’s encrypted environment and never reaches the browser. A flowchart comes back as Mermaid in about three seconds.

What’s real / simplified / made up

PartStatus
Chomper outputReal. The samples run through Chomper’s Python pipeline
Naive comparisonSimplified on purpose. It cuts every 400 words without document structure
Page-to-chunk mappingReal. Every line maps to character offsets, with 100% coverage checked at build time
“Ask it”Real retrieval. BM25, browser embeddings, and reciprocal-rank fusion; no generated answer
Upload handlingReal. A Vercel Python function parses in memory and never stores the document
Image readingReal and live. gpt-5.4-mini reads the one image you pick, with the prompt you choose
Northwind annual reportMade up. It is a fictional sample document
FlyGM paperReal. It is a CC BY 4.0 research paper, arXiv 2602.17997
LimitsShown, not hidden. Each document reports problems detected from its own parsed data

The scanned letter has no text because Chomper has no OCR. Vector charts are not read, so their labels can leak into prose. Figure captions can merge into prose. Tables without ruling lines can be missed. Slide footers can leak into deck chunks. DOCX tables are flattened.

Building this demo also surfaced real bugs in Chomper itself: tables losing their columns inside chunks, crashes on scanned PDFs, missed semibold headings, short documents losing their headings, broken spreadsheet chunking and an infinite loop in the code chunker. Fixing the headings then exposed more: table cells and author names read as bold headings, section numbers split from their titles, and headings left alone at a chunk edge. I fixed all of them in Chomper rather than hiding their effects in the comparison.

Engineering notes

  • Built on 2026-09-26. The repository is private.
  • Offline Python pipeline. It produces page renders, lines, headings, tables, both chunk sets, integrity checks, embeddings, and span maps for the samples.
  • Static browser app. Vite and TypeScript render the interface. pdf.js handles uploaded PDFs. transformers.js runs upload embeddings in the browser.
  • Two Python functions. One parses uploads with the same pipeline code. The other reads images with gpt-5.4-mini, using your prompt.
  • No stored uploads. Files stay in memory during parsing and are discarded afterward.
  • The comparison stays inspectable. The page shows boundaries, removals, retrieval matches, and known failures instead of reducing them to one score.

Open Chomper Demo and inspect a document →

Click the map to zoom · Esc to close