Read-only mirror of https://github.com/DCC-BS/dcc-docling-serve — Basel-Stadt. Issues & pull requests at the source.
  • Python 66.3%
  • HTML 23.7%
  • Shell 9.4%
  • Makefile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yanick Schraner 411994822d
fix(compose): cap GLM-OCR vLLM at --max-model-len 24576 (#119)
GLM-OCR's default context (131072) needs 8.0 GiB of KV cache at startup.
With other work on the GPU, vllm/vllm-openai:v0.34.0 failed engine init
with 1.9 GiB left (32768: 2.0 GiB needed, 1.84 GiB left). 24576 covers the
largest crop docling-glm-ocr 0.7.0 sends (5814 prompt + 11250 output
tokens); 16384 cuts that crop's output at 10570 tokens.
2026-12-03 12:02:45 +01:00
.cursor/rules Best practices (#6) 2026-02-18 16:57:38 +01:00
.github/workflows chore: build on docling-serve v1.41.0 (#118) 2026-12-03 11:10:56 +01:00
.vscode Refactor test imports and update VSCode settings 2026-02-18 12:02:40 +01:00
benchmarks benchmarks: Granite Docling v2 2B with vLLM and MTP (not adopted) (#116) 2026-12-03 10:27:03 +01:00
data feat: legacy Office files (.doc, .rtf, .xls, .ppt) via LibreOffice (#105) 2026-11-20 09:53:58 +01:00
examples Fix/bentoml docker config (#8) 2026-02-24 16:46:12 +01:00
plugins chore: build on docling-serve v1.41.0 (#118) 2026-12-03 11:10:56 +01:00
tests feat: image SBOM that lists the baked-in models with their commits (#107) 2026-11-24 10:26:15 +01:00
.env.example Fix incompatability issues 2026-08-12 08:12:41 +02:00
.gitignore feat(benchmarks): test new OCR, layout and VLM candidates (#78) 2026-10-28 19:26:27 +01:00
.pre-commit-config.yaml feat(benchmarks): test new OCR, layout and VLM candidates (#78) 2026-10-28 19:26:27 +01:00
.python-version Fix incompatability issues 2026-08-12 08:12:41 +02:00
compose.debug.yaml chore: build on docling-serve v1.41.0 (#118) 2026-12-03 11:10:56 +01:00
compose.yaml fix(compose): cap GLM-OCR vLLM at --max-model-len 24576 (#119) 2026-12-03 12:02:45 +01:00
LICENSE initial commit 2026-02-18 11:30:12 +01:00
Makefile Fix incompatability issues 2026-08-12 11:08:15 +02:00
pyproject.toml chore: docling-pp-ocrv6 0.2.1 in the image (#93) 2026-11-09 09:37:15 +01:00
README.md fix(compose): cap GLM-OCR vLLM at --max-model-len 24576 (#119) 2026-12-03 12:02:45 +01:00
renovate.json chore(renovate): 7-day minimumReleaseAge (#113) 2026-12-01 07:58:03 +01:00
smoke_test.sh Fix incompatability issues 2026-08-12 08:12:41 +02:00
uv.lock chore(deps): docling-pp-ocrv6 0.3.1; align uv.lock with the image's plugin pins (#103) 2026-11-16 22:29:02 +01:00

Docling-Serve Plugins: PP-DocLayout-V3 + GLM-OCR

CI

A patched docling-serve Docker image that bundles two community plugins:

Available images

Image Based on Architectures Notes
ghcr.io/dcc-bs/dcc-docling-serve docling-serve linux/amd64 Base image, packages from PyPI (torch with CUDA 13)
ghcr.io/dcc-bs/dcc-docling-serve-cpu docling-serve-cpu linux/amd64, linux/arm64 CPU-only, torch from PyTorch CPU index
ghcr.io/dcc-bs/dcc-docling-serve-cu128 docling-serve-cu128 linux/amd64 CUDA 12.8, torch from cu128 index
ghcr.io/dcc-bs/dcc-docling-serve-cu130 docling-serve-cu130 linux/amd64 CUDA 13.0, torch from cu130 index

Each image is tagged with the docling-serve version it is built on (e.g. v1.41.0) and :latest: dcc-docling-serve:v1.41.0 is docling-serve v1.41.0 with our plugins and patches.

Plugins

Plugin PyPI Purpose
docling-glm-ocr pip install docling-glm-ocr Remote OCR via a vLLM-hosted GLM-OCR model
docling-pp-doc-layout pip install docling-pp-doc-layout Local layout detection via PP-DocLayout-V3
docling-pp-ocrv6 pip install docling-pp-ocrv6 Local OCR via PP-OCRv6 (medium), with a box per word

The plugins are selectable per-request through the standard docling-serve API:

  • Layout -- layout_preset: "ppdoclayout-v3" (preset defined in compose.yaml) or layout_custom_config: { "kind": "ppdoclayout-v3" }
  • OCR -- ocr_preset: "glm-ocr-remote" or ocr_preset: "pp-ocrv6"

The image pins the plugin versions (DOCLING_GLM_OCR_VERSION, DOCLING_PP_DOC_LAYOUT_VERSION and DOCLING_PP_OCRV6_VERSION in plugins/Dockerfile.docling-serve) and bakes the PP-DocLayout-V3 and PP-OCRv6 models into it at pinned Hugging Face revisions (PP_DOC_LAYOUT_MODEL_REVISION, PP_OCRV6_DET_REVISION, PP_OCRV6_REC_REVISION), so no pod downloads them and a new upload to a model repo changes nothing until the revision here is moved. Renovate opens a PR when a new plugin version is released; merge it, then run the image build again for the current version. Unpinned, the build's layer cache would keep shipping the old plugins.

The docling-serve web UI at /ui is upstream's, unchanged. It lists both plugins among its OCR and layout choices.

Architecture

flowchart TD
    subgraph doclingServe ["dcc-docling-serve"]
        LP["PP-DocLayout-V3 plugin"]
        OP["GLM-OCR plugin"]
    end

    subgraph vllmServer [vLLM Server]
        GLMOCR["zai-org/GLM-OCR"]
    end

    OP -- "remote OCR" --> GLMOCR

Quickstart

1) Prerequisites

  • Docker with GPU support (NVIDIA)
  • A HuggingFace token with access to the GLM-OCR model

2) Configure

Copy .env.example to .env and set the required variables:

cp .env.example .env
# edit .env — at minimum set HF_TOKEN
Variable Description Default
HF_TOKEN HuggingFace token for downloading GLM-OCR (required) —
HF_CACHE_DIR Host directory for the HF model cache .hf-cache
VLLM_HOST_PORT Host port for the vLLM server 8001
DOCLING_HOST_PORT Host port for docling-serve 5001
DOCLING_SERVE_TAG Upstream docling-serve image tag latest
DOCLING_SERVE_LOG_LEVEL Log level for docling-serve INFO

3) Start the stack

make docker-up

This starts two services:

Service Purpose
vllm-glm-ocr vLLM server hosting zai-org/GLM-OCR (GPU 1)
docling-serve Docling API + web UI with both plugins (GPU 0)

The web UI is available at http://localhost:5001/ui.

4) Convert a document

Remote GLM-OCR OCR with PP-DocLayout-V3 layout:

curl -X POST http://localhost:5001/v1/convert/source \
  -H 'Content-Type: application/json' \
  -d '{
    "options": {
      "ocr_engine": "glm-ocr-remote",
      "layout_custom_config": { "kind": "ppdoclayout-v3" }
    },
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2501.17887"}]
  }'

Docker Compose

The compose.yaml references the pre-built image from GHCR:

ghcr.io/dcc-bs/dcc-docling-serve:latest
Service Image
vllm-glm-ocr vllm/vllm-openai:v0.34.0
docling-serve ghcr.io/dcc-bs/dcc-docling-serve:latest

Environment variables are documented in .env.example.

make docker-up    # start all services
make docker-down  # stop all services

Building the image locally

To build the patched docling-serve image from source:

make docker-build

This runs docker build against plugins/Dockerfile.docling-serve (default upstream image, latest tag) and tags the result as $DOCLING_IMAGE (default ghcr.io/dcc-bs/dcc-docling-serve:latest).

Running the locally built image

To test the local image without pushing it to GHCR, run docling-serve directly with docker run:

docker run --add-host=host.docker.internal:host-gateway --rm \
  --gpus device=0 \
  -p 5001:5001 \
  -e DOCLING_SERVE_ENABLE_UI=true \
  -e DOCLING_SERVE_ENABLE_REMOTE_SERVICES=true \
  -e DOCLING_SERVE_ALLOW_EXTERNAL_PLUGINS=true \
  -e GLMOCR_REMOTE_OCR_API_URL=http://host.docker.internal:8001/v1/chat/completions \
  ghcr.io/dcc-bs/dcc-docling-serve:latest

The web UI is then available at http://localhost:5001/ui.

Because make docker-build tags the image with the name compose.yaml uses, the normal compose flow picks up the local build:

make docker-build
make docker-up

Plugin configuration

All plugins are fully configurable via environment variables, making them suitable for zero-code deployment in Docker / Compose environments. Explicit GlmOcrRemoteOptions and PPDocLayoutV3Options constructor arguments always take precedence when using the Python SDK directly.

GLM-OCR remote OCR — environment variables

Variable Description Default
GLMOCR_REMOTE_OCR_API_URL vLLM chat completion URL http://localhost:8001/v1/chat/completions
GLMOCR_REMOTE_OCR_MODEL_NAME Model name sent to vLLM zai-org/GLM-OCR
GLMOCR_REMOTE_OCR_PROMPT Text prompt sent with each image crop built-in default
GLMOCR_REMOTE_OCR_TIMEOUT HTTP timeout per crop (seconds) 120
GLMOCR_REMOTE_OCR_MAX_TOKENS Max tokens per completion 16384
GLMOCR_REMOTE_OCR_SCALE Image crop rendering scale 3.0
GLMOCR_REMOTE_OCR_MAX_IMAGE_PIXELS Pixel budget per crop 4500000
GLMOCR_REMOTE_OCR_MAX_CONCURRENT_REQUESTS Max concurrent API requests 10
GLMOCR_REMOTE_OCR_MAX_RETRIES Max retry attempts for HTTP errors 3
GLMOCR_REMOTE_OCR_RETRY_BACKOFF_FACTOR Exponential backoff factor for retries 2.0
GLMOCR_REMOTE_OCR_LANG Comma-separated language hint(s) en
GLMOCR_REMOTE_OCR_API_KEY Bearer token for Authorization header unset (no header sent)

PP-DocLayout-V3 layout — environment variables

Variable Description Default
PP_DOC_LAYOUT_MODEL_NAME HuggingFace model repo ID or local folder our image: the baked-in copy (see below); plugin: PaddlePaddle/PP-DocLayoutV3_safetensors
PP_DOC_LAYOUT_CONFIDENCE_THRESHOLD Minimum detection confidence (0.0–1.0) 0.3
PP_DOC_LAYOUT_BATCH_SIZE Batch size for layout inference 8
PP_DOC_LAYOUT_CREATE_ORPHAN_CLUSTERS Create clusters for orphaned elements (true/false) true
PP_DOC_LAYOUT_KEEP_EMPTY_CLUSTERS Retain empty clusters in results (true/false) false
PP_DOC_LAYOUT_SKIP_CELL_ASSIGNMENT Skip table-cell assignment (true/false) false
PP_DOC_LAYOUT_LIST_DETECTION List-item detection: rules, heron or off (see Lists with PP-DocLayout-V3) rules

Boolean variables accept true, 1, yes (case-insensitive) as truthy; anything else is false.

Our image contains the PP-DocLayout-V3 weights (128 MB, pinned by PP_DOC_LAYOUT_MODEL_REVISION in plugins/Dockerfile.docling-serve) and points PP_DOC_LAYOUT_MODEL_NAME at them. Without them the plugin fetched the model from huggingface.co every time a pipeline was built, and downloaded it on every container start; now the worker runs without internet access. To update the weights, set the new commit of PaddlePaddle/PP-DocLayoutV3_safetensors as PP_DOC_LAYOUT_MODEL_REVISION.

The threshold defaults to 0.3 since plugin 0.2.5 (it was 0.5). docling only OCRs inside layout regions, and PP-DocLayout-V3 (trained on document pages) detects handwriting on phone photos with only 0.3–0.4 confidence. At 0.5 most of the handwritten list on the test photo got no region and was never read. At 0.3 over all 28 test documents: photo handwriting 11 % → 44 % with RapidOCR and 22 % → 89 % with GLM-OCR, headings on the synthetic documents 0.85 → 0.96, born-digital text unchanged. The catch: GLM-OCR also gets low-confidence regions on text-free photos and can invent text there (on one photo page it repeated "Wiesbaden" 483 times); RapidOCR does not. GLM-OCR 0.5.2 discards such repetition loops, but a short invented line can still get through. See the engine dashboard for the full comparison.

SDK option reference

All environment variables above correspond to fields on GlmOcrRemoteOptions and PPDocLayoutV3Options. See the individual plugin READMEs for the full option reference:

RapidOCR on the GPU

The upstream CUDA images ship the CPU-only onnxruntime, so RapidOCR (the default OCR engine, onnxruntime backend) runs on the CPU even on a GPU and dominates the processing time. plugins/install_onnxruntime_gpu.sh fixes this at build time for every image whose torch has CUDA support. CPU images are left unchanged.

  • It replaces onnxruntime with the matching onnxruntime-gpu: PyPI for CUDA 13 (same version as upstream), the onnxruntime CUDA 12 feed for CUDA 12.
  • It registers the CUDA/cuDNN libraries of the nvidia-* wheels with ldconfig, so the CUDA provider loads regardless of whether torch was imported first.
  • The build fails if CUDAExecutionProvider is missing or its libraries do not resolve.

No request option is needed. docling already enables CUDA for RapidOCR when the accelerator device is CUDA, which it is by default when a GPU is visible.

Legacy Office files (.doc, .rtf, .xls, .ppt)

docling converts Word 97–2003 (.doc, .dot), RTF, .xls and .ppt files to their modern counterparts with LibreOffice before parsing them (convert_to_modern_format in docling/backend/docx/drawingml/utils.py). The upstream image has no LibreOffice, so these files fail with "An unexpected error occurred while opening the document …". The image installs LibreOffice Writer, Calc and Impress from the base image's AppStream repo (no weak deps, about +650 MB). docling runs each conversion as a throwaway soffice process with its own profile in a temporary directory and a 120 s timeout (convert_to_modern_format), so the container needs a writable /tmp.

Health-probe log muting

Kubernetes/Compose liveness probes hitting GET /health produce two INFO records per probe (docling_serve.app "Health check requested" and the matching uvicorn.access line). The image ships plugins/mute_health_logs.py, installed into site-packages as dcc_mute_health_logs.py plus a .pth file that imports it at interpreter startup. It attaches logging.Filters to those two loggers — no upstream docling-serve file is modified, so it survives upstream updates. The filters sit on the Logger objects, not on handlers, so docling-serve's own setup_logging() (which only swaps handlers/levels) does not undo them.

Variable Description Default
DCC_MUTE_HEALTH_LOGS Set to 0/false/no to disable muting 1
DCC_MUTE_HEALTH_PATHS Comma-separated request paths to mute in the access log /health

Convert API: the words of each page

DoclingDocument carries regions and their text, not words. Whoever needs to know where a word stands — to highlight a hit, to anchor a citation, to mark a name for redaction — has to parse the file a second time on their own side, and run their own OCR for the pages that have no text layer. docling has measured all of it already and throws it away after assembly.

The image ships plugins/word_boxes.py, installed into site-packages as dcc_word_boxes.py plus a .pth file, like the health-log muting. It adds one request option and one field to the answer:

include_word_boxes request option, boolean, defaults to false
word_boxes answer field, beside md_content and the other contents

word_boxes holds, per page number, docling's own SegmentedPdfPage: word_cells and textline_cells, each cell with its text, the rectangle it was read in (four corners, so text at an angle keeps its angle) and from_ocr. char_cells and the page picture are dropped — they are large, and a word's text and box is what was asked for.

curl -s -X POST localhost:5001/v1/convert/file \
  -F files=@document.pdf -F to_formats=json -F pdf_backend=dlparse_v4 \
  -F include_word_boxes=true |
  python3 -c "import sys, json; pages = json.load(sys.stdin)['document']['word_boxes']; \
    print({n: len(p['word_cells']) for n, p in pages.items()})"

Only a docling-parse backend measures a box per word: with pdf_backend=pypdfium2 the answer carries the words OCR read and none of the ones the text layer draws.

What it changes. The option sets generate_parsed_pages on the pipeline, so the cells survive assembly; ExportableDocument carries them off the conversion result and the export writes them into the answer. Nothing else moves: the option defaults to false, no existing field changes, and a request that does not ask for it is answered exactly as before — the field is then null, like the other contents that were not requested.

With PP-OCRv6 (ocr_preset=pp-ocrv6) the option also turns on the engine's whole_page and return_word_box: every page is read whole, so a line is not cut at a layout box, and each word OCR reads gets a box of its own. A word the text layer draws is not doubled; over invisible text (a scanner's layer) the read words stay. Both options cost time and stay off for requests that do not ask for word boxes. docling-serve keeps one converter per set of options, so the two kinds of request do not share one; with more than two kinds in use, raise DOCLING_SERVE_OPTIONS_CACHE_SIZE (default 2) to avoid reloading models.

Adding a field to a pydantic model is not enough on its own: a model that holds another one keeps a copy of its schema from when it was first built, so the models of those two modules are rebuilt as well. Without that the field validates but is dropped again on the way out.

Variable Description Default
DCC_WORD_BOXES Set to 0/false/no to leave the API as upstream has it 1

If a wrapped docling function is missing (renamed upstream), the patch logs a warning and does nothing; conversions keep working, without the field.

List markers: Word's Symbol and Wingdings bullets

Word draws list bullets in the Symbol or Wingdings font. A PDF exported from Word often has no Unicode mapping for them, so its text layer holds the font's private-use code point instead of a bullet (U+F0B7 for Symbol's "•", U+F0A7 for Wingdings' "▪", …). docling does not know these as bullets: the list item keeps the character in its text and the markdown reads - Text with an invisible character after the dash.

The image ships plugins/list_bullets.py, installed into site-packages as dcc_list_bullets.py plus a .pth file, like the health-log muting. It adds the private-use bullets of Symbol and Wingdings to docling's list-marker patterns, so the marker is split off like any other bullet and recorded in ListItem.marker as the bullet it stands for (U+F0B7 → "•").

Variable Description Default
DCC_LIST_BULLETS Set to 0/false/no to leave docling's list markers as upstream has them 1

Python SDK usage

The plugins can also be used directly with the docling Python SDK (without docling-serve). See examples/convert_with_plugins.py:

from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption

from docling_glm_ocr import GlmOcrRemoteOptions
from docling_pp_doc_layout.options import PPDocLayoutV3Options

pipeline_options = PdfPipelineOptions(
    allow_external_plugins=True,
    ocr_options=GlmOcrRemoteOptions(api_url="..."),
    layout_options=PPDocLayoutV3Options(),
)

converter = DocumentConverter(format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)})
result = converter.convert("https://arxiv.org/pdf/2501.17887")
print(result.document.export_to_markdown())

vLLM GLM-OCR container

Standalone command to run the GLM-OCR vLLM server:

docker run -d \
  --rm --name ocr-glm \
  --gpus device=1 \
  --ipc=host \
  -p 8001:8000 \
  -v "${HOME}/.cache/huggingface:/root/.cache/huggingface" \
  -e "HF_TOKEN=${HF_TOKEN:-}" \
  -e "LD_LIBRARY_PATH=/lib/x86_64-linux-gnu" \
  ghcr.io/dcc-bs/vllm:v0.16.0-cu130 \
  zai-org/GLM-OCR \
  --served-model-name zai-org/GLM-OCR \
  --port 8000 \
  --trust-remote-code \
  --max-num-batched-tokens 8192 \
  --max-model-len 24576

Required: --max-num-batched-tokens 8192

Without this flag, vLLM will reject any high-resolution image with HTTP 400.

In vLLM 0.16.0+ (v1 engine), the encoder cache size is derived from max_num_batched_tokens (default 2048 when chunked prefill is enabled):

encoder_cache_size = max(max_num_batched_tokens, model_max_tokens_per_image)
                   = max(2048, 4800)  ←  4800 is GLM-OCR's model floor
                   = 4800 tokens      ←  too small for real documents

The Glm46VImageProcessor encodes images at approximately 784 pixels per token (patch_size=14 × merge_size=2, squared). A typical A4 page rendered at scale 3× (1785 × 2526 px) produces 5760 tokens; a phone-photo crop at scale 3× can reach 6120 tokens — both exceed the default 4800-token cache and are rejected.

Setting --max-num-batched-tokens 8192 raises the encoder cache to max(8192, 4800) = 8192 tokens, which covers all real-world inputs with comfortable headroom.

Note: --limit-mm-per-prompt does not control the encoder cache size in vLLM 0.16.0. That flag only limits the count of images per request.

--max-model-len 24576

GLM-OCR's default context length is 131072 tokens. vLLM only starts if one request of that length fits in the KV cache, which needs 8.0 GiB. An empty RTX 4090 has 19.9 GiB for it, but when another process holds most of the GPU, startup fails: in one such case 1.9 GiB were left, and 32768 (2.0 GiB needed, 1.84 GiB left) failed as well.

24576 covers the largest request docling-glm-ocr sends with its defaults: a crop at max_image_pixels (4.5 MP) is 5814 prompt tokens, and its output budget is min(max_tokens, 4.5 × max_tokens_per_megapixel) = 11250 tokens, 17064 in all. With 16384, vLLM cuts that crop's output at 10570 tokens. 24576 also leaves room for the full max_tokens of 16384 on such a crop (22198 tokens). The KIS cluster runs GLM-OCR with --max-model-len 32000 (kdkp-kis-k8s-config, apps/vllm-glm-ocr/values.yaml).

Testing

Setup (dev)

make install

Format and lint

make check

Runs ruff format (auto-format) and ruff check --fix (auto-fix lint errors) locally. The CI workflow runs these as read-only checks.

Unit tests

make test

tests/unit covers the patches in plugins/ against the docling installed in the dev environment; tests/e2e needs a running stack and is skipped without one.

Smoke test (local SDK)

Tests the plugins directly via the Python SDK, without a running docling-serve instance. Requires the plugin repos checked out as siblings of this repo:

./smoke_test.sh
# or with a custom vLLM URL:
GLMOCR_REMOTE_OCR_API_URL=http://host:8001/v1/chat/completions ./smoke_test.sh

End-to-end tests

The e2e tests require a running stack (docling-serve + vLLM). They use the images in data/ to validate conversion through both plugins.

export DOCLING_SERVE_URL=http://localhost:5001
make test

Tests are skipped automatically when DOCLING_SERVE_URL is not set.

Processing-time benchmark

benchmarks/e2e_timing.py compares end-to-end conversion time of the official and our docling-serve images (CU130 and CPU) and plain docling installed from PyPI. The variants run one after another. Each one gets a cold conversion to load its models, then converts every document --repeats times with the options in OPTIONS. Results (raw JSONL plus summary.md with per-stage timings) go to benchmarks/results/.

The examples time the private documents in benchmarks/internal/docs (see below). Without them, point --docs at benchmarks/tool_comparison/synthetic.

uv run --script benchmarks/e2e_timing.py --docs benchmarks/internal/docs
uv run --script benchmarks/e2e_timing.py --docs benchmarks/internal/docs --variants official-cu130 custom-cu130 --repeats 1

Converter comparison

benchmarks/tool_comparison/ compares docling (upstream, with GPU OCR, and with GPU OCR plus the former shape patch, which docling 2.136 made obsolete) with marker, docTR, markitdown and Jina Reader on the test documents plus four synthetic PDFs with exact ground truth (charts, tables and forms, a scanned page, a designed page). It measures conversion time per document and page, scores the markdown against the ground truth and the PDF text layer, and builds an HTML dashboard with side-by-side diffs next to the original page.

benchmarks/tool_comparison/run_all.sh          # needs Docker, a GPU and jina_key in ../.env
python3 -m http.server -d benchmarks/tool_comparison/results/dashboard 8765

Note that the Jina runner uploads every document to r.jina.ai.

build_dashboard.py reads what to compare from a JSON config: tools and labels, results folder, documents, assessment file and page texts. With no --config it uses converters.config.json, which builds the dashboard above.

The tables in this README are summaries. The scores of each run, per configuration and per made-up or XFUND document, are in the private results repository, next to the other model tests.

Private test documents

The test documents themselves are not in this repository. Put internal documents into benchmarks/internal/docs/: git ignores everything in benchmarks/internal/ except its README, and a pre-commit hook rejects files added there by force. Without that folder the benchmarks still run, on the synthetic documents, data/ocr.png and the public XFUND forms. benchmarks/internal/README.md says what to add for each kind of document (nothing, a transcription in benchmarks/internal/references.json, or a hand-checked <name>.gt.md), and how the box editor in tool_comparison/box_editor/ records where each line of text stands on the page.

OCR engine × layout model

engines.config.json builds a second dashboard with the same page: RapidOCR and GLM-OCR, each with docling's default layout model and with PP-DocLayout-V3, all in the published dcc-docling-serve-cu130:v1.35.0 image (docling-glm-ocr 0.5.2, docling-pp-doc-layout 0.2.5) with otherwise identical options. It also compares these runs with the earlier ones on docling-glm-ocr 0.5.1 and docling-pp-doc-layout 0.2.4. On top of the converter views it shows:

  • an engine × layout grid for each key metric (ground-truth F1, scanned text, text in images, tables, headings, text-layer recall and precision, reference recall, time)
  • a "Previous vs published" tab: pages with text that came out empty, and the documents where the two plugin versions differ (tab title and column names come from pairs_tab and each pair's title and names)
  • a "Words not in reference" tab: output words that are missing from the ground truth or the reference transcription, split into misreadings and words with no close match (useful for GLM-OCR, which is a VLM)

The handwritten note (data/ocr.png) and the phone photo in the test documents have no text layer. They are scored against the transcriptions in benchmarks/tool_comparison/references.json. Put the pros and cons into engines.assessment.json (same format as assessment.json).

Results with the published image, all 28 documents (RTX 4090, vLLM 0.29 for GLM-OCR):

Configuration Time Synthetic F1 Headings Text-layer recall / precision Handwritten note Photo handwriting
RapidOCR + default layout 167 s 0.96 1.00 0.75 / 0.92 31 % 30 %
RapidOCR + PP-DocLayout-V3 199 s 0.96 0.96 0.83 / 0.92 27 % 44 %
GLM-OCR + default layout 190 s 0.94 0.92 0.75 / 0.85 97 % 85 %
GLM-OCR + PP-DocLayout-V3 273 s 0.94 0.96 0.84 / 0.90 96 % 89 %

With docling-glm-ocr 0.5.1 the two GLM-OCR runs took 2'745 s and 2'701 s: the plugin OCR'd every born-digital page as a full page. The text-free photos in the Legislaturplan now come out empty, except for one invented English description of the city photo with PP-DocLayout-V3.

The config also lists candidates that are not in the image yet:

  • Nemotron OCR v2 (docling's built-in nemotron-ocr engine) with each layout model
  • docling's Egret layout models (medium, large, xlarge) with RapidOCR, and Egret large with Nemotron OCR and GLM-OCR
  • PP-OCRv6 (our docling-pp-ocrv6 plugin) with each layout model
  • Nemotron 3.5 Parse, LightOnOCR-3-4B and Unlimited-OCR-2 on the whole page through docling's VLM pipeline, with the presets in benchmarks/tool_comparison/vlm_presets.json
  • Unlimited-OCR-2 without docling, the whole document in one request to its SGLang server (run_unlimited_ocr.py, row unlimited-ocr-2-sglang)
  • LightOnOCR-3-4B without docling, with LightOn's own client: every page at once, one image per request, grounding mode without headers and footers (run_lighton_ocr.py, row lighton-ocr-3-vllm)

Candidates tested in October 2026

96 documents: the 25 test documents, 21 synthetic documents (17 of them administrative: forms, invoices, receipts, scans and phone photos) and 50 German forms from the public XFUND set (fetch_public.py; CC BY-NC-SA, internal use only). Image v1.38.1 on an RTX 4090, three timed repeats after a warm-up. The GLM-OCR rows use the released docling-glm-ocr 0.5.2.

Configuration Time Synthetic F1 Tables Headings XFUND recall / precision Text-layer recall / precision Handwritten note
RapidOCR + default layout 237 s 0.94 0.98 1.00 0.90 / 0.93 0.76 / 0.92 31 %
RapidOCR + PP-DocLayout-V3 307 s 0.94 0.99 0.89 0.86 / 0.85 0.84 / 0.94 27 %
GLM-OCR + default layout 458 s 0.94 0.63 0.63 0.91 / 0.97 0.76 / 0.86 98 %
GLM-OCR + PP-DocLayout-V3 482 s 0.95 0.64 0.56 0.89 / 0.97 0.85 / 0.91 98 %
RapidOCR + Egret medium 243 s 0.93 0.99 1.00 0.89 / 0.91 0.73 / 0.92 31 %
RapidOCR + Egret large 234 s 0.94 0.99 1.00 0.89 / 0.93 0.74 / 0.91 31 %
RapidOCR + Egret xlarge 231 s 0.94 0.99 0.98 0.89 / 0.94 0.72 / 0.92 31 %
PP-OCRv6 + default layout 256 s 0.95 0.99 0.98 0.91 / 0.94 0.76 / 0.92 37 %
PP-OCRv6 + PP-DocLayout-V3 328 s 0.95 0.99 0.87 0.87 / 0.87 0.84 / 0.94 39 %
PP-OCRv6 + Egret large 255 s 0.95 0.99 0.98 0.89 / 0.94 0.75 / 0.91 37 %
Nemotron OCR v2 + default layout 187 s 0.94 1.00 1.00 0.86 / 0.90 0.76 / 0.88 62 %
Nemotron OCR v2 + PP-DocLayout-V3 239 s 0.95 1.00 0.89 0.85 / 0.83 0.84 / 0.94 61 %
Nemotron OCR v2 + Egret large 179 s 0.95 1.00 1.00 0.86 / 0.91 0.74 / 0.91 62 %
GLM-OCR + Egret large 455 s 0.95 0.55 0.56 0.89 / 0.97 0.76 / 0.84 96 %
Nemotron 3.5 Parse (whole page) 538 s 0.93 1.00 0.95 0.89 / 0.91 0.78 / 0.80 93 %
LightOnOCR-3-4B (whole page) 4'949 s 0.69 0.00 0.98 0.98 / 0.68 0.86 / 0.74 100 %

None of the candidates replaces what the image has. Their weaknesses:

  • Egret (docling's layout models, medium/large/xlarge). The same scores as docling's default layout model, and the same blind spot: it misses most of the text on plans (text-layer recall 0.72–0.75, against 0.84 with PP-DocLayout-V3). Larger Egret models gain nothing. Only PP-DocLayout-V3 finds the plan labels.
  • Nemotron OCR v2. The fastest engine and good on print, but its recogniser is English-only: umlauts and ß come out wrong or missing (XFUND precision 0.83–0.91). The nemotron-ocr package needs torch 2.11, which makes RapidOCR, layout and TableFormer about 7× slower in the same image.
  • PP-OCRv6. Slightly better than RapidOCR on the administrative documents and on XFUND, at the same speed. Like every classic OCR engine it can't read handwriting (37–39 % on the note).
  • Nemotron 3.5 Parse. Good tables and headings, but it converts every page with the VLM: 2× slower than GLM-OCR, precision on the text layer drops to 0.80, and on large plan drawings it runs out of output tokens and returns an empty page (partial_success).
  • LightOnOCR-3-4B. The best reader of handwriting and photos, but 10× slower than GLM-OCR (up to 6 minutes for one pass over a long PDF), no table structure at all, and low precision (0.68 on XFUND) because it adds and repeats text. The November run below shows that the missing tables come from docling, not from the model. Its low precision has more than one cause, see there.
  • Not tested: Chandra-OCR-2 and Indra-OCR (Datalab). Their weights use a modified OpenRAIL-M licence that is free only for small companies.

Unlimited-OCR-2, November 2026

Baidu's Unlimited-OCR-2 on the same 96 documents, served by SGLang with the settings from the model card. Two rows: through docling 2.146.0's VLM pipeline (unlimited_ocr2 response format, one request per page) and without docling, the whole document in one request as the model card does it (run_unlimited_ocr.py). One timed pass each, so times are not exact matches for the three-repeat rows above. The direct times cover the request only, not rendering the pages at 300 DPI, which the docling times include.

Configuration Time Synthetic F1 Tables Headings XFUND recall / precision Text-layer recall / precision Handwritten note
Unlimited-OCR-2 in docling (whole page) 5'057 s 0.93 0.99 0.93 0.88 / 0.86 0.82 / 0.86 failed
Unlimited-OCR-2 without docling (whole document) 7'966 s 0.89 0.99 0.91 0.94 / 0.96 0.82 / 0.84 34 %

It doesn't replace anything either:

  • In docling the quality is close to the OCR engines, but it converts every page with the VLM: about 10× slower than GLM-OCR. The 5'057 s leave out two phone photos that failed: docling renders them at scale 4, about 200 megapixels, and SGLang rejects images that large.
  • Without docling it reads the XFUND forms best of all rows, but long documents are 2.5–7× slower than in docling because the pages are decoded one after another. Some documents end in repetition loops ("4103. 4104. 4105. …" on a fax, empty table cells up to the page token limit on two papers), and the 603-page CELEX regulation hit the 30-minute request timeout (not counted in the 7'966 s). It reads only a third of the handwritten note.
  • SGLang needs the model card's environment variables and --enable-streaming-session --allow-auto-truncate; without them requests with several pages hang. run_engines.sh sets them. On single handwritten lines (the ai-model-evaluation OCR suite) the model returns nothing or loops on some lines, with Baidu's transformers reference code as well.

LightOnOCR-3-4B without docling, November 2026

LightOnOCR-3-4B on the same 96 documents, both rows on vLLM 0.30.0 with transformers 5.16.1, the versions LightOn tests with, one timed pass each on an RTX 4090. The first row goes through docling's VLM pipeline and replaces the October run. The second uses LightOn's own client (run_lighton_ocr.py) the way its CLI does: every page rendered at 2048 px, all pages of a document sent at once, grounding mode, headers, footers and page numbers left out (footnotes kept, as docling keeps them). Both times include rendering the pages.

The two rows differ in more than docling. The docling preset uses the model's plain transcription mode (empty prompt), which also transcribes headers and footers, and caps the answer at 4'096 tokens. The client uses grounding mode, drops headers and footers by their block labels and sets no token cap.

Configuration Time Synthetic F1 Tables Headings XFUND recall / precision Text-layer recall / precision Handwritten note
LightOnOCR-3-4B in docling (whole page) 4'933 s 0.69 0.00 0.98 0.98 / 0.68 0.85 / 0.76 100 %
LightOnOCR-3-4B without docling (LightOn client) 2'457 s 0.94 0.99 1.00 0.91 / 0.98 0.82 / 0.86 98 %
  • In docling the model looks much worse than it is. LightOnOCR-3 writes tables as HTML, docling's VLM pipeline reads the answer as markdown and escapes the HTML into text (&lt;table&gt;…). Every table is lost, which is docling's doing. The lower body F1 (0.69) and XFUND precision (0.68) come partly from the escaped tables and partly from the headers and footers the plain mode writes; this run doesn't separate the two. With the 4'096-token cap a few dense pages end early (partial_success), and docling sends 8 pages at a time.
  • Without docling the model reads well: F1 0.94 and tables 0.99 on the made-up documents, XFUND precision 0.98, and it is twice as fast as in docling. It is still 5× slower than GLM-OCR + PP-DocLayout-V3 (482 s) and 7× slower than PP-OCRv6 + PP-DocLayout-V3 (328 s). One page came back empty (page 11 of the Legislaturplan).

The client is not a replacement for docling. It turns a PDF or an image into markdown, page by page, and that is all. What docling does for us that it doesn't:

  • Text layers. Docling takes the text of born-digital pages from the PDF and runs OCR only on scans and pictures. The client has the 4B model retype every page, digital or not. That is where the time goes, and why it reaches only 0.86 precision on the text layers (0.94 with PP-OCRv6), against text that was there for free.
  • Other formats. The client reads PDFs and images. Docling also converts DOCX, PPTX, XLSX, HTML and Markdown.
  • Document structure. The client returns markdown with a label and a box per block, and tables as HTML. Docling returns a DoclingDocument: headings, lists, table cells, pictures and captions, each with its page and box. The JSON export, our word boxes (include_word_boxes) and docling's chunkers build on it.
  • The service. The client is a Python library and CLI. docling-serve gives us the HTTP API with async jobs, the UI, OCR and layout chosen per request, and the image we deploy. Using LightOn on its own would mean writing and running that service ourselves, next to a vLLM server with the 4B model on a GPU for every page.

The client does give us two things docling doesn't: a short description of each picture, and the data of charts as a table. If we want LightOnOCR-3 for handwriting or photos, the way in is through docling, once docling keeps its HTML tables.

Granite Docling v2 2B, December 2026

IBM's granite-docling-v2-2b (Apache 2.0, DocLang output) on the same 96 documents, through docling 2.155.0's VLM pipeline (preset granite-docling-v2-2b in vlm_presets.json, the settings of docling's granite_docling_v2_2b preset, pages at 144 DPI). The server is a vLLM nightly (0.34.1rc1.dev353) with transformers 5.23.0 and the model card's flags, including MTP speculative decoding with 3 draft tokens. One timed pass on an RTX 4090. The docling side runs in the engines-granite test image: our v1.38.1 image with docling 2.155.0, docling-core 2.108.0, docling-jobkit 3.10.0 and docling-parse 7.28.0 (docling-serve won't start, or fails on every PDF, with the image's older versions). The time leaves out the hand-written note.jpg, which the other rows didn't have.

Configuration Time Synthetic F1 Tables Headings XFUND recall / precision Text-layer recall / precision Handwritten note
Granite Docling v2 2B (whole page, MTP) 1'125 s 0.94 1.00 1.00 0.93 / 0.95 0.79 / 0.88 83 %
Same, 64 pages in flight, vLLM capped at 10 GB 642 s

The second row (vlm-granite-docling-v2-b64, run 2026-12-03) sets DOCLING_PERF_PAGE_BATCH_SIZE=64 and preset concurrency 64. Its scores match the first row (greedy decoding; same text-layer means, same dropped plan page). It ran with docling-serve and vLLM on one GPU and VLLM_MEMORY=0.42 (8.7 GB in use, KV cache for 46k tokens, so vLLM keeps only about 15–25 pages running and queues the rest); with the default 0.85 it would be faster.

The best full-page VLM so far, but not a replacement for the image. Decision (December 2026): we don't adopt it for now.

  • Quality. Perfect tables and headings on the made-up documents, which no OCR row has (PP-DocLayout-V3 rows: 0.99 / 0.87–0.89), and on XFUND the best recall of all docling rows but LightOnOCR's, at 0.95 precision (GLM-OCR + PP-DocLayout-V3: 0.89 / 0.97). It reads English handwriting (83 %, against 27–39 % for the OCR engines and 98 % for GLM-OCR). Like every full-page VLM it retypes born-digital pages, so precision on the text layer drops to 0.88 (0.94 with PP-OCRv6 + PP-DocLayout-V3), and it misses plan labels (recall 0.79, against 0.84). One plan drawing came out empty: the model's DocLang for the page was not valid XML and docling dropped the whole page (partial_success).

  • Speed. 3.7× slower than RapidOCR + PP-DocLayout-V3 (301 s) and 2.3× slower than GLM-OCR + PP-DocLayout-V3 (482 s), but 4.5× faster than the other full-page VLMs. Born-digital PDFs cost 0.8–2 s per page, against 0.1–0.2 s when docling takes the text layer.

  • MTP and concurrency. MTP works on the vLLM nightly: mean acceptance length 3.65 of 4. Docling sends only page_batch_size (4) pages at a time, which leaves vLLM mostly idle. Measured directly on 128 pages of the CELEX regulation, the server does:

    Requests in flight With MTP Without MTP
    4 1.33 pages/s 0.73 pages/s
    16 3.16 pages/s 1.93 pages/s
    64 4.23 pages/s 3.14 pages/s

    MTP is worth 1.8× at docling's default and 1.35× at 64 requests. With DOCLING_PERF_PAGE_BATCH_SIZE=64 and preset concurrency 64 the whole set takes 642 s instead of 1'125 s (2.1× RapidOCR + PP-DocLayout-V3) and the 603-page regulation 196 s instead of 474 s (RapidOCR + PP-DocLayout-V3: 102 s), even with vLLM capped at 10 GB. Short documents gain little: a 2-page plan still takes 25 s.

  • Deployment. A second model server next to docling-serve: the 2B model in bf16 plus KV cache wants a GPU slice of its own, and it needs a vLLM build newer than 0.34.0 and transformers 5.23.0. On this build the MTP drafter gets no image embeddings (vLLM logs "text-only draft inputs"); acceptance is high anyway.

GLM-OCR's weak tables and headings come from the plugin, not the model: it returns one text cell per region, so docling can't build table cells or tell a heading from body text. The fix/line-level-cells branch of docling-glm-ocr gives each text line its own box and lifts tables to 0.84 and headings to 0.94; it is not released yet.

run_engines.sh runs the whole matrix into results/engines and builds the dashboard. It runs every configuration in a test image built from Dockerfile.engines: the published image plus the Egret weights. The Nemotron OCR configurations use a second image that also has nemotron-ocr. That package is built against torch 2.11, so this image downgrades torch, and the downgrade makes RapidOCR about 7× slower on a scan. Nemotron OCR therefore can't go into the production image as it is. GLM-OCR and the two VLMs each get a vLLM container on VLLM_GPU while their configurations run:

benchmarks/tool_comparison/run_engines.sh                                    # all configurations
ONLY="nemotron-ocr vlm-lighton-ocr-3" benchmarks/tool_comparison/run_engines.sh  # some of them
VLLM_GPU=0 VLLM_MEMORY=0.3 benchmarks/tool_comparison/run_engines.sh             # on a shared GPU
python3 -m http.server -d benchmarks/tool_comparison/results/engines/dashboard 8766

Each configuration is a run_docling.py run whose --tool matches an id in the config, with --results pointing at one shared folder. The earlier fixed-rapidocr-pp-t03, fixed-glm and fixed-glm-pp-t03 runs are not part of run_engines.sh. To rebuild the dashboard alone:

cd benchmarks/tool_comparison
uv run --script build_dashboard.py --config engines.config.json --results <engine results>

Configurations or documents without results are left out; grid cells show "not run".

Lists with PP-DocLayout-V3

PP-DocLayout-V3 has no list-item class, so before plugin 0.2.6 docling produced no lists with it: bullet points came out as paragraphs starting with "·" (367 list items against Heron's 2'422 on the test documents). The plugin now detects list items after OCR from list markers, enumerator sequences and bullet marks OCR did not read (PP_DOC_LAYOUT_LIST_DETECTION=rules, the default), optionally with docling's Heron model as a second opinion (heron). Details in the plugin README.

benchmarks/list_eval/ holds the benchmark: make_lists.py generates list pages with exact ground truth (born-digital and scanned, with traps such as numbered headings, dates and amounts), run_all.sh <image> converts them and the test documents with Heron and with PP-DocLayout-V3 in each mode, evaluate.py scores them. Results with plugin 0.3.0 on docling-serve v1.39.0 (RTX 4090):

Configuration Born-digital R / P Scanned R / P Traps as list items Bullet lines found Time
Heron (docling default) 0.67 / 0.96 0.94 / 0.92 2 218 / 257 115 s
PP-DocLayout-V3, off 0 0 0 0 / 257 117 s
PP-DocLayout-V3, rules 1.00 / 1.00 0.83 / 1.00 0 204 / 257 122 s
PP-DocLayout-V3, heron 1.00 / 1.00 0.94 / 0.94 1 204 / 257 131 s

On v1.38.2 the scans scored 0.97 / 0.95 (Heron) and 0.86 / 1.00 (rules), the rest the same: docling-parse 7.27 renders scanned pages a little differently for OCR, which garbles other lines of the synthetic scans. Heron misses 39 of the bullet lines as well; 12 of the lines only PP-DocLayout-V3 misses are the brochure's commission list, which it lays out as a picture (the text is in the JSON output, inside the picture). List detection runs inside docling's layout post-processing, which has no plugin interface yet; add a check to the upgrade list below that lists still appear.

Upgrading docling-serve

Our image changes upstream in a few places (plugins, GPU OCR, the words of each page). Check each one before publishing an image built on a new docling-serve version (replace v1.41.0 with the new tag). Build the image first (step 2) for the checks that use it.

  1. Plugins in the web UI. We ship upstream's UI unchanged. Check that the plugins still show up where the UI reads its choices from: glm-ocr-remote under the OCR presets and ppdoclayout-v3 under the layout presets (added by DOCLING_SERVE_CUSTOM_LAYOUT_PRESETS in compose.yaml):

    docker run -d --name upgrade-check -p 5099:5001 -e DOCLING_SERVE_ENABLE_UI=true \
      -e DOCLING_SERVE_ALLOW_EXTERNAL_PLUGINS=true \
      -e 'DOCLING_SERVE_CUSTOM_LAYOUT_PRESETS={"ppdoclayout-v3": {"kind": "ppdoclayout-v3"}}' \
      dcc-docling-serve-test:cu130
    curl -s localhost:5099/v1/capabilities | python3 -c "import sys, json; s = json.load(sys.stdin)['stages']; \
      print([p['id'] for p in s['ocr']['presets']], [p['id'] for p in s['layout']['presets']])"
    docker rm -f upgrade-check
    
  2. Build the images locally (CU130 and CPU at least). The build itself fails if onnxruntime-gpu has no CUDA provider or its libraries do not resolve:

    docker build --build-arg DOCLING_SERVE_IMAGE=ghcr.io/docling-project/docling-serve-cu130 \
      --build-arg DOCLING_SERVE_TAG=v1.41.0 -t dcc-docling-serve-test:cu130 \
      -f plugins/Dockerfile.docling-serve plugins/
    
  3. GPU OCR at runtime. The RapidOCR session must list CUDAExecutionProvider first:

    docker run --rm --gpus device=0 --entrypoint python dcc-docling-serve-test:cu130 -c "
    import glob, onnxruntime as ort
    model = sorted(glob.glob('/opt/app-root/src/.cache/docling/models/RapidOcr/*det*.onnx'))[0]
    print(ort.InferenceSession(model, providers=['CUDAExecutionProvider', 'CPUExecutionProvider']).get_providers())"
    
  4. Vector shapes do not force OCR. docling 2.136 fixed this upstream (we carried a patch for it until docling-serve 1.37.0), so a rule or a table fill crossing programmatic text no longer sends that text to OCR. Check the fix is still in (True); if it is gone, restore the patch from git history (plugins/ocr_ignore_shapes.py, removed with the move to 1.37.0):

    docker run --rm --entrypoint python dcc-docling-serve-test:cu130 -c \
      "import docling.models.base_ocr_model as m; print(hasattr(m.BaseOcrModel, '_is_rule_like'))"
    
  5. Words of each page. Check that the option and the field are still there, and that they survive nesting (a stale holder schema drops the field on the way out):

    docker run --rm --entrypoint python dcc-docling-serve-test:cu130 -c "
    from docling.datamodel.service.responses import ConvertDocumentResponse, ExportDocumentResponse
    from docling.datamodel.service.options import ConvertDocumentsOptions
    print('option:', 'include_word_boxes' in ConvertDocumentsOptions.model_fields)
    r = ConvertDocumentResponse(document=ExportDocumentResponse(filename='x'), status='success', processing_time=0.1)
    r.document.word_boxes = {1: None}
    print('answered:', 'word_boxes' in r.model_dump()['document'])"
    
  6. Speed kept. Compare timings against the previous release; born-digital documents (the CELEX regulation) should not be OCR-bound:

    uv run --script benchmarks/e2e_timing.py --docs benchmarks/internal/docs --tag v1.41.0 --variants official-cu130 custom-cu130 \
      --image custom-cu130=dcc-docling-serve-test:cu130
    
  7. Plugins. Run the e2e tests against the stack (GLM-OCR via vLLM, PP-DocLayout-V3) and convert a document in the web UI with both plugins selected. Then check that PP-DocLayout-V3 still produces lists: its list detection hooks into docling's layout post-processing and switches itself off (warning "list detection is off" or "list detection failed" in the logs) if docling changed it. benchmarks/list_eval/run_all.sh dcc-docling-serve-test:cu130 should show the pp-rules numbers from the table above.

  8. Publish. Merge to main, then run the Build docling-serve with layout and OCR plugins workflow with version=v1.41.0:

    gh workflow run cd.yml -f version=v1.41.0
    
  9. Documentation. Update the docling pages of the documentation repo (markdown/docling/serve.md) to match: the version in the Releases example, the features and environment variables of any patch added or removed, and the plugin versions if they changed. Open a PR there.

CI/CD

CI (.github/workflows/ci.yml)

Runs on push/PR: lint with ruff.

Docker image (.github/workflows/cd.yml)

Builds and pushes the patched docling-serve images (default, -cpu, -cu128, -cu130) to GHCR. It runs only when dispatched manually (Actions → Build docling-serve with layout and OCR plugins → Run workflow, or gh workflow run cd.yml -f version=v1.41.0); pushing to main never publishes an image. Its one input, version, is a docling-serve release tag: every variant is built on that upstream tag and published under the same tag and :latest. Moving tags such as main or latest are refused.

To ship our own changes (a plugin bump, a patch) without a new upstream release, run it again with the current version; it overwrites that tag with the new build.

The tag is resolved to its digest at the start of the run and the build uses that digest, so all variants of one run share the same base. The digest is shown in the run summary and stored in the image labels:

docker inspect ghcr.io/dcc-bs/dcc-docling-serve:v1.41.0 \
  --format '{{ index .Config.Labels "org.opencontainers.image.base.name" }} {{ index .Config.Labels "org.opencontainers.image.base.digest" }}'

Each image is pushed with an SBOM: an SPDX list of its OS and Python packages and of the models it holds. The models this repository bakes in (PP-DocLayout-V3, PP-OCRv6 detection and recognition) are written to dcc-models.cdx.json in the models directory at build time by plugins/models_sbom.py, with the pinned commit and the SHA-256 of each file, so the list follows the revisions in the Dockerfile without being edited by hand. To read the SBOM:

docker buildx imagetools inspect ghcr.io/dcc-bs/dcc-docling-serve:v1.38.2 \
  --format '{{ json (index .SBOM "linux/amd64").SPDX.packages }}'

License

MIT