Skip to main content

OmniParse Service Guide

OmniParse is the parsing and transcription extension used by Kamiwaza's context manager for media-heavy ingestion flows. When enabled, it handles file types that need richer extraction than the built-in document parsers can provide, especially audio, video, and image-oriented inputs.

What It Does​

OmniParse is the public-facing parsing surface behind:

  • audio and video transcription routed through the context manager
  • OCR- and vision-oriented extraction for supported media types
  • advanced parsing flows where the caller sets use_omniparse=true

For DDE-specific ingestion behavior and job flow, see Distributed Data Engine.

Supported Media Types​

The current context-manager configuration includes these OmniParse-backed media extensions:

  • audio: .aac, .aif, .aiff, .flac, .m4a, .m4b, .mp3, .oga, .ogg, .opus, .wav, .wma
  • audio-from-video: .mov, .mp4, .webm
  • images and rich documents: .bmp, .docx, .jpeg, .jpg, .md, .pdf, .png, .tiff, .txt

The exact list comes from the platform's current omniparse_supported_file_types setting.

Common Configuration​

These are the main public knobs that affect OmniParse behavior in the current release:

  • use_omniparse=true enables OmniParse-backed extraction for a request or pipeline run.
  • strict_omniparse=false allows fallback to built-in extractors where one exists instead of failing immediately on an OmniParse error.
  • CONTEXT_MANAGER_MAX_FILE_SIZE controls the default decoded file-size ceiling for context-manager uploads. The default is 100 MB.
  • Streaming uploads use a 200 MB ceiling by default.
  • OmniParse request timeout defaults to 300 seconds.

Size and Place an Instance​

An administrator can size a workroom's OmniParse, run it on a GPU, raise its HTTP keep-alive, tune its memory over long imports, and set its workers and parse threads. Nothing changes unless someone sets one of them, and most of them only an administrator can set. By default OmniParse runs on the CPU with its template's CPU and memory, keeps uvicorn's own keep-alive, and keeps glibc's own malloc settings.

Each setting is part of the OmniParse instance API: POST /api/context/omniparses creates an instance with it, and PUT /api/context/omniparses/{id} changes it. Both take the workroom in the X-Workroom-ID header. For example, to give a workroom's OmniParse up to 24 CPUs and 64 GiB of memory on a GPU:

curl -sS -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workroom-ID: $WORKROOM_ID" \
-H "Content-Type: application/json" \
"$KAMIWAZA_URL/api/context/omniparses/$OMNIPARSE_ID" \
-d '{"resources": {"limits": {"cpu": "24", "memory": "64Gi"}}, "gpu": true}'

The response, and GET /api/context/omniparses/{id}, show the instance's resources and gpu.

With the umbrella chart's default, core.workroom.contextAutoProvisionMode: lazy, Core creates a workroom's OmniParse, named omniparse-<workroom-id>, the first time the workroom needs it, with the template's defaults. To start a workroom with the settings below, create that instance yourself before the workroom's first upload.

An instance keeps the OmniParse release it was created with. An instance created before 1.4.2 refuses resources and gpu with 400, because its release does not declare them. To use them, recreate the instance on the bundled release.

CPU and Memory​

resources sets OmniParse's CPU and memory requests and limits as Kubernetes quantities, such as "24", "500m" or "64Gi":

  • A value you leave out keeps the template's own. With none set, OmniParse runs with a limit of 1 CPU and 4G of memory, and requests 0.05 CPU and 64M.
  • On an update, the resources you send replace the previous ones, and {} clears them, back to the template's values. Leaving resources out of an update keeps them.
  • A request above its limit, counting the template's own values, is refused with 400. To request more memory than the template's 4G limit, raise the limit in the same call.
  • An update applies to the running instance at once: Kubernetes replaces the OmniParse pod. Change it between imports.
  • Only an administrator can set resources. Anyone else gets 403 (omniparse_resources_requires_admin).

Run on a GPU or MIG Slice​

