docling-serve

by upstreamyard

Helm chartv0.1.9App 1.40.0MITVerified publisher

Docling Serve Helm chart for Kubernetes. Document conversion API (PDF, DOCX, PPTX, HTML, images to Markdown and JSON) for RAG pipelines, with API key auth by default, scalable RQ workers on Redis, KEDA queue autoscaling, CPU and CUDA images and Prometheus metrics. Community chart by upstreamyard, not an official Docling chart.

About this chart

Docling Serve Helm chart: the Docling document conversion API on Kubernetes

Have any questions, feedback or need help (e.g. setup, hardened images, etc.)? Reach out to [email protected]

Helm chart for Docling Serve, the API server of Docling. It converts PDF, DOCX, PPTX, XLSX, HTML and images into Markdown, JSON or HTML, with layout analysis, table structure and OCR, for RAG and document AI pipelines. It runs a single API server, or scalable API servers plus RQ workers with a job queue in Redis, and KEDA autoscaling on the queue length down to zero workers. An API key is required by default (generated), and the pods run non-root with a read-only root filesystem. It works with Docling Serve's official CPU and CUDA images, and includes Prometheus metrics, a ServiceMonitor and a helm test that converts a real PDF.

Community chart by upstreamyard, not an official Docling chart. Docling Serve is © its authors, licensed under MIT. The chart uses the official Docling Serve images unchanged.

AI agents and coding assistants: this README is the complete reference for the chart. Every value is listed under Values, and values.schema.json validates them.

Install

helm repo add upstreamyard https://upstreamyard.github.io/helm-charts
helm install docling upstreamyard/docling-serve

Or from the OCI registry:

helm install docling oci://ghcr.io/upstreamyard/charts/docling-serve

The install notes show the in-cluster URL and the command that prints the generated API key. Then check that a document converts:

helm test docling

Verifying the chart

Chart packages are PGP-signed. Import the public key (fingerprint 9B416F989B7E6C65F7F3BFAE7689688B20EC7813) and install with --verify:

curl -s https://upstreamyard.github.io/helm-charts/pgp_keys.asc | gpg --dearmor > upstreamyard.gpg
helm install docling upstreamyard/docling-serve --verify --keyring upstreamyard.gpg

The OCI copy on GHCR is signed with cosign instead (see the repository README).

What the chart does

  • API server (docling-serve run) on port 5001, with the models for layout, tables, picture classification, RapidOCR and EasyOCR already in the image. The pod is ready about 10 seconds after it starts.
  • API key: DOCLING_SERVE_API_KEY from a Secret, generated on install and kept across upgrades, or from your own Secret. Clients send it in the X-Api-Key header; requests without it get 401.
  • Probes: /livez for startup and liveness, /readyz for readiness (503 until the models are loaded and, with RQ, Redis answers).
  • RQ workers (docling-serve rq-worker) in their own Deployment with engine.kind: rq, optionally scaled by KEDA on the Redis queue, and optionally on GPU nodes with a CUDA image.
  • Extra models: models.download fetches more models (e.g. for formula enrichment) in an init container.
  • Security: non-root (UID 1001), read-only root filesystem with /tmp as an emptyDir, all capabilities dropped, no ServiceAccount token.
  • Validation: the install fails with a clear message on combinations that don't work, e.g. several API pods with the local engine.

Deployment modes

Single API server (default)

The API pod converts documents itself (the local engine), engine.local.numWorkers at a time (default 2).

engine:
  local:
    numWorkers: 2
resources:
  requests:
    cpu: "2"
    memory: 2Gi
  limits:
    memory: 6Gi
  • Tested in kind (CPU image, 16-core host): the 9-page DocLayNet paper (arXiv 2206.01062, with tables and figures) converted in 13 seconds, with a peak memory of 2.5 GB.
  • Only one API pod works with the local engine. Async tasks live in the pod's memory, so a status request that reaches another pod gets Task not found (tested). The chart refuses replicaCount > 1 and autoscaling.enabled here.

Scalable: API servers plus RQ workers (Redis)

The API pods only queue jobs in Redis and return results, and the worker pods convert. API pods and workers scale independently. Bring your own Redis; the chart doesn't install one.

engine:
  kind: rq
  rq:
    existingSecret: docling-redis      # key: redis-url, e.g. redis://:[email protected]:6379/0
