Skip to content

Commit 3520ab3

Browse files
committed
Merge remote-tracking branch 'origin/main' into dev/mahikaw/agentic-enhancements
# Conflicts: # nemo_retriever/src/nemo_retriever/cli/query/options.py
2 parents 26d60d6 + 286becb commit 3520ab3

125 files changed

Lines changed: 8108 additions & 9741 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/reusable-pypi-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ jobs:
8484
DIST_FILES=(./dist/nemo_retriever/dist/*.whl ./dist/nemo_retriever/dist/*.tar.gz)
8585
echo "After legacy glob: count=${#DIST_FILES[@]} files=${DIST_FILES[*]:-<none>}"
8686
87-
# Flat layout (older upload-artifact glob uploads): ./dist/*
87+
# Flat layout (upload-artifact strips to the common parent, so wheels
88+
# often land directly under ./dist/): ./dist/*
8889
if [ "${#DIST_FILES[@]}" -eq 0 ]; then
8990
DIST_FILES=(./dist/*.whl ./dist/*.tar.gz)
9091
echo "After flat glob: count=${#DIST_FILES[@]} files=${DIST_FILES[*]:-<none>}"

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# syntax=docker/dockerfile:1.3
55
#
66
# Build from repo root: docker build -f Dockerfile -t nemo-retriever .
7+
# Service (NIM-forwarding): docker build -f Dockerfile --target service -t nemo-retriever-service .
8+
# Service + in-pod HF: docker build -f Dockerfile --target service-gpu -t nemo-retriever-service-gpu .
79
# Runtime ffmpeg/ffprobe install for service image: docker run -e INSTALL_FFMPEG=true nemo-retriever-service
810
# Run: docker run nemo-retriever (shell with venv active)
911
# Run with dev mount: docker run -v $(pwd):/workspace -it nemo-retriever (code changes reflect without rebuild)
@@ -116,6 +118,22 @@ RUN --mount=type=cache,target=/root/.cache/pip \
116118
. /opt/retriever_runtime/bin/activate \
117119
&& uv pip install -e "./nemo_retriever[service]"
118120

121+
# GPU service install: in-pod Hugging Face models + multimedia (ASR, SVG).
122+
# Build target: service-gpu
123+
FROM base AS install-service-gpu
124+
125+
WORKDIR /workspace
126+
127+
ENV PYTHONUNBUFFERED=1
128+
ENV VIRTUAL_ENV=/opt/retriever_runtime
129+
ENV PATH=/opt/retriever_runtime/bin:$PATH
130+
131+
SHELL ["/bin/bash", "-c"]
132+
RUN --mount=type=cache,target=/root/.cache/pip \
133+
--mount=type=cache,target=/root/.cache/uv \
134+
. /opt/retriever_runtime/bin/activate \
135+
&& uv pip install -e "./nemo_retriever[service,local,multimedia]"
136+
119137
# Default: run in-process pipeline (help if no args)
120138
CMD ["/bin/bash"]
121139

@@ -167,3 +185,45 @@ USER nemo
167185
ENTRYPOINT ["/usr/local/bin/retriever-service-entrypoint"]
168186

169187
CMD ["retriever", "service", "start", "--config", "/etc/nemo-retriever/retriever-service.yaml"]
188+
189+
# ---------------------------------------------------------------------------
190+
# GPU service profile: FastAPI ingest service with in-pod Hugging Face models.
191+
#
192+
# Build: docker build -f Dockerfile --target service-gpu \
193+
# -t nemo-retriever-service-gpu .
194+
#
195+
# Run (requires --gpus all and local_models.enabled in config):
196+
# docker run --rm --gpus all -p 7670:7670 \
197+
# -v /host/retriever-service.yaml:/etc/nemo-retriever/retriever-service.yaml:ro \
198+
# nemo-retriever-service-gpu
199+
# ---------------------------------------------------------------------------
200+
FROM install-service-gpu AS service-gpu
201+
202+
ENV NEMO_RETRIEVER_SERVICE_CONFIG=/etc/nemo-retriever/retriever-service.yaml
203+
204+
ENV PATH=/opt/retriever_runtime/bin:$PATH
205+
206+
COPY docker/scripts/retriever_service_entrypoint.sh /usr/local/bin/retriever-service-entrypoint
207+
COPY docker/scripts/retriever_install_ffmpeg.sh /usr/local/sbin/retriever-install-ffmpeg
208+
209+
RUN chmod a+rx /usr/local/bin/uv /usr/local/bin/uvx /usr/local/bin/retriever-service-entrypoint \
210+
/usr/local/sbin/retriever-install-ffmpeg \
211+
&& chmod -R a+rX /opt/uv \
212+
&& groupadd -r -g 1000 nemo && useradd -r -u 1000 -g nemo -d /workspace -s /sbin/nologin nemo \
213+
&& printf '%s\n' \
214+
'nemo ALL=(root) NOPASSWD: /usr/local/sbin/retriever-install-ffmpeg' \
215+
> /etc/sudoers.d/nemo-ffmpeg \
216+
&& chmod 0440 /etc/sudoers.d/nemo-ffmpeg \
217+
&& visudo -cf /etc/sudoers.d/nemo-ffmpeg \
218+
&& mkdir -p /etc/nemo-retriever /var/lib/nemo-retriever \
219+
&& cp /workspace/nemo_retriever/src/nemo_retriever/service/retriever-service.yaml \
220+
"${NEMO_RETRIEVER_SERVICE_CONFIG}" \
221+
&& chown -R nemo:nemo /workspace /etc/nemo-retriever /var/lib/nemo-retriever /opt/retriever_runtime
222+
223+
EXPOSE 7670
224+
225+
USER nemo
226+
227+
ENTRYPOINT ["/usr/local/bin/retriever-service-entrypoint"]
228+
229+
CMD ["retriever", "service", "start", "--config", "/etc/nemo-retriever/retriever-service.yaml"]

docs/docs/extraction/audio-video.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Instead of running the pipeline locally, you can call Parakeet through [build.nv
100100

101101
2. Run inference from Python with the hosted gRPC endpoint and credentials from that page (the example below uses the default hosted gRPC hostname; confirm values in the **Get API Key** flow for your deployment). Pass hosted endpoint, function ID, and API key through `ASRParams` (`audio_endpoints`, `function_id`, `auth_token`).
102102

103+
For parameter details, refer to the [Python API guide](nemo-retriever-api-reference.md).
104+
103105
```python
104106
from nemo_retriever import create_ingestor
105107
from nemo_retriever.common.params.models import ASRParams

docs/docs/extraction/concepts.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22

33
These terms appear throughout NeMo Retriever Library documentation.
44

5-
## Job
5+
## Job { #job }
66

77
An **ingestion job** is a unit of work you run on input content (documents, audio, video, and other supported types). You submit jobs through the **ingestor Python API** (for example `Ingestor` task chains such as `.extract(...)`) or the **`retriever ingest` CLI**—not by posting a standalone JSON job document. Default tasks target strong recall; customize behavior with task keyword arguments (including chunking and splitting on `.extract()`) or custom UDF-style operations ([NeMo Retriever graph](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph)). Results are structured metadata and annotations (Ray Dataset, pandas `DataFrame`, or similar).
88

9-
## Pipeline and tasks
9+
## Pipeline and tasks { #pipeline-and-tasks }
1010

1111
NeMo Retriever Library does **not** run one static pipeline on every document. You configure **tasks** such as parsing, chunking, embedding, storage, and filtering per job. Related topics: [Extending/Customizing NeMo Retriever Library with custom code](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/src/nemo_retriever/graph#nemo-retriever-graph).
1212

13-
## Extraction metadata
13+
## Extraction metadata { #extraction-metadata }
1414

1515
Output is a **Ray Dataset** (Ray Data) or **pandas** `DataFrame` listing extracted objects (text regions, tables, images, and so on), processing notes, and timing or trace data. Field-level detail is in the [metadata reference](content-metadata.md).
1616

17-
## Embeddings and retrieval
17+
## Embeddings and retrieval { #embeddings-and-retrieval }
1818

19-
Optionally, the library can compute **embeddings** for extracted content and store vectors in [LanceDB](https://lancedb.com/) for downstream semantic search in your application. For upload and retrieval APIs, see [Vector databases](vdbs.md). For multimodal (VLM) embedding options, see [Multimodal embeddings (VLM)](embedding.md).
19+
Optionally, the library can compute **embeddings** for extracted content and store vectors in [LanceDB](https://lancedb.com/) for downstream semantic search in your application. For upload and retrieval APIs, refer to [Vector databases](vdbs.md). For multimodal (VLM) embedding options, refer to [Multimodal embeddings (VLM)](embedding.md).
2020

2121
## Chunking { #chunking }
2222

2323
Chunking is built into the `.extract()` task and depends on **content type**:
2424

2525
- **PDF, DOCX, and PPTX** — Text is grouped using built-in **page** boundaries (one chunk per page where the format has pages).
26-
- **Plain text (`.txt`) and HTML** — Formats without natural page breaks are split into segments of **1024 tokens** by default, using the [Llama 3.2 1B tokenizer](https://huggingface.co/meta-llama/Llama-3.2-1B) so chunk boundaries stay aligned with the default embedding tokenizer. The NeMo Retriever container image bundles this tokenizer, so default text chunking does not require a Hugging Face access token. See [Token-based splitting](#token-based-splitting) and [Environment variables](environment-config.md) for overrides and other runtimes.
27-
- **Audio and video** — Media is split into **segments** for decoding and ASR using ffmpeg-based rules (configurable **size**, **time**, or **frame** split modes in the media chunking stage). With the Parakeet ASR path, you can optionally emit **sentence-like segments** using `extract_audio_params={"segment_audio": True}`; see [Speech and audio extraction](audio-video.md#speech-and-audio-extraction).
26+
- **Plain text (`.txt`) and HTML** — Formats without natural page breaks are split into segments of **1024 tokens** by default, using the [Llama 3.2 1B tokenizer](https://huggingface.co/meta-llama/Llama-3.2-1B) so chunk boundaries stay aligned with the default embedding tokenizer. The NeMo Retriever container image bundles this tokenizer, so default text chunking does not require a Hugging Face access token. Refer to [Token-based splitting](#token-based-splitting) and [Environment variables](environment-config.md) for overrides and other runtimes.
27+
- **Audio and video** — Media is split into **segments** for decoding and ASR using ffmpeg-based rules (configurable **size**, **time**, or **frame** split modes in the media chunking stage). With the Parakeet ASR path, you can optionally emit **sentence-like segments** using `extract_audio_params={"segment_audio": True}`; refer to [Speech and audio extraction](audio-video.md#speech-and-audio-extraction).
2828

29-
For PDF parallelism before Ray processing (large files), see [PDF pre-splitting for parallel ingest](nemo-retriever-api-reference.md#pdf-pre-splitting-for-parallel-ingest).
29+
For PDF parallelism before Ray processing (large files), refer to [PDF pre-splitting for parallel ingest](nemo-retriever-api-reference.md#pdf-pre-splitting-for-parallel-ingest).
3030

3131
### Token-based splitting { #token-based-splitting }
3232

33-
Token-based splitting uses the Llama 3.2 1B tokenizer (default `meta-llama/Llama-3.2-1B`) with configurable `max_tokens` and `overlap_tokens` when you add an explicit `.split(...)` stage or when the pipeline applies the default text segmentation for unstructured text. In the shipped NeMo Retriever container, tokenizer assets are included locally, so you do not need `HF_ACCESS_TOKEN` for this default path. If your runtime loads the tokenizer from the Hugging Face Hub instead (for example, some library-only installs), set `HF_ACCESS_TOKEN` or pass `hf_access_token` in task params when the Hub requires it. Details appear in the [Python API guide](nemo-retriever-api-reference.md).
33+
Token-based splitting uses the Llama 3.2 1B tokenizer (default `meta-llama/Llama-3.2-1B`) with configurable `max_tokens` and `overlap_tokens` when you add an explicit `.split(...)` stage or when the pipeline applies the default text segmentation for unstructured text. In the shipped NeMo Retriever container, tokenizer assets are included locally, so you do not need `HF_ACCESS_TOKEN` for this default path. If your runtime loads the tokenizer from the Hugging Face Hub instead (for example, some library-only installs), set `HF_ACCESS_TOKEN` or pass `hf_access_token` in task params when the Hub requires it. For parameter details, refer to the [Python API guide](nemo-retriever-api-reference.md).
3434

35-
## Deployment modes
35+
## Deployment modes { #deployment-modes }
3636

37-
- **Library mode** — Run without the full container stack where appropriate; see [Deployment options](deployment-options.md).
38-
- **Kubernetes / Helm (self-hosted)**See [Deploy (Helm chart)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md) and [deployment options](deployment-options.md) for running the full microservices pipeline on your infrastructure.
37+
- **Library mode** — Run without the full container stack where appropriate; refer to [Deployment options](deployment-options.md).
38+
- **Kubernetes / Helm (self-hosted)**Refer to [Deploy (Helm chart)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md) and [deployment options](deployment-options.md) for running the full microservices pipeline on your infrastructure.
3939
- **Notebooks**[Jupyter examples](starter-kits.md) for experimentation and RAG demos.
4040

4141
For a concise comparison, refer to [Deployment options](deployment-options.md).

docs/docs/extraction/deployment-options.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Build and run the NeMo Retriever service image with the [Docker service image gu
1919

2020
1. [Pre-Requisites & Support Matrix](prerequisites-support-matrix.md)
2121
2. **NeMo Retriever Helm chart (supported):** [Deploy (Helm chart)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md) — sources in [`nemo_retriever/helm`](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/helm) on GitHub
22-
3. **Published Library Helm charts (supported):** cluster install and upgrade procedures are covered in the [NeMo Retriever Library](https://docs.nvidia.com/nemo/retriever/latest/extraction/overview/) — use alongside the NeMo Retriever chart README for your release
22+
3. **Published Library Helm charts (supported):** cluster install and upgrade procedures are covered in [About getting started](getting-started-about.md) — use alongside the NeMo Retriever chart README for your release
2323
4. [Environment variables](environment-config.md) and [Troubleshoot](troubleshoot.md) as needed
2424

25-
**Core NIMs for the default extraction pipeline** (26.05): `page_elements`, `table_structure`, `ocr`, and `vlm_embed` (`llama-nemotron-embed-vl-1b-v2:1.12.0`). These four are auto-wired into the retriever service. **Nemotron Parse**, **Nemotron 3 Nano Omni**, the **VL reranker**, and **Parakeet ASR** are optional and not auto-wired. For a minimal GPU footprint, disable optional keys you do not need (refer to [Recommended minimal install (26.05)](https://github.com/NVIDIA/NeMo-Retriever/blob/26.05/nemo_retriever/helm/README.md#recommended-minimal-install-2605)). Refer to [Pre-Requisites & Support Matrix — Default Helm NIMs](prerequisites-support-matrix.md#default-helm-nims).
25+
**Core NIMs for the default extraction pipeline:** `page_elements`, `table_structure`, `ocr`, and `vlm_embed` (`llama-nemotron-embed-vl-1b-v2:1.12.0`). These four are auto-wired into the retriever service. **Nemotron Parse**, **Nemotron 3 Nano Omni**, the **VL reranker**, and **Parakeet ASR** are optional and not auto-wired. For a minimal GPU footprint, disable optional keys you do not need (refer to [Recommended minimal install](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md#recommended-minimal-install-2605)). Refer to [Pre-Requisites & Support Matrix — Default Helm NIMs](prerequisites-support-matrix.md#default-helm-nims).
2626

2727
For audio and video extraction in Kubernetes, set `service.installFfmpeg=true` so the service container installs `ffmpeg` and `ffprobe` at startup. This runtime install requires package-repository network egress, a writable root filesystem, and security policy that allows the image's scoped sudo use. If your cluster blocks startup package installation, use a custom service image that already contains `ffmpeg` and `ffprobe`, then set `service.image.repository` and `service.image.tag`. For Parakeet ASR chart values, OpenShift-specific Helm configuration, and air-gapped alternatives, refer to [Audio and video (Parakeet ASR)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md#audio-video-parakeet) and [OpenShift deployment](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/openshift.md) in the Helm chart directory.
2828

@@ -41,7 +41,7 @@ For audio and video extraction in Kubernetes, set `service.installFfmpeg=true` s
4141
2. [Throughput is dataset-dependent](multimodal-extraction.md#extraction-limitations-and-quality)
4242
3. [Evaluate on your data](evaluate-on-your-data.md)
4343

44-
## When to use NVIDIA-hosted NIMs
44+
## When to use NVIDIA-hosted NIMs { #when-to-use-nvidia-hosted-nims }
4545

4646
[NVIDIA-hosted NIMs](https://build.nvidia.com/) run inference on NVIDIA-managed infrastructure. You call models with API keys (refer to [Get your API key](api-keys.md)) without operating GPU nodes yourself.
4747

@@ -53,7 +53,7 @@ Consider hosted NIMs when:
5353

5454
**Also refer to:** [NVIDIA NIM catalog](https://build.nvidia.com/)
5555

56-
## When to self-host NIMs
56+
## When to self-host NIMs { #when-to-self-host-nims }
5757

5858
Self-hosted NIMs run on your GPUs or air-gapped hardware, typically with Kubernetes and the [NIM Operator](https://docs.nvidia.com/nim-operator/latest/index.html).
5959

@@ -69,17 +69,17 @@ Consider self-hosting when:
6969

7070
The **default document extraction pipeline** (page elements, table structure, OCR, and VL embed) runs disconnected when you mirror images and models into a private registry and configure the [NIM Operator for air-gapped environments](https://docs.nvidia.com/nim-operator/latest/air-gap.html).
7171

72-
On a staging host with internet access, pull from NGC, retag to your private registry, stage chart archives, then install in the enclave with registry overrides. Procedures, the 26.05 image inventory, and Helm value patterns are in [Helm — Air-gapped deployment](https://github.com/NVIDIA/NeMo-Retriever/blob/26.05/nemo_retriever/helm/README.md#air-gapped-deployment).
72+
On a staging host with internet access, pull from NGC, retag to your private registry, stage chart archives, then install in the enclave with registry overrides. Procedures, the chart image inventory, and Helm value patterns are in [Helm — Air-gapped deployment](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md#air-gapped-deployment).
7373

7474
!!! warning "Audio and video extraction"
7575

7676
[Audio and video](audio-video.md) need **`ffmpeg` and `ffprobe` on `PATH`**. The bundled image omits them. Do **not** use `service.installFfmpeg=true` in an air gap (startup install needs package-repo egress). Build a custom service image on a connected staging host, mirror it, and set `service.image.repository` / `service.image.tag`. Skip this step if you do not use audio/video.
7777

78-
For offline image captioning, deploy the in-cluster [Nemotron 3 Nano Omni](prerequisites-support-matrix.md#image-captioning-2605) NIM and point your pipeline caption endpoint at the in-cluster HTTP URL instead of `integrate.api.nvidia.com` or other hosted APIs.
78+
For offline image captioning, deploy the in-cluster [Nemotron 3 Nano Omni](prerequisites-support-matrix.md#image-captioning) NIM and point your pipeline caption endpoint at the in-cluster HTTP URL instead of `integrate.api.nvidia.com` or other hosted APIs.
7979

8080
**Related**
8181

82-
- [Deploy (Helm chart)](https://github.com/NVIDIA/NeMo-Retriever/blob/26.05/nemo_retriever/helm/README.md) ([`nemo_retriever/helm`](https://github.com/NVIDIA/NeMo-Retriever/tree/26.05/nemo_retriever/helm) on GitHub) — [air-gapped deployment](https://github.com/NVIDIA/NeMo-Retriever/blob/26.05/nemo_retriever/helm/README.md#air-gapped-deployment)
83-
- [NeMo Retriever Library — prerequisites / deployment](https://docs.nvidia.com/nemo/retriever/latest/extraction/overview/) (supported **Helm** handoff)
82+
- [Deploy (Helm chart)](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md) ([`nemo_retriever/helm`](https://github.com/NVIDIA/NeMo-Retriever/tree/main/nemo_retriever/helm) on GitHub) — [air-gapped deployment](https://github.com/NVIDIA/NeMo-Retriever/blob/main/nemo_retriever/helm/README.md#air-gapped-deployment)
83+
- [About getting started](getting-started-about.md) (prerequisites through first deployment)
8484
- [Pre-Requisites & Support Matrix](prerequisites-support-matrix.md)
8585
- [Audio and video](audio-video.md)

0 commit comments

Comments
 (0)