glm-ocr

Extract text, tables, and formulas from images and PDFs via local Ollama OCR.

Updated May 10, 2026
One-click install
npx skills add https://github.com/cookkie03/skills --skill glm-ocr-cookkie03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: glm-ocr
Source: https://github.com/cookkie03/skills/tree/main/glm-ocr
Command: npx skills add https://github.com/cookkie03/skills --skill glm-ocr-cookkie03

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires glmocr.

What problem does it solve? Scanned documents, photos of pages, and handwritten notes contain valuable text, tables, and formulas locked in image form. This Skill converts them into clean Markdown and structured JSON entirely on your local machine, with no cloud APIs or API keys required. ## Core Features & Use Cases - Local OCR Pipeline: Runs GLM-OCR through Ollama on localhost, combined with PP-DocLayoutV3 layout detection to identify columns, tables, figures, and formulas. - Structured Output: Produces Markdown with GFM tables and LaTeX-style formulas, plus a JSON file containing bounding boxes for every detected block. - Multi-Format Input: Accepts PNG, JPG, JPEG, WEBP images and multi-page PDFs rendered at configurable DPI. - Use Case: You receive a scanned contract as a PDF. Run the pipeline to get a Markdown transcription with tables preserved and per-block coordinates, ready for archiving or further analysis. ## Quick Start Ask the assistant to OCR your scanned PDF or image file with glm-ocr and save the resulting Markdown and JSON next to the original document.

Frequently Asked Questions about glm-ocr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I OCR a PDF or image locally with GLM-OCR?

Install Ollama, pull the glm-ocr model, and install the glmocr Python package with the layout extra. Then create a GlmOcr client pointing at the skill's config.yaml and call its parse method on your PNG, JPG, WEBP, or PDF file to get Markdown and JSON output.

What output formats does GLM-OCR produce?

The pipeline produces a Markdown file with GFM tables and LaTeX-style formulas, plus a JSON file containing structured results with bounding boxes per block. The Markdown string is also accessible directly in Python via the result object's markdown_result attribute.

Does GLM-OCR require an internet connection or API key?

No API key is needed and inference runs fully locally through Ollama on localhost port 11434. Internet is only needed once to download the glm-ocr model and the PP-DocLayoutV3 layout model, which is cached in the Hugging Face cache afterwards.

Why is the first GLM-OCR run very slow or stuck downloading?

The first run downloads the PP-DocLayoutV3 layout model, roughly 2 GB, from Hugging Face into the local cache. Subsequent runs start immediately. You can pre-download it with the huggingface_hub snapshot_download function to avoid the wait.

Why does GLM-OCR return empty output or timeout errors?

Empty output usually means the task_prompt_mapping is missing from config.yaml, so verify you are passing the skill's config file. Timeouts happen with large images; the default timeout is 300 seconds, and lowering the DPI or processing fewer pages per call helps.