replicaCount: 2
resources:
  requests:
    cpu: 250m
    memory: 1Gi
worker:
  replicaCount: 4
  • Tested in kind: a task submitted to one API pod was polled and fetched from the other. A rolling upgrade from 1.36.0 to 1.37.0 replaced API and worker pods in 12 seconds.
  • Graceful shutdown: a worker that gets SIGTERM finishes the document it is converting, then exits (tested). worker.terminationGracePeriodSeconds (300) is the limit; a conversion that runs longer is cut off and the task is reported as failure about 90 seconds later. It is not retried, so clients should resubmit failed tasks.
  • Each worker converts one document at a time. Several installations on one Redis need different engine.rq.queueName values or Redis databases.

Autoscaling workers with KEDA

With KEDA in the cluster, a ScaledObject scales the workers on the length of the RQ queue (rq:queue:<queueName> in Redis):

engine:
  kind: rq
  rq:
    existingSecret: docling-redis
worker:
  autoscaling:
    enabled: true
    minReplicaCount: 0                 # no workers while the queue is empty
    maxReplicaCount: 10
    listLength: 2                      # waiting jobs per worker
    redisAddress: redis.example.svc:6379
    redisDatabase: 0
    redisPasswordSecret: docling-redis # key: redis-password; leave empty without a password
  • Tested in kind with KEDA 2.21: 8 queued jobs scaled the workers from 1 to 4 within 20 seconds, and all jobs succeeded, also with a password-protected Redis. From zero workers, a new job was picked up after about 10 seconds.
  • KEDA reads Redis directly, so it needs the address, database and password separately from engine.rq.
  • API pods scale with a regular HorizontalPodAutoscaler on CPU: autoscaling.enabled: true (RQ only).

GPU workers

Use a CUDA image for the workers and request a GPU. API pods in RQ mode don't convert, so they can stay on the CPU image:

engine:
  kind: rq
worker:
  image:
    repository: ghcr.io/docling-project/docling-serve-cu128
  resources:
    limits:
      nvidia.com/gpu: 1
      memory: 8Gi
  nodeSelector:
    nvidia.com/gpu.present: "true"
  tolerations:
    - key: nvidia.com/gpu
      operator: Exists
      effect: NoSchedule

The GPU images were not tested by us (no GPU in our test cluster). With the local engine, set image.repository and the GPU resources on the API pod instead.

Connecting clients

  • In-cluster URL: http://<release>-docling-serve.<namespace>.svc:5001, with the header X-Api-Key: <key>.

  • Convert a URL (synchronous, waits up to 120 seconds by default):

    curl -X POST http://<release>-docling-serve:5001/v1/convert/source \
      -H 'Content-Type: application/json' -H "X-Api-Key: $API_KEY" \
      -d '{"sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2206.01062"}]}'
    
  • Upload a file: {"sources": [{"kind": "file", "filename": "doc.pdf", "base64_string": "<base64>"}]} to the same endpoint, or a multipart upload to /v1/convert/file.

  • Long documents: use /v1/convert/source/async, then poll /v1/status/poll/<task_id> and fetch /v1/result/<task_id>.

  • The API reference is at /docs, and ui.enabled: true serves a web UI at /ui. See Docling Serve's usage guide for all options, and use sources as shown above: in 1.37.0 the file_sources field from older examples is rejected with 422.

Choosing the image

All images are published by the Docling project for every release, tagged v<version>. The chart sets the tag from its appVersion; pick the variant with image.repository (and worker.image.repository for RQ workers):

image.repositoryUsePlatformsTested by us
ghcr.io/docling-project/docling-serve-cpu (default)CPU-only nodes, about 2.2 GB compressedamd64, arm64yes (amd64)
ghcr.io/docling-project/docling-serve-cu128NVIDIA GPU, CUDA 12.8amd64, arm64no
ghcr.io/docling-project/docling-serve-cu130NVIDIA GPU, CUDA 13.0amd64, arm64no
ghcr.io/docling-project/docling-servePyPI build; on amd64 it includes CUDA libraries and is about twice the sizeamd64, arm64no

The same images are on quay.io/docling-project/....

Extra models

The image contains the models for the default pipeline. Features such as formula and code enrichment or picture descriptions need more models, and Docling Serve doesn't download them at runtime. Without them the task fails with Model '...' not found in artifacts_path in the logs, and the API answers 404 Task result not found (tested with formula enrichment). List the models in models.download:

