Markitdown
jimmc414/Kosmos
Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing.
Trigger when: (1) User wants to extract text, tables, formulas, or structured data from images/PDFs/scanned documents, (2) User mentions "OCR", "文字识别", "文档解析", (3) User has a document (screenshot…
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install zai-org/GLM-skills glmocr-sdk --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/glmocr-sdk .claude/skills/glmocr-sdk && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .claude/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdkType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install zai-org/GLM-skills glmocr-sdk --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/glmocr-sdk .agents/skills/glmocr-sdk && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .agents/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install zai-org/GLM-skills glmocr-sdk --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/glmocr-sdk .cursor/skills/glmocr-sdk && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .cursor/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/zai-org/GLM-skills.git --path skills/glmocr-sdk--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install zai-org/GLM-skills glmocr-sdk --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/glmocr-sdk .gemini/skills/glmocr-sdk && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .gemini/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install zai-org/GLM-skills glmocr-sdkInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/glmocr-sdk .github/skills/glmocr-sdk && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .github/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zai-org/GLM-skills --skill glmocr-sdk -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install zai-org/GLM-skills glmocr-sdk --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zai-org/GLM-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/glmocr-sdk .opencode/skills/glmocr-sdk && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "glmocr-sdk" agent skill from https://github.com/zai-org/GLM-skills/tree/main/skills/glmocr-sdk into .opencode/skills/glmocr-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "glmocr-sdk", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
glmocr-sdkTrigger when: (1) User wants to extract text, tables, formulas, or structured data from images/PDFs/scanned documents, (2) User mentions "OCR", "文字识别", "文档解析", (3) User has a document (screenshot…
Glmocr SDK is an agent skill from zai-org/GLM-skills. Trigger when: (1) User wants to extract text, tables, formulas, or structured data from images/PDFs/scanned documents, (2) User mentions "OCR", "文字识别", "文档解析", (3) User has a document (screenshot, scanned page, invoice, paper, whiteboard photo) and needs its content in structured form, (4) User asks to parse, digitize, or extract content from a visual document. Invokes the GLM-OCR SDK (pip install glmocr) to parse documents via Zhipu's cloud API. No GPU required. Returns structured JSON (regions with labels +…
Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Documents & Office, covering PDF, Forms and invoices and Schema markup. It works with Zhipu GLM. The repository describes itself as: Official skills for the GLM family of models. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 2ecd31c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipjqFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
ZHIPU_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Glmocr SDK loads about 2.7k tokens when it runs. Until then it costs about 180 tokens; SKILL.md has 405 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
# or add to .env file in working directory:echo "ZHIPU_API_KEY=sk-xxx" >> .env# Or load from a specific .env filemocr parse image.png --env-file /path/to/.env# Or rely on env var / auto-discovered .env (set once, then omit)Constructor kwargs > os.environ > .env file > config.yaml > built-in defaults--env-file` | auto | Path to `.env` file (default: auto-discover from cwd) |`export ZHIPU_API_KEY=sk-xxx`, add to a `.env` file, or pass `--api-key sk-xxx` to the CLI.Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from zai-org/GLM-skills at commit 2ecd31c, republished under its Apache-2.0 licence (© zai-org). 405 words, ~2,683 tokens.
.claude/skills/glmocr-sdk/SKILL.md (or your agent's skills folder).Parses documents (images, PDFs, scans) via the GLM-OCR SDK.
📌 On-demand: This skill requires only
ZHIPU_API_KEYin the environment. No YAML config files or GPU needed.
# Install
pip install glmocr
# Set API key (once)
export ZHIPU_API_KEY=sk-xxx
# or add to .env file in working directory:
echo "ZHIPU_API_KEY=sk-xxx" >> .env# One-liner
import glmocr
result = glmocr.parse("document.pdf")
print(result.markdown_result)
print(result.to_dict())# CLI — pass API key directly (no env setup needed)
glmocr parse image.png --api-key sk-xxx
# Or load from a specific .env file
glmocr parse image.png --env-file /path/to/.env
# Or rely on env var / auto-discovered .env (set once, then omit)
glmocr parse image.png
glmocr parse ./scans/ --output ./output/ --stdoutConstructor kwargs > os.environ > .env file > config.yaml > built-in defaultsAgents override everything via constructor kwargs or env vars — no YAML editing needed.
| Variable | Description | Example |
|---|---|---|
ZHIPU_API_KEY | API key (required for MaaS) | sk-abc123 |
GLMOCR_MODEL | Model name | glm-ocr |
GLMOCR_TIMEOUT | Request timeout (seconds) | 600 |
GLMOCR_ENABLE_LAYOUT | Layout detection on/off | true |
GLMOCR_LOG_LEVEL | DEBUG / INFO / WARNING / ERROR | INFO |
import glmocr
# Single file → PipelineResult
result = glmocr.parse("invoice.png")
# Multiple files → list[PipelineResult]
results = glmocr.parse(["page1.png", "page2.png", "report.pdf"])from glmocr import GlmOcr
parser = GlmOcr(api_key="sk-xxx") # mode auto-set to "maas"
parser = GlmOcr(mode="maas") # reads ZHIPU_API_KEY from env
# Always use as context manager or call .close()
with GlmOcr(api_key="sk-xxx") as parser:
result = parser.parse("document.png")
print(result.markdown_result)
parser.close() # if not using `with`| Parameter | Type | Description |
|---|---|---|
api_key | str | API key. Providing this auto-enables MaaS mode. |
api_url | str | Override MaaS endpoint URL |
model | str | Model name override |
timeout | int | Request timeout in seconds (default: 600) |
enable_layout | bool | Enable layout detection |
log_level | str | Logging level |
PipelineResultresult.markdown_result # str — full document as Markdown
result.json_result # list[list[dict]] — structured regions per page
result.original_images # list[str] — absolute paths of input imagesjson_result structureList of pages → list of regions per page:
[
[
{
"index": 0,
"label": "title",
"content": "Annual Report 2024",
"bbox_2d": [100, 50, 900, 120]
},
{
"index": 1,
"label": "table",
"content": "| Q1 | Q2 |\n|---|---|\n| 120 | 145 |",
"bbox_2d": [100, 140, 900, 400]
}
]
]Bounding boxes (bbox_2d): [x1, y1, x2, y2] normalised to 0–1000 scale.
Region labels: title, text, table, figure, formula, header, footer, page_number, reference, seal
# Dict (JSON-serializable, for passing to other tools)
d = result.to_dict()
# Keys: json_result, markdown_result, original_images, usage (MaaS), data_info (MaaS)
# JSON string
json_str = result.to_json() # pretty-printed, ensure_ascii=False
json_str = result.to_json(indent=None) # compact single line
# Save to disk: writes <stem>/<stem>.json + <stem>/<stem>.md + layout_vis/
result.save(output_dir="./output")
result.save(output_dir="./output", save_layout_visualization=False)The SDK does not raise on MaaS errors — check to_dict() for an "error" key:
result = parser.parse("image.png")
d = result.to_dict()
if "error" in d:
# Handle failure
print("OCR failed:", d["error"])
else:
print(d["markdown_result"])Agent-preferred interface: use the CLI for most operations. Set
ZHIPU_API_KEYin env once, then invoke as needed.
Supported input formats: .jpg, .jpeg, .png, .bmp, .gif, .webp, .pdf
# Parse a single file → saves to ./output/<stem>/
# MaaS mode is the default; ZHIPU_API_KEY must be set (or use --api-key)
glmocr parse image.png
# Pass API key directly without any env setup
glmocr parse image.png --api-key sk-xxx
# Parse a directory → saves each file to ./output/<stem>/
glmocr parse ./scans/
# Use self-hosted vLLM/SGLang instead of cloud
glmocr parse image.png --mode selfhosted
# Specify output directory
glmocr parse image.png --output ./results/# Print Markdown + JSON to stdout (and still save to disk)
glmocr parse image.png --stdout
# Print to stdout ONLY — do not write any files
glmocr parse image.png --stdout --no-save
# JSON only (no Markdown output)
glmocr parse image.png --stdout --json-only
# Pipe JSON into jq for structured extraction
glmocr parse image.png --stdout --json-only --no-save | jq '.[0] | map(select(.label=="table"))'# Skip layout visualization images (faster, smaller output)
glmocr parse image.png --no-layout-vis
# Parse and save only JSON + Markdown, skip layout vis
glmocr parse image.png --no-layout-vis --output ./results/# All images in a folder
glmocr parse ./invoice_scans/ --output ./parsed/ --no-layout-vis
# With progress visible in logs
glmocr parse ./docs/ --output ./parsed/ --log-level INFOglmocr parse image.png --log-level DEBUG| Flag | Default | Description |
|---|---|---|
--api-key / -k | env var | API key for MaaS mode (overrides ZHIPU_API_KEY) |
--mode | maas | maas (cloud, default) or selfhosted (local GPU) |
--env-file | auto | Path to .env file (default: auto-discover from cwd) |
--output / -o | ./output | Output directory |
--stdout | off | Print JSON + Markdown to stdout |
--no-save | off | Skip writing files (use with --stdout) |
--json-only | off | stdout JSON only, no Markdown |
--no-layout-vis | off | Skip layout visualization images |
--config / -c | none | Path to YAML config override |
--log-level | INFO | DEBUG / INFO / WARNING / ERROR |
receive document path / URL
│
▼
glmocr.parse(path) ← single call, handles PDF/image
│
▼
result.to_dict() ← safe to pass as tool output
│
├── markdown_result → hand to LLM for reading / summarization
└── json_result → structured extraction (tables, formulas, regions by label)result = glmocr.parse("report.png")
regions = result.json_result[0] # first page
tables = [r for r in regions if r["label"] == "table"]
formulas = [r for r in regions if r["label"] == "formula"]
body_text = [r for r in regions if r["label"] == "text"]with GlmOcr(api_key="sk-xxx") as parser:
result = parser.parse("document.pdf") # all pages in one PipelineResult
for page_idx, page_regions in enumerate(result.json_result):
print(f"Page {page_idx + 1}: {len(page_regions)} regions")
for region in page_regions:
print(f" [{region['label']}] {region['content'][:60]}")from glmocr.config import GlmOcrConfig
cfg = GlmOcrConfig.from_env(
api_key="sk-xxx",
mode="maas",
timeout=600,
log_level="DEBUG",
)After result.save(output_dir):
output_dir/
<image_stem>/
<image_stem>.json ← structured regions
<image_stem>.md ← full Markdown (with cropped figure images)
imgs/ ← cropped figures referenced in Markdown
layout_vis/ ← layout detection overlay images (if enabled)
<image_stem>.jpgZHIPU_API_KEY not set: SDK defaults to MaaS mode. Without a key, parse() will fail with a clear error message and quick-fix instructions. Set via export ZHIPU_API_KEY=sk-xxx, add to a .env file, or pass --api-key sk-xxx to the CLI.timeout=1200.result.json_result is a string: Happens when the model returns malformed JSON. The SDK preserves the raw string — parse or log it manually.© zai-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/glmocr-sdk of zai-org/GLM-skills.
Open the folder on GitHubat commit 2ecd31c
Glmocr SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Glmocr SDK this skillzai-org/GLM-skills | 475 | — | ~2.7k | Automated safety check: Notes | Apache-2.0 | |
| Markitdownjimmc414/Kosmos | 594 | 2 repos | ~1.7k | Automated safety check: Pass | None | |
| Extracting Structured DataGAIK-project/gaik-toolkit | 100 | — | ~3.2k | Automated safety check: Pass | MIT | |
| MarkitdownImCa0/just-laws | 781 | 14 repos | ~3.2k | Automated safety check: Notes | MIT | |
| Form Fillingplatonai/Browser4 | 1.2k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Code2mediatsingliuwin/autoclaw | 280 | — | ~956 | Automated safety check: Pass | MIT |
jimmc414/Kosmos
Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing.
GAIK-project/gaik-toolkit
Extracts structured data — fields, tables, line items — out of documents into a validated schema using the gaik toolkit, and designs schemas that stay inside provider limits and produce checkable…
ImCa0/just-laws
Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.
platonai/Browser4
Automatically fills web forms using provided field data and can optionally submit the form.
tsingliuwin/autoclaw
Universal media renderer with no fixed template — any custom layout, size or style becomes pixel-perfect images (PNG/JPEG/WebP), vector SVG, paged PDFs or animations (WebP/GIF).
jimmc414/Kosmos
PDF generation toolkit. An agent skill from jimmc414/Kosmos.
zai-org/GLM-skills
Extract text from images using GLM-OCR API. An agent skill from zai-org/GLM-skills.
zai-org/GLM-skills
Official skill for generating high-quality images from text prompts using ZhiPu GLM-Image API.
zai-org/GLM-skills
Official skill for recognizing and extracting mathematical formulas from images and PDFs into LaTeX format using ZhiPu GLM-OCR API.
zai-org/GLM-skills
Official skill for recognizing handwritten text from images using ZhiPu GLM-OCR API.
zai-org/GLM-skills
Official skill for recognizing and extracting tables from images and PDFs into Markdown format using ZhiPu GLM-OCR API.
zai-org/GLM-skills
Generate captions (descriptions) for images, videos, and documents using ZhiPu GLM-V multimodal model series.
Works with
Categories
Trigger when: (1) User wants to extract text, tables, formulas, or structured data from images/PDFs/scanned documents, (2) User mentions "OCR", "文字识别", "文档解析", (3) User has a document (screenshot…. Glmocr SDK is an agent skill from zai-org/GLM-skills. Trigger when: (1) User wants to extract text, tables, formulas, or structured data from images/PDFs/scanned documents, (2) User mentions "OCR", "文字识别", "文档解析", (3) User has a document (screenshot, scanned page, invoice, paper, whiteboard photo) and needs its content in structured form, (4) User asks to parse, digitize, or extract content from a visual document.
Glmocr SDK fits situations like: user wants to extract text; structured data from images/PDFs/scanned documents; user mentions OCR; user has a document (screenshot.
Run `npx skills add zai-org/GLM-skills --skill glmocr-sdk -a claude-code`. Or copy the skill folder (skills/glmocr-sdk in zai-org/GLM-skills) into .claude/skills/glmocr-sdk in your project. Claude Code loads it when a task matches its description.
Run `npx skills add zai-org/GLM-skills --skill glmocr-sdk -a codex`. Or copy the skill folder (skills/glmocr-sdk in zai-org/GLM-skills) into .agents/skills/glmocr-sdk in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zai-org/GLM-skills --skill glmocr-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/glmocr-sdk, .gemini/skills/glmocr-sdk, .github/skills/glmocr-sdk and .opencode/skills/glmocr-sdk in your project.
Going by SKILL.md and its folder, Glmocr SDK needs the command-line tools its instructions call (pip and jq) and credentials named ZHIPU_API_KEY. Our summary lists: Python 3; A credential in ZHIPU_API_KEY.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Glmocr SDK is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Glmocr SDK: Markitdown (jimmc414/Kosmos, 594 stars), Extracting Structured Data (GAIK-project/gaik-toolkit, 100 stars), Markitdown (ImCa0/just-laws, 781 stars) and Form Filling (platonai/Browser4, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
zai-org (a GitHub organization) maintains it in zai-org/GLM-skills, which has 475 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on April 15, 2026.
Source: zai-org/GLM-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.