gpu: true runs the instance on the GPU image variant of OmniParse, which runs Docling's layout and table models and the OCR on the GPU. Each GPU instance takes one GPU, or one MIG slice, of the resource the install names in OmniParse GPU Resource (a whole nvidia.com/gpu unless set). gpu: false moves it back to the CPU, and leaving gpu out of an update keeps it as it is.

  • Before you start:
    • NVIDIA GPU nodes with driver R580 or later and the nvidia RuntimeClass (GPU Nodes);
    • amd64 nodes, because the GPU image is built for amd64 only;
    • the direct extension runtime (core.extensionRuntime.mode: direct, the umbrella chart's default);
    • the standard image profile (global.fips.enabled: false). The GPU image has no FIPS build, so under the FIPS profile, the umbrella chart's default, Core refuses gpu: true with 400.
  • No free GPU: Core waits up to a minute for the pod to be placed. When no GPU or slice of that resource is free, it refuses the request with 409, and the instance stays as it was. A create that is refused leaves no instance.
  • Refused with 400: any of these:
    • the FIPS image profile;
    • the operator extension runtime;
    • an install setting that is not a valid resource or RuntimeClass;
    • an OmniParse release whose template has no GPU variant.
  • Administrators only. Anyone else gets 403 (omniparse_gpu_requires_admin).

To share one GPU between OmniParse and models, give OmniParse a MIG slice; see MIG for OmniParse.

From OmniParse 2.5.20, the GPU image sets TORCH_CUDNN_V8_API_DISABLED=1. PyTorch then runs the layout and table models' convolutions on its cuDNN v7 path. On the v8 path, each GPU worker kept about 0.7 MiB of memory for every image it converted. Scanned PDFs go through the same models. A long import could therefore bring the pod to its memory limit. On v7 the memory stays level, at the same CPU per image. You do not need to set anything. The CPU image does not use cuDNN and does not set it.

HTTP Keep-Alive​

Requests reach OmniParse through Envoy, which reuses its connections to OmniParse. When OmniParse closes an idle connection just as Envoy reuses it, that request is reset, and the file it carried can fail. uvicorn, OmniParse's server, closes a connection after 5 seconds idle.

To keep OmniParse's side open longer, set UVICORN_TIMEOUT_KEEP_ALIVE, in seconds, in the instance's config, e.g. "3700". That is a little more than Envoy's default idle timeout of one hour, so Envoy closes an idle connection first:

{"config": {"UVICORN_TIMEOUT_KEEP_ALIVE": "3700"}}

Set it when you create the instance. OmniParse reads it when its pod is created, a later config update does not restart the pod, and a relaunch replays the environment the instance was created with. Only an administrator can set it. Left unset, OmniParse keeps uvicorn's 5 seconds.

Memory over Long Imports​

Over a long import, each OmniParse worker's memory can climb. glibc's malloc keeps memory that parse threads have freed, and each worker keeps the documents it converted most recently. Five settings in the instance's config tune this. OmniParse gets each one only when it is set:

VariableUnsetMeaning
OMNIPARSE_MALLOC_TRIM_INTERVAL_SECONDSOffA positive number of seconds. At most once per interval, and only after a parse has finished, each worker hands the memory that parses freed back to the system, off the request path. It logs one line per trim with the worker's memory figures.
MALLOC_ARENA_MAXglibc's default: up to eight arenas per CPU coreThe most malloc arenas per process, a positive whole number such as 16.
MALLOC_MMAP_THRESHOLD_glibc's own threshold, which rises after large freesAllocations of at least this many bytes go back to the system as soon as they are freed. Give a positive whole number of bytes with no unit, such as 1048576 for 1 MiB. 0 maps every allocation, and a value with a unit, such as 4M, is ignored. An empty value counts as unset.
OMNIPARSE_DOCLING_CACHE_CAPACITY50The most converted documents each worker keeps for later export and chunking requests. 0 turns the cache off.
OMNIPARSE_DOCLING_CACHE_MAX_BYTESNo boundAlso bounds that cache by the approximate memory its documents hold, in bytes, such as 1073741824 for 1 GiB.

For example:

{"config": {"OMNIPARSE_MALLOC_TRIM_INTERVAL_SECONDS": "30", "MALLOC_MMAP_THRESHOLD_": "1048576"}}

Set them when you create the instance, as for keep-alive. OmniParse reads them when its pod is created, a later config update does not restart the pod, and a relaunch replays the environment the instance was created with. Only an administrator can set them.

Workers and Parse Threads​

By default an instance runs one worker process, which converts up to four documents at a time. Five settings in the instance's config set how much it takes on at once and which models it calls. The third column has the values of the import in Sizing for Large Imports, which gave the instance 24 CPUs and 64Gi on a 40 GB MIG slice:

VariableDefaultIn the measured importMeaning
WEB_CONCURRENCY18Worker processes. Each is a process of its own with its own copy of the models, so memory, and on a GPU the GPU's memory, grows with the count.
OMNIPARSE_PARSE_CONCURRENCY44Documents each worker converts at once. An instance converts up to WEB_CONCURRENCY times this many.
OMNIPARSE_PARSE_ACQUIRE_TIMEOUT30.0120Seconds a request waits for a free conversion. After that, OmniParse answers 503 and the file can fail. 0 or less waits without limit.
DOCLING_NUM_THREADS01Threads for each conversion's Docling models and its PDF parser. 0 sizes the model threads from the container's CPUs but leaves the PDF parser with none, so a PDF that reaches Docling, such as a scan, never finishes while its worker holds a CPU at 100%. Set a value above 0. 1 suited 8 workers converting 4 documents each on 24 CPUs; with fewer conversions per CPU, a higher value can use idle cores.
AUTO_LINK_PLATFORM_MODELStrue, Core's own defaultfalseWith true, when the platform has a vision model deployed, Core turns on OmniParse's image descriptions and points them at that model, so each image is also sent to it and the import waits for its answers. A deployed language model is linked for translation the same way. false links none: images then get OCR only, unless an administrator sets a vision endpoint, VISION_MODEL_ENDPOINT, in the instance's config; Core then turns VISION_MODEL_ENABLE on.

For example, to create a workroom's OmniParse with them on a GPU, as measured, and with resources raised to match, because eight workers do not fit in the template's 1 CPU and 4G. With gpu: true, the request needs the setup in Run on a GPU or MIG Slice and is refused without it. Leaving gpu out runs the models on the CPU, which these values were not measured for:

curl -sS -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workroom-ID: $WORKROOM_ID" \
-H "Content-Type: application/json" \
"$KAMIWAZA_URL/api/context/omniparses" \
-d '{
"name": "omniparse-'"$WORKROOM_ID"'",
"resources": {"limits": {"cpu": "24", "memory": "64Gi"}},
"gpu": true,
"config": {
"WEB_CONCURRENCY": "8",
"DOCLING_NUM_THREADS": "1",
"OMNIPARSE_PARSE_ACQUIRE_TIMEOUT": "120",
"AUTO_LINK_PLATFORM_MODELS": "false"
}
}'