models:
  download: [granitedocling, smolvlm]    # formula/code enrichment, picture descriptions
  existingClaim: docling-models          # optional; ReadWriteMany for several pods
  • An init container copies the image's models to /models, downloads the extra ones from Hugging Face and the pods use /models (DOCLING_SERVE_ARTIFACTS_PATH).
  • Without existingClaim every pod downloads at start (granitedocling added about 500 MB and 10 seconds in our test). With a PersistentVolumeClaim the download happens once.
  • Tested: granitedocling made formula enrichment work, and smolvlm picture descriptions (which end with a stray <end_of_utterance> token in 1.37.0). The names are those of docling-tools models download, e.g. granitedocling, smolvlm, granite_vision, code_formula, tableformerv2.

Configuration

Docling Serve is configured with environment variables. Put them in extraEnv (or extraEnvFrom for secrets); they apply to API and worker pods:

extraEnv:
  - name: DOCLING_SERVE_MAX_NUM_PAGES
    value: "500"
  - name: DOCLING_SERVE_LOG_FORMAT
    value: json
  - name: DOCLING_SERVE_ENABLE_REMOTE_SERVICES   # e.g. picture descriptions through an OpenAI-compatible API
    value: "true"

The full list is in Docling Serve's configuration reference. The chart sets DOCLING_SERVE_API_KEY, DOCLING_SERVE_ENG_*, DOCLING_SERVE_ENABLE_UI and DOCLING_SERVE_ARTIFACTS_PATH itself. For a YAML config file (DOCLING_SERVE_CONFIG_FILE), mount a ConfigMap with extraVolumes and extraVolumeMounts.

Production example

# values-prod.yaml
engine:
  kind: rq
  rq:
    existingSecret: docling-redis       # key: redis-url
apiKey:
  existingSecret: docling-api-key       # key: api-key
replicaCount: 2
resources:
  requests:
    cpu: 250m
    memory: 1Gi
  limits:
    memory: 2Gi
worker:
  autoscaling:
    enabled: true
    minReplicaCount: 1
    maxReplicaCount: 8
    redisAddress: redis.example.svc:6379
    redisPasswordSecret: docling-redis  # key: redis-password
  resources:
    requests:
      cpu: "2"
      memory: 3Gi
    limits:
      memory: 6Gi
extraEnv:
  - name: DOCLING_SERVE_MAX_NUM_PAGES
    value: "500"
  - name: DOCLING_SERVE_LOG_FORMAT
    value: json
ingress:
  enabled: true
  className: nginx
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 100m
    nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
  hosts:
    - host: docling.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: docling-tls
      hosts: [docling.example.com]
metrics:
  serviceMonitor:
    enabled: true

FAQ

Is there an official Docling Serve Helm chart? The Docling project publishes the container images but no Helm chart, and Artifact Hub had none before this one. This chart is maintained by upstreamyard and uses the official images unchanged.

How do I run Docling Serve highly available and scaled on Kubernetes? Use engine.kind: rq with Redis, 2 or more API pods, and workers scaled by KEDA. See Deployment modes.

Why can't I run several API pods with the default engine? The local engine keeps tasks in the memory of the pod that received them. Async requests to another pod fail with Task not found. Switch to engine.kind: rq.

How do I monitor it with Prometheus? /metrics on the API port has HTTP, conversion and (with RQ) queue metrics; metrics.serviceMonitor.enabled: true adds a ServiceMonitor. Workers export metrics only via OTLP (DOCLING_SERVE_OTEL_ENABLE_OTLP_METRICS, OTEL_EXPORTER_OTLP_ENDPOINT).

Which endpoints work without the API key? /health, /livez, /readyz, /metrics, /version, /v1/capabilities and the API docs (/docs, /openapi.json). Turn off the docs with DOCLING_SERVE_ENABLE_API_DOCS=false and the version with DOCLING_SERVE_SHOW_VERSION_INFO=false if they must not be public.

Why does a conversion fail with "Model not found in artifacts_path"? The option needs a model that isn't in the image. Add it to models.download (see Extra models).

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for the API pods.
apiKey.enabledbooltrueRequire an API key (DOCLING_SERVE_API_KEY). Without it, anyone who reaches the service can convert documents an

Deploy docling-serve with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has docling-serve on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdocling-serve is pinned at v0.1.9 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply