Skip to content
Back to skills

Donut

ASecurity

"Use Donut for OCR-free document understanding, checkpoint

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
toolspythonbashapi

Works with

  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill donut --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Donut?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Donut
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-donut/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-donut)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: donut
description: "Use Donut for OCR-free document understanding, checkpoint
  inference, fine-tuning, evaluation, and SynthDoG synthetic document
  generation."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Donut

Use this repo skill when the task involves NAVER/ClovaAI Donut: OCR-free document understanding with a Swin encoder and BART-like decoder, plus SynthDoG synthetic document generation. This skill is self-contained; do not reopen the original checkout for routine Donut usage.

## Route by task

| User intent | Read or run |
| --- | --- |
| Load a Donut checkpoint, run one-image prediction, compare prompts, or start the Gradio demo | [`sub-skills/inference/SKILL.md`](sub-skills/inference/SKILL.md) |
| Fine-tune, validate dataset JSONL, evaluate a checkpoint, read metrics, or debug configs/checkpoints | [`sub-skills/training/SKILL.md`](sub-skills/training/SKILL.md) |
| Generate synthetic document images, render SynthDoG configs, or adapt resources/fonts/corpora | [`sub-skills/synthdog/SKILL.md`](sub-skills/synthdog/SKILL.md) |
| Inspect public package APIs, signatures, token helpers, and object relationships | [`references/api-reference.md`](references/api-reference.md) |
| Decide which bundled workflow helper or sub-skill owns a request | [`references/workflow-map.md`](references/workflow-map.md) |
| Diagnose install/import, Hugging Face, CUDA, Gradio, dataset, or SynthDoG dependency failures | [`references/troubleshooting.md`](references/troubleshooting.md) |
| Check source baseline, commit, version, and refresh triggers | [`references/repo-provenance.md`](references/repo-provenance.md) |

## Fast start

1. Install a Donut-capable Python environment. For inference only, `pip install donut-python` plus a compatible PyTorch build is the starting point. Training needs CUDA-capable PyTorch. SynthDoG generation also needs `synthtiger` and its image/text dependencies.
2. Smoke-check the environment without the source repo:
   ```bash
   python scripts/runtime_smoke.py
   python scripts/runtime_smoke.py --check all --require-cuda  # when training and SynthDoG are in scope
   ```
3. Route to a sub-skill before giving detailed commands. Each sub-skill owns its own scripts and troubleshooting notes.

## Core facts to preserve

- Package distribution: `donut-python`; import module: `donut`.
- Public exports include `DonutConfig`, `DonutModel`, `DonutDataset`, `JSONParseEvaluator`, `load_json`, and `save_json`.
- `DonutModel.from_pretrained(...)` loads local or Hugging Face checkpoints and requests the Donut repositories' `official` revision.
- `DonutModel.inference(...)` returns a dictionary with a `predictions` list; parsed JSON is the default output.
- Dataset rows use `file_name` plus a JSON-encoded `ground_truth` string containing either `gt_parse` or `gt_parses`.
- Training is GPU-oriented in the original scripts; do not promise CPU training equivalence.
- No model weights, datasets, or large SynthDoG assets are bundled in this skill. Users must provide checkpoints, images, datasets, and SynthDoG resources.

## Bundled helpers

- [`scripts/runtime_smoke.py`](scripts/runtime_smoke.py): cross-workflow environment/API smoke check.
- [`sub-skills/inference/scripts/run_inference.py`](sub-skills/inference/scripts/run_inference.py): single-image inference and prompt comparison.
- [`sub-skills/inference/scripts/launch_demo.py`](sub-skills/inference/scripts/launch_demo.py): Gradio demo launcher.
- [`sub-skills/training/scripts/train_donut.py`](sub-skills/training/scripts/train_donut.py): bundled CUDA-oriented trainer entry point.
- [`sub-skills/training/scripts/check_training_config.py`](sub-skills/training/scripts/check_training_config.py): config and metadata validator.
- [`sub-skills/training/scripts/evaluate_dataset.py`](sub-skills/training/scripts/evaluate_dataset.py): local/HF dataset evaluation helper and validation-only mode.
- [`sub-skills/training/references/configs/`](sub-skills/training/references/configs/): bundled CORD, DocVQA, RVL-CDIP, and TrainTicket config examples.
- [`sub-skills/synthdog/scripts/render_config.py`](sub-skills/synthdog/scripts/render_config.py): render bundled SynthDoG placeholder configs for external resources.
- [`sub-skills/synthdog/scripts/template.py`](sub-skills/synthdog/scripts/template.py): bundled SynthDoG template used by `synthtiger`.

## Boundaries

Use Donut for OCR-free document-image understanding, classification, extraction, visual QA, and synthetic-document pretraining data generation. Do not use this skill for generic PDF parsing, OCR engines, RAG chunking, non-document computer vision models, or unrelated Transformers training unless Donut APIs, checkpoints, config files, errors, or data formats are central to the request.

Files in this skill

  • SKILL.md4.7 KB
  • references/api-reference.md6.5 KB
  • references/repo-provenance.md3.6 KB
  • references/repo-routing-metadata.json489 B
  • references/troubleshooting.md5.2 KB
  • references/workflow-map.md5.2 KB
  • scripts/runtime_smoke.py6.5 KB
  • sub-skills/inference/SKILL.md2.2 KB
  • sub-skills/inference/references/demo-and-prediction.md6.3 KB
  • sub-skills/inference/references/troubleshooting.md4.5 KB
  • sub-skills/inference/scripts/launch_demo.py3.8 KB
  • sub-skills/inference/scripts/run_inference.py5.5 KB
  • sub-skills/synthdog/SKILL.md2.5 KB
  • sub-skills/synthdog/references/configs/config_en.yaml2.6 KB
  • sub-skills/synthdog/references/configs/config_ja.yaml2.6 KB
  • sub-skills/synthdog/references/configs/config_ko.yaml2.6 KB
  • sub-skills/synthdog/references/configs/config_zh.yaml2.6 KB
  • sub-skills/synthdog/references/configuration.md3.9 KB
  • sub-skills/synthdog/references/resource-layout.md2 KB
  • sub-skills/synthdog/references/troubleshooting.md3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.