/vibe:ocr-vlm-expertfrom vibe
Expert guidance on OCR and document parsing using Mistral OCR, Surya, GOT-OCR2.0, Marker, Docling, and Unstructured. Helps choose between API OCR, self-hosted models, and VLM-based extraction for PDFs, tables, equations, and handwriting.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in modern document parsing and OCR. You pick between dedicated OCR models (Mistral OCR, Surya, GOT-OCR2), pipeline frameworks (Marker, Docling, Unstructured), and general VLMs (Qwen2.5-VL, Claude) per cost and quality, then ship LLM-ready Markdown/JSON.
| Layer | Tool | Use |
|---|---|---|
| API OCR | Mistral OCR (mistral-ocr-2505) | Hosted, best quality on PDFs incl. handwriting + tables |
| Open OCR model | Surya (90+ langs), GOT-OCR2.0 (unified), Tesseract (legacy) | Self-host text extraction |
| End-to-end pipeline | Marker, Docling, Unstructured, MinerU | Orchestrate PDF -> structured output |
| General VLM | Qwen2.5-VL, Claude, GPT-4o | Flexible OCR + reasoning |
| Layout-only | LayoutLMv3, DocLayoutYOLO | Detect blocks before OCR |
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
# Upload PDF
uploaded = client.files.upload(
file={"file_name": "doc.pdf", "content": open("doc.pdf", "rb")},
purpose="ocr",
)
signed_url = client.files.get_signed_url(file_id=uploaded.id).url
result = client.ocr.process(
model="mistral-ocr-latest",
document={"type": "document_url", "document_url": signed_url},
include_image_base64=True, # extracts embedded images
)
for page in result.pages:
print(page.markdown) # Markdown with images and tables
Mistral OCR ~ $1 per 1000 pages, leads on tables, equations, and handwriting (mistral-ocr-2505 improvement).
pip install surya-ocr
surya_ocr docs/ --langs en --output_dir out/
surya_layout docs/ --output_dir layout/
surya_table docs/ --output_dir tables/
from surya.ocr import run_ocr
from surya.model.detection.model import load_model as load_det
from surya.model.recognition.model import load_model as load_rec
from PIL import Image
det_model, det_proc = load_det(), None
rec_model, rec_proc = load_rec(), None
preds = run_ocr([Image.open("page.png")], [["en"]], det_model, det_proc, rec_model, rec_proc)
for line in preds[0].text_lines: print(line.text, line.bbox, line.confidence)
Surya: 90+ languages, line-level detection, layout, reading order, table recognition. Apache 2.0.
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("ucaslcl/GOT-OCR2_0", trust_remote_code=True)
model = AutoModel.from_pretrained("ucaslcl/GOT-OCR2_0", trust_remote_code=True,
low_cpu_mem_usage=True, device_map="cuda", use_safetensors=True).eval()
res = model.chat(tokenizer, "page.png", ocr_type="format") # 'ocr' | 'format' | 'fine-grained'
print(res)
GOT-OCR2 is a 580M unified model that handles plain text, tables, charts, equations, sheet music, and molecular formulas in one pass.
pip install marker-pdf
marker_single doc.pdf --output_dir out/ --output_format markdown
marker /pdfs --workers 4 --max_pages 50
from marker.converters.pdf import PdfConverter
from marker.models import create_model_dict
converter = PdfConverter(artifact_dict=create_model_dict())
rendered = converter("doc.pdf")
# rendered.markdown, rendered.images, rendered.metadata
Marker is fast, accurate, handles equations (LaTeX) and tables. Best end-to-end open pipeline as of 2025.
from docling.document_converter import DocumentConverter
converter = DocumentConverter()
result = converter.convert("doc.pdf")
print(result.document.export_to_markdown()) # also export_to_dict, export_to_doctags
Docling outputs DocTags - a structured tag format LLMs can reason over far better than raw markdown. Strong on technical PDFs.
from unstructured.partition.auto import partition
elements = partition(filename="doc.pdf", strategy="hi_res")
for el in elements:
print(type(el).__name__, el.text[:80])
# strategy: "fast" (PDF text only), "hi_res" (layout + OCR), "ocr_only"
Unstructured handles 20+ formats (PDF, DOCX, PPTX, HTML, EML, etc.) with consistent element types (NarrativeText, Title, Table, Image, ListItem).
# Qwen2.5-VL with explicit grounding prompt
prompt = """Extract every visible text element. Return JSON:
{"blocks": [{"text": "...", "bbox": [x1,y1,x2,y2], "kind": "title|paragraph|table_cell|caption"}]}"""
# Send page image + prompt - Qwen2.5-VL has native bbox grounding.
Use VLMs when you need reasoning about the page (summarize, classify, extract specific fields) rather than dumping all text.
from marker.converters.pdf import PdfConverter
from marker.models import create_model_dict
rendered = PdfConverter(artifact_dict=create_model_dict())("doc.pdf")
md = rendered.markdown
# Chunk with structure-aware splitter
from langchain_text_splitters import MarkdownHeaderTextSplitter, RecursiveCharacterTextSplitter
hdr = MarkdownHeaderTextSplitter([("#", "h1"), ("##", "h2"), ("###", "h3")])
sections = hdr.split_text(md)
splitter = RecursiveCharacterTextSplitter(chunk_size=1200, chunk_overlap=150)
chunks = splitter.split_documents(sections)
| Tool | Throughput |
|---|---|
| Mistral OCR API | API; ~$1/1000 pages |
| Surya on RTX 4090 | ~10-30 pages/s (depends on doc) |
| GOT-OCR2 on RTX 4090 | ~3-5 pages/s |
| Marker on RTX 4090 | ~1-3 pages/s end-to-end |
| Qwen2.5-VL-7B | ~0.5-2 pages/s, expensive but flexible |
--workers.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job