Watch OmniParse's CPU against its limit and its 503 answers. When its CPU is at the limit, more workers do not help; when requests get 503 while CPU has room, raise the timeout or the workers.

Set them when you create the instance, as for keep-alive. Only an administrator can set WEB_CONCURRENCY, OMNIPARSE_PARSE_CONCURRENCY and OMNIPARSE_PARSE_ACQUIRE_TIMEOUT. A non-administrator may set AUTO_LINK_PLATFORM_MODELS, and DOCLING_NUM_THREADS from 0 to 32.

Errors That Reach Existing Callers​

Requests that worked before 1.4.2 get the same answers:

  • A second change waits. A second update of the same instance, while one is in progress, waits for it to finish, up to two minutes, then runs. A config-only change finishes in under a second; a change that turns on the GPU can take a minute while Core waits for the pod to be placed.
  • config and the options together. config may name the variables the options set (OMNIPARSE_CPU_REQUEST, OMNIPARSE_CPU_LIMIT, OMNIPARSE_MEMORY_REQUEST, OMNIPARSE_MEMORY_LIMIT, OMNIPARSE_GPU_RESOURCE and OMNIPARSE_GPU_RUNTIME_CLASS). They are stored like any config value, and a create's values size the instance or give it a GPU without the checks the options make (for the GPU: the direct runtime, the FIPS-profile refusal, the check that the release has a GPU variant, and waiting for a free GPU). When the same request also sets resources, or gpu (on a create, gpu: true), the option's values win and the config entries for its variables are dropped, with a warning in Core's log. Use resources and gpu to size OmniParse or give it a GPU.

Operational Notes​

  • OmniParse is invoked by the context manager; end users typically encounter it through upload and ingestion workflows rather than by calling the extension directly.
  • Successful transcription or extraction is still required to produce chunks. Empty transcription results behave like empty content for indexing.
  • For extension-runtime and auth guidance, keep the developer-facing flow in Developer Guide and the public workroom/session contract in Workroom Runtime Contract.