document-ocr
Skill12 starsChanged 8 months agoApache-2.0View on GitHub
Convert scanned PDFs and document images into clean Markdown using docling for layout (figures, tables, reading order) plus a vision-language OCR model. Use when a user needs high-quality OCR of scanned documents, historical literature, or photographed pages — preserving multi-column reading order, diacritics, special characters, and figures. Supports local vLLM/Ollama servers and cloud vision APIs (OpenAI, Anthropic). Assumes an OCR backend already exists.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- auscahq/auscatheir own version, first seen Sep 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- auscahq/ausca★ 34same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- accounting/CLAUDE.mdCLAUDE.md
- Emu_bulk_upload_FMNH/CLAUDE.mdCLAUDE.md
- accountingSkill
- biogeobearsSkill
- emu-bulk-uploadSkill
- extract-from-pdfsSkill
- lab-orderingSkill
- nirc-badge-requestSkill
- busco-phylogenySkill
- secure-raw-data-backupSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Do not use when:
- Very specific: line 50
Always remind the user of this requirement and confirm which backend they have.
- Distinctive: line 118
Before any cloud run, note that pages are sent off-machine and billed per page.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Document OCR (docling + vision-language model)
Purpose
Turn scanned PDFs and document images into clean, structured Markdown with figures preserved. The pipeline combines:
- docling — detects layout (figures, tables, multi-column reading order) on each page, entirely on CPU.
- A vision-language model (VLM) — transcribes each full page to Markdown, preserving reading order, diacritics, ligatures, special characters (♂ ♀ ½ æ, Greek/Latin), equations (LaTeX), and tables (HTML).
docling supplies reliable figure/table crops; the VLM supplies high-quality text. Born-digital PDFs are detected and extracted directly (no server needed).
Adapted from Bruno de Medeiros' OntoMorphoGrapher proof-of-concept, where the
olmocr-docling backend processed an 18-PDF historical-entomology corpus
(1833–2015, 5 languages) with no catastrophic failures.
When to use this skill
Use when:
- A user has scanned PDFs or photographed/image pages needing accurate OCR.
- Figures and multi-column reading order must be preserved.
- The text has diacritics, special characters, or non-English content.
Do not use when:
- The PDF is already born-digital and reads fine (this tool handles it via the fast path, but you may not need it at all).
- The goal is extracting structured fields into a database — that is the
extract-from-pdfsskill, which can run downstream of this one.
⚠️ Prerequisites — an OCR backend must already exist
This skill does not start or manage any server. Standing one up is out of scope. Before running, the user must have one of:
- a running OpenAI-compatible server (vLLM/SGLang/LM Studio/llama.cpp) with a
vision model — best with olmOCR-2 (
--backend olmocr-docling); - a running Ollama server with a vision OCR model (
--backend ollama); - a cloud API key — Anthropic (
--backend anthropic-docling) or OpenAI (--backend vlm-doclingpointed at the OpenAI base URL).
Always remind the user of this requirement and confirm which backend they
have. For example setup commands (illustrative, not maintained), see
references/server_setup.md. The born-digital PDF fast path needs no backend.
Setup
conda env create -f environment.yml
conda activate document_ocrThen make the backend reachable (pick one):
export OCR_HOST=http://YOUR_HOST:30001 # vLLM / Ollama / OpenAI-compatible
# or
export ANTHROPIC_API_KEY=sk-ant-... # cloud Claude
# or
export OPENAI_API_KEY=sk-... # cloud OpenAIChoosing a backend
--backend | What it uses | Needs |
olmocr-docling ★ | docling figures + olmOCR-2 (vLLM) | --host |
vlm-docling | docling figures + any VLM (OpenAI-compat) | --host (+ --api-key for cloud) |
anthropic-docling | docling figures + Claude (cloud) | --api-key / ANTHROPIC_API_KEY |
ollama | full-page DeepSeek-OCR (Ollama) | --host |
docling | docling layout + per-region OCR | --host |
★ Recommended. See references/backends.md for the full matrix, why full-page
beats per-region OCR, model defaults, and tuning notes.
Workflow
- Confirm the backend (see Prerequisites). Ask the user which one they have and the host/model or API key. Do not assume a server is running.
- Gather inputs: a PDF, an image (
.png/.jpg/.jpeg/.tif/.tiff), or a directory of them. Ask where output should go. - Classify first (free, no server):
This labels each PDFpython scripts/ocr_document.py --input docs/ --dry-runDIGITALorNEEDS_OCRso the user knows what will hit the server. - Run OCR:
The tool runs a preflight check and fails with a clear message if the backend isn't configured. Per-page failures (timeouts, content filters) are skipped with a placeholder; the rest of the document still processes.python scripts/ocr_document.py \ --input docs/ --output-dir out/ \ --backend olmocr-docling --host "$OCR_HOST" --dpi 200 - Review
out/<stem>/<stem>.mdand thefigures/crops. Iterate if needed: raise--dpi, switch--model, or adjust the caption regex /bad_words/ language list (seereferences/backends.md).
Output
Per-document folder with the stitched markdown (<stem>.md), a per-page JSON
cache/, cropped figures/, and rendered pages/. Full schema and frontmatter
fields: references/output_format.md.
Communication guidelines
- State up front that a backend is required and is the user's responsibility.
- Before any cloud run, note that pages are sent off-machine and billed per page; do not send confidential documents to a cloud API without authorization.
- For large corpora, suggest
--dry-runfirst and a small sample before the full run, so cost and quality are known before committing.
Attribution
Pipeline and prompts adapted from Bruno de Medeiros' OntoMorphoGrapher proof-of-concept (docling + olmOCR-2 over vLLM).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

