Install
openclaw skills install @zhuo-yoyowz/local-document-ai-openvinoPrivate local document AI for Intel hardware. Parse PDFs, invoices, screenshots, and diagrams with MinerU 2.5 on OpenVINO GenAI, keep the model warm in a local service, and output structured JSON/Markdown with user-defined invoice fields.
openclaw skills install @zhuo-yoyowz/local-document-ai-openvinoTurn local PDFs, invoices, screenshots, and diagrams into one of two useful outcomes:
to-data: classify the document and extract structured fields, tables, and JSON, including user-requested key fields.to-code: turn screenshots, forms, and architecture diagrams into code or Jupyter notebook scaffolds.Everything runs locally and is built for Intel CPU/GPU acceleration with OpenVINO GenAI.
The default device is CPU for workshop stability. Set MINERU_OPENVINO_DEVICE=GPU or AUTO only after validating the target AI PC.
The default user experience is app-like:
--no-serverThe default runtime path in this release is:
pypdfium2Install this when you want one local workflow for:
This skill is especially good for demos because it already includes:
to-data flowsto-data flowsto-code -> jupyter-notebook flowsCheck the environment:
python "{baseDir}/scripts/check_env.py"
Install with the fastest available local installer path:
powershell -ExecutionPolicy Bypass -File "{baseDir}/scripts/install.ps1"
Warm up the local document AI service:
python "{baseDir}/scripts/run_skill.py" --warmup-server
Or run directly from the CLI. Server mode is automatic by default:
python "{baseDir}/scripts/run_skill.py" --mode to-data --file "/absolute/path/to/invoice.pdf" --out "/absolute/path/to/artifacts/invoice_data" --extract "tables,entities,kv_pairs"
For invoice demos with custom key fields:
python "{baseDir}/scripts/run_skill.py" --mode to-data --file "/absolute/path/to/invoice.pdf" --out "/absolute/path/to/artifacts/invoice_data" --extract "tables,entities,kv_pairs" --fields "invoice_number,invoice_date,total_amount,vendor_name"
For repeated workshop demos, prefer the persistent local server mode:
python "{baseDir}/scripts/run_skill.py" --warmup-server
python "{baseDir}/scripts/run_skill.py" --mode to-data --file "/absolute/path/to/invoice.pdf" --out "/absolute/path/to/artifacts/invoice_data" --extract "tables,entities,kv_pairs" --fields "invoice_number,invoice_date,total_amount,vendor_name"
One-command invoice demo:
powershell -ExecutionPolicy Bypass -File "{baseDir}/scripts/demo_invoice.ps1"
Use prompts like these in OpenClaw:
Use $local-document-ai-openvino to parse this local PDF and give me a structured report.
Use $local-document-ai-openvino to extract invoice fields, tables, and key-value pairs from this medical invoice.
Use $local-document-ai-openvino to classify this receipt and return normalized JSON.
Use $local-document-ai-openvino to extract only these invoice fields from this file: invoice_number, invoice_date, total_amount, vendor_name. Return a structured JSON result with just those requested fields.
Use $local-document-ai-openvino to extract these custom fields from this invoice: buyer_tax_id, seller_tax_id, amount_due, check_code. Save the full parse artifacts, but highlight the requested fields in the final structured output.
Use $local-document-ai-openvino to turn this architecture diagram into a Jupyter notebook scaffold.
Use $local-document-ai-openvino to convert this UI screenshot into an HTML scaffold.
Typical outputs include:
parsed.jsonparsed.mdresult_report.htmltask_output/structured_record.jsontask_output/normalized.jsontask_output/requested_fields.jsontask_output/requested_fields_record.jsontask_output/notebook.ipynbcode_preview.htmlIf you are evaluating the skill for the first time, start here:
--warmup-server once to start the persistent local parser and preload the modelto-data on an invoice PDF; local service mode is automaticresult_report.htmlstructured_record.json--fields and inspect requested_fields_record.jsonto-code with a diagram image and target jupyter-notebookUse server mode when the same machine will parse multiple PDFs/images. This is the default path.
Why this helps:
--no-server.Warm up the server before a hands-on session:
python "{baseDir}/scripts/run_skill.py" --warmup-server
Inspect the server:
python "{baseDir}/scripts/run_skill.py" --server-status
Run through the resident server:
python "{baseDir}/scripts/run_skill.py" --mode to-data --file "/absolute/path/to/invoice.pdf" --out "/absolute/path/to/artifacts/invoice_data" --extract "tables,entities,kv_pairs" --fields "invoice_number,invoice_date,total_amount,vendor_name"
Force a specific local service transport if needed:
python "{baseDir}/scripts/run_skill.py" --server-kind http --server-status
python "{baseDir}/scripts/run_skill.py" --server-kind ipc --server-status
Disable service mode for debugging:
python "{baseDir}/scripts/run_skill.py" --no-server --mode parse --file "/absolute/path/to/file.pdf"
Release memory after the workshop:
python "{baseDir}/scripts/run_skill.py" --shutdown-server
Server mode uses these implementation files:
{baseDir}/scripts/parse_client.py{baseDir}/scripts/http_parse_server.py{baseDir}/scripts/persistent_parse_server.pyThe server listens only on 127.0.0.1 loopback by default and does not bind to external network interfaces.
If the default port is occupied, set LOCAL_DOCUMENT_AI_SERVER_PORT before starting the server.
For HTTP service mode, set LOCAL_DOCUMENT_AI_HTTP_PORT if port 47274 is occupied.
After the skill is installed, users can ask for a custom field list at call time. This is the recommended pattern for invoice demos.
Use the fields parameter with to-data:
--fields "invoice_number,invoice_date,total_amount,vendor_name""fields": "invoice_number,invoice_date,total_amount,vendor_name"fields=invoice_number,invoice_date,total_amount,vendor_nameThe skill will:
kv_pairs, entities, tables, and traceability artifactsThe two demo-friendly outputs are:
task_output/requested_fields.json
This includes each requested field, the matched canonical key, whether it was found, the primary match, and all matches.task_output/requested_fields_record.json
This is the compact final record keyed by the user-requested field names.Recommended invoice demo field names:
invoice_numberinvoice_codecheck_codeinvoice_datebuyer_tax_idseller_tax_idvendor_namecustomer_namesubtotaltax_amounttotal_amountamount_dueCommon aliases are also supported when they can be normalized to canonical keys, for example:
sellerbuyerinvoice noinvoice datetotalamount dueUse this skill as a local document-to-action pipeline:
to-data or to-code.Load these references when you need the schema or output contracts:
{baseDir}/references/schema.md{baseDir}/references/mode_guide.md{baseDir}/references/output_contracts.mdUse this published entrypoint:
{baseDir}/scripts/run_skill.py{baseDir}/scripts/run_skill.py --mode to-data --file ...{baseDir}/scripts/demo_invoice.ps1Do not call these implementation scripts directly from the skill:
parse_document.pyparse_client.pypersistent_parse_server.pytransform_doc_to_data.pytransform_doc_to_code.pyCheck the environment before processing real documents:
python "{baseDir}/scripts/check_env.py"
For workshops, the simplest setup is installing into a skill-local .vendor directory.
The installer uses uv pip when uv is available and falls back to pip.
The entry scripts auto-detect the skill-local .vendor, so you do not need to edit PYTHONPATH:
python "{baseDir}/scripts/install_local_runtime.py"
If you prefer, a normal virtual environment also works:
python -m pip install -r "{baseDir}/requirements.txt"
Download the preconverted MinerU OpenVINO model bundle into the skill-local models/ folder, or point the skill at it with an environment variable:
set MINERU_OPENVINO_MODEL_DIR=C:\absolute\path\to\MinerU2.5-Pro-2604-1.2B-int4-ov
For the most stable hands-on setup, keep the default CPU path. To test acceleration on a validated Intel AI PC:
set MINERU_OPENVINO_DEVICE=GPU
Recommended model bundle:
https://www.modelscope.cn/models/snake7gun/MinerU2.5-Pro-2604-1.2B-int4-ovWorkshop-friendly download example:
git clone --depth 1 https://www.modelscope.cn/snake7gun/MinerU2.5-Pro-2604-1.2B-int4-ov.git "{baseDir}/models/MinerU2.5-Pro-2604-1.2B-int4-ov"
Run a quick orchestration smoke test:
python "{baseDir}/scripts/smoke_test.py"
Model assets are discovered from:
MINERU_OPENVINO_MODEL_DIRMINERU_MODEL_DIR{baseDir}/models/MinerU2.5-Pro-2604-1.2B-int4-ov/{baseDir}/models/mineru2.5-int4-ov/Prefer using a predownloaded model bundle for workshops. This skill does not require local export or automatic model download.
parseUse when the user wants the structured parse only.
Outputs:
parsed.jsonparsed.mdresult_report.htmlto-dataUse when the user wants structured extraction, normalization, or document classification.
Typical outputs under task_output/:
entities.jsonkv_pairs.jsontable_index.jsonnormalized.jsonstructured_record.jsonrequested_fields.jsonrequested_fields_record.jsontraceability.jsonto-codeUse when the user wants implementation-oriented output from the parse result.
Supported targets:
reacthtml-cssjson-schemajupyter-notebookTypical outputs under task_output/:
component_map.jsonfield_schema.jsonui_blueprint.jsonnotes.mdtraceability.jsonapp.jsx, index.html, styles.css, schema.json, notebook.ipynb, or notebook_plan.jsonTreat all generated code and notebooks as drafts. Review them before running, publishing, or connecting them to real systems.
The published ClawHub bundle is intentionally CLI-first.
scripts/run_skill.pyscripts/check_env.pyscripts/smoke_test.pyDeveloper-only local UI helpers are kept out of the public release bundle.
Always follow these rules:
parsed.json.parsed.json, not raw OCR text alone.--out directory and remove artifacts after review.Default output folder:
./artifacts/<document_stem>/
Expected top-level outputs:
effective_config.jsonrun_report.jsonparsed.jsonparsed.mdresult_report.htmltask_output/to-code runs may also emit:
code_preview.htmlpython "{baseDir}/scripts/run_skill.py" \
--mode parse \
--file "/absolute/path/to/report.pdf" \
--out "/absolute/path/to/artifacts/report_parse"
python "{baseDir}/scripts/run_skill.py" \
--mode to-data \
--file "/absolute/path/to/invoice.pdf" \
--out "/absolute/path/to/artifacts/invoice_data" \
--extract "tables,entities,kv_pairs"
python "{baseDir}/scripts/run_skill.py" \
--mode to-data \
--file "/absolute/path/to/invoice.pdf" \
--out "/absolute/path/to/artifacts/invoice_data" \
--extract "tables,entities,kv_pairs" \
--fields "invoice_number,invoice_date,total_amount,vendor_name"
python "{baseDir}/scripts/run_skill.py" \
--mode to-code \
--file "/absolute/path/to/ui_mockup.png" \
--out "/absolute/path/to/artifacts/ui_code" \
--target "react" \
--title "Generated App"
python "{baseDir}/scripts/run_skill.py" \
--mode to-code \
--file "/absolute/path/to/architecture_diagram.png" \
--out "/absolute/path/to/artifacts/notebook_code" \
--target "jupyter-notebook" \
--title "OpenVINO Notebook"
/skill local-document-ai-openvino parse file=./docs/report.pdf
/skill local-document-ai-openvino to-data file=./docs/invoice.pdf extract=tables,entities,kv_pairs
/skill local-document-ai-openvino to-data file=./docs/invoice.pdf extract=tables,entities,kv_pairs fields=invoice_number,invoice_date,total_amount,vendor_name
/skill local-document-ai-openvino to-code file=./mockups/architecture.png target=jupyter-notebook
Start the local UI when the user wants an interactive demo page:
python "{baseDir}/scripts/serve_skill_ui.py"
The UI lets the user:
parse, to-data, or to-codeto-code targetThe bundled UI only allows preview/run access for local files under the skill directory and common user content folders such as Downloads, Documents, Desktop, and Pictures.
If a run fails:
error.json with failure detailsparse first when the downstream request is ambiguousPresent this skill as a local document-understanding workflow with downstream actions and customizable field extraction, not as a plain OCR wrapper.