Core AI model zoo

MinerU2.5-Pro (1.2B) — Core AI whole-page document parsing

On-device whole-page document structuring on Core AI. A port of opendatalab/MinerU2.5-Pro-2605-1.2B (Apache-2.0, 1.2B) — a small, SOTA-quality document parser (OmniDocBench v1.6 95.69). Unlike a per-prompt recognizer, MinerU2.5 does the whole page in one model: a layout pass finds the blocks (title / text / table / formula / figure) and their reading order, then a recognition pass reads each region into plain text, HTML tables (<table>…), or LaTeX — assembled into structured Markdown / JSON. This is the piece the zoo’s per-region OCRs (Unlimited-OCR, GLM-OCR) leave to a separate layout detector; MinerU folds it into the same weights.

MinerU2.5 is stock Qwen2-VL (Qwen2VLForConditionalGeneration): a Qwen2-VL ViT vision tower + a Qwen2-0.5B text decoder, no custom code. This port is the shipped Qwen3-VL / GLM-OCR vision idiom (the image_embeds + rope-shift static-input hook) with a Qwen2 text decode — no deepstack, no MoE, no MLA. The vision tower runs once; its image_embeds are injected at the image-placeholder positions (V + slot, row-major over the merged grid) and the text decodes on top. The host runs the model twice per page (layout prompt, then recognition prompts).

⬇️ Converted .aimodel bundles: mlboydaisuke/MinerU2.5-Pro-CoreAIvision/ + decoder/ (768-token recognition grid, Qwen2-VL ViT fp16 + int8lin decoder, pf64 chunked prefill) + layout/ (a 1036² square recognition/detection grid for the 2-stage) + tokenizer/. Apache-2.0.

Architecture

Verified (M4 Max + iPhone 17 Pro, GPU, Core AI pipelined engine)

Run in app — KitMineruReader (Mac; iPhone single-pass)

Both grids ride the kit’s VL rope-shift runtime (VLRuntime). Pages are CLIP-normalized and patchified (the VLImagePreprocessor non-square + .stretch/.aspectFitPad paths added for Qwen2-VL). Two entry points:

// Single-pass (768 grid): whole page → plain text (reading order). Runs on iPhone (chunked prefill).
let reader = try await KitMineruReader(catalog: "mineru2.5-pro")
let text = try await reader.read(imageAt: documentURL)

// 2-stage (structured Markdown, tables as <table> HTML). Needs the layout bundle too.
let reader = try await KitMineruReader(
    visionDir: rec.vision, decoderDir: rec.decoder,
    layoutVisionDir: layout.vision, layoutDecoderDir: layout.decoder)
let markdown = try await reader.readStructured(imageAt: documentURL)

2-stage (readStructured, mirrors mineru-vl-utils two_step_extract + json2md):

  1. Layout on the page stretched into 1036² square (VLArchitecture.mineruLayout, 37×37 = 1369 tokens) → Layout Detection: emits <|box_start|>…<|ref_start|>type… blocks. A 768 portrait grid mis-detects here — the square high-res grid is required. Boxes are 0–1 of the square, so they map linearly onto the original page.
  2. Recognition per region on the 768 grid (.mineru): each block is cropped from the original and read by type — Table Recognition: emits OTSL (<fcel>/<nl>), kept (not skipped) and converted to <table> HTML; Formula Recognition: → LaTeX; else plain text.
  3. json2md joins the region contents in reading order.

Verified end-to-end in the ReadDoc Mac app: an 8-block page → title/paragraphs + a 5-row <table>, byte-identical to the reference. ~11 s load (both bundles) + ~11 s/page. The single-pass path also runs on iPhone; the 2-stage’s 1036² layout grid is Mac-tier (two bundles, heavy).

Pipeline (host side)

page image → letterbox into 672×896 (aspect-fit + white pad) → CLIP-normalize
           → non-square patchify [3072, 1176] (block-major, 64×48 patches)
           → vision .aimodel → image_embeds [768, 896]
           → prompt: [ <|vision_start|>, <image>×768, <|vision_end|>, "Text Recognition:" ]
             (image ids → V+slot; shift_start = img_start+768, shift_amount = 768−32 = 736)
           → decoder S=1 pipelined greedy decode → tokens → detokenize → markdown / <table>HTML / LaTeX

The full 2-stage whole-page mode (layout boxes → per-region crop → recognition → json2md) follows opendatalab/mineru-vl-utils (MinerUClient.two_step_extract + post_process.json2md) — prompts by type: text → "Text Recognition:" · table → "Table Recognition:" · formula → "Formula Recognition:" · figure → "Image Analysis:".

Use / reproduce

Notes