NVIDIA
NVIDIA
NVIDIA NIM for Text Embedding
Helm Chart
NVIDIA
NVIDIA
NVIDIA NIM for Text Embedding

Helm Chart for NeMo Retriever Text Embedding NIM

Join or Subscribe to get accessSubscribe to the product below to access this premium content:
NVIDIA Developer Program
NVIDIA Developer ProgramJoin the Developer Program for access to free tools, support, and tech resources.
Get Access
NVIDIA AI Enterprise
NVIDIA AI EnterpriseAccelerate your AI agent development
Subscribe Now
Note: You can gain access to hundreds more GPU-optimized artifacts by creating a free NGC account.
Already Subscribed?Log in

Nemo Retriever Embedding Helm Chart

This Helm Chart simplifies Embedding NIM deployment on Kubernetes. It aims to support deployment with a variety of possible cluster, GPU and storage confurations.

NIMs are intended to be run on a system with NVIDIA GPUs, with the type and number of GPUs depending on the model. To use helm, you must have a Kubernetes cluster with appropriate GPU nodes and the GPU Operator installed.

Setting up the environment

If you haven't set up your NGC API key and do not know exactly which NIM you want to download and deploy, see the information in the User Guide.

This helm chart requires that you have a secret with your NGC API key configured for downloading private images, and one with your NGC API key (below named ngc-api). These will likely have the same key in it, but they will have different formats (dockerconfig.json vs opaque). See Creating Secrets below.

These instructions will assume that you have your NGC_API_KEY exported in the environment.

export NGC_API_KEY="<YOUR NGC API KEY>"

Fetching the Helm Chart

You can fetch the helm chart from NGC by executing the following command:

helm fetch https://helm.ngc.nvidia.com/nim/nvidia/charts/text-embedding-nim-1.0.0.tgz --username='$oauthtoken' --password=$NGC_API_KEY

Namespace

You can choose to deploy to whichever namespace is appropriate, but for documentation purposes we will deploy to a namespace named nrem.

kubectl create namespace nrem

Creating Secrets

Use the following script below to create the expected secrets for this helm chart.


DOCKER_CONFIG='{"auths":{"nvcr.io":{"username":"$oauthtoken", "password":"'${NGC_API_KEY}'" }}}'
echo -n $DOCKER_CONFIG | base64 -w0
NGC_REGISTRY_PASSWORD=$(echo -n $DOCKER_CONFIG | base64 -w0 )

cat <<EOF > imagepull.yaml
apiVersion: v1
kind: Secret
metadata:
  name: nvcrimagepullsecret
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: ${NGC_REGISTRY_PASSWORD}
EOF

cat <<EOF > ngc-cli.yaml
apiVersion: v1
kind: Secret
metadata:
  name: ngc-api
type: Opaque
data:
  NGC_CLI_API_KEY: ${NGC_API_KEY}
EOF

kubectl apply -n nrem -f imagepull.yaml
kubectl apply -n nrem -f ngc-cli.yaml

Configuration Considerations

The following deployment commands will by default create a single deployment with one replica using the NV-EmbedQA-E5-V5 model. The following options can be used to make modifications to the behavior. See below for all parameters.

  • image.repository -- The container (Embedder NIM) to deploy
  • image.tag -- The version of that container (Embedder NIM)
  • Storage options, based on the environment and cluster in use
  • resources -- Use this option when a model requires more than the default of one GPU. See below for support matrix and resource requirements.
  • env -- Which is an array of environment variables presented to the container, if advanced configuration is needed

Deploying

Basic deploymnet

helm upgrade --install \
  --namespace nrem \
  nemo-embedder \
  text-embedding-nim-1.0.0.tgz

After deploying check the pods to ensure that it is running, initial image pull and model download can take upwards of 15 minutes.

kubectl get pods -n nrem

The pod should eventually end up in the running state.

NAME              READY   STATUS    RESTARTS   AGE
nemo-embedding-ms-0   1/1     Running   0          8m44s

Storage

Storage is a particular concern when setting up NIMs. Models can be quite large, and you can fill disk downloading things to emptyDirs or other locations around your pod image. It is best to ensure you have persistent storage of some kind mounted on your pod.

This chart supports two general categories:

  1. Persistent Volume Claims (enabled with persistence.enabled)
  2. hostPath (enabled with persistences.hostPath)

The chart will default to use the standard storage class and will create a PersistentVolume and a PersistentVolumeClaim.

If you do not have a Storage Class Provisioner which creates PersistentVolumes automatically, then set the value persistence.createPV=true. This is also necessary when you are using persistence.hostPath on minikube.

If you have an existing PersistentVolumeClaim where you'd like the models to be stored at, then pass that value in at persistence.exsitingClaimName.

See additional options below in Parameters.

Recommended configuration for Minikube

Minkube will create a hostPath based PV and PVC by default with this chart. We recommend that you add the following to your helm commands.

--set persistence.class=standard

Deploying Snowflake Arctic Embedding

Run the helm command with the following parameters, update your version in image.tag:

helm upgrade --install \
  --namespace nrem \
  --set image.repository=nvcr.io/nim/snowflake/arctic-embed-l \
  --set image.tag=1.0.0 \
  nemo-embedder \
  text-embedding-nim-1.0.0.tgz

Deploying Mistral 7B

Create a values files for the resource requirements of the 7B Model:

# values-mistral.yaml
resources:
  limits:
    ephemeral-storage: 28Gi
    nvidia.com/gpu: 1
    memory: 32Gi
    cpu: "16000m"
  requests:
    ephemeral-storage: 28Gi
    nvidia.com/gpu: 1
    memory: 16Gi
    cpu: "4000m"

Then deploy the model:

helm upgrade --install \
  --namespace nrem \
  -f values-mistral.yaml \
  --set image.repository=nvcr.io/nim/nvidia/nv-embedqa-mistral-7b-v2 \
  --set image.tag=1.0.0 \
  nemo-embedder \
  text-embedding-nim-1.0.0.tgz

Running inference

In the previous example the API endpoint is exposed on port 8080 through the Kubernetes service of the default type with no ingress, since authentication is not handled by the NIM itself. The following commands assume the NV-EmbedQA-E5-V5 model was deployed.

Adjust the "model" value in the request JSON body to use a different model.

Use the following command to port-forward the service to your local machine to test inference.

kubectl port-forward -n nrem service/nemo-embedding-ms 8080:8080

Then try a request:

curl -X 'POST' \
  'http://localhost:8080/v1/embeddings' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "input": "hello world",
    "model": "nv-embedqa-e5-v5",
    "input_type": "passage"
  }'

Parameters

Deployment parameters

NameDescriptionValue
affinityAffinity settings for deployment. Allows to constraint pods to nodes.{}
securityContextSpecify privilege and access control settings for Container(Only affects the main container){}
envVarsAdds arbitrary environment variables to the main container - Key Value Pairs{}
extraVolumesAdds arbitrary additional volumes to the deployment set definition{}
image.repositoryNIM-LLM Image Repository""
image.tagImage tag""
image.pullPolicyImage pull policy""
imagePullSecretsSpecify secret names that are needed for the main container and any init containers. Object keys are the names of the secrets{}
nodeSelectorSpecify labels to ensure that NeMo Inference is deployed only on certain nodes (likely best to set this to nvidia.com/gpu.present: "true" depending on cluster setup).{}
podAnnotationsSpecify additional annotation to the main deployment pods{}
podSecurityContextSpecify privilege and access control settings for pod (Only affects the main pod).
podSecurityContext.runAsUserSpecify user UID for pod.1000
podSecurityContext.runAsGroupSpecify group ID for pod.1000
podSecurityContext.fsGroupSpecify file system owner group id.1000
replicaCountSpecify replica count for deployment.1
resourcesSpecify resources limits and requests for the running service.
resources.limits.nvidia.com/gpuSpecify number of GPUs to present to the running service.1
serviceAccount.createSpecifies whether a service account should be created.false
serviceAccount.annotationsSpecifies annotations to be added to the service account.{}
serviceAccount.automountSpecifies whether to automatically mount the service account to the container.{}
serviceAccount.nameSpecify name of the service account to use. If it is not set and create is true, a name is generated using a fullname template.""
tolerationsSpecify tolerations for pod assignment. Allows the scheduler to schedule pods with matching taints.

Autoscaling parameters

Values used for autoscaling. If autoscaling is not enabled, these are ignored. They should be overridden on a per-model basis based on quality-of-service metrics as well as cost metrics. This isn't recommended except with usage of the custom metrics API using something like the prometheus-adapter. Standard metrics of CPU and memory are of limited use in scaling NIM

NameDescriptionValue
autoscaling.enabledEnable horizontal pod autoscaler.false
autoscaling.minReplicasSpecify minimum replicas for autoscaling.1
autoscaling.maxReplicasSpecify maximum replicas for autoscaling.10
autoscaling.metricsArray of metrics for autoscaling.[]

Ingress parameters

NameDescriptionValue
ingress.enabledEnables ingress.false
ingress.classNameSpecify class name for Ingress.""
ingress.annotationsSpecify additional annotations for ingress.{}
ingress.hostsSpecify list of hosts each containing lists of paths.
ingress.hosts[0].hostSpecify name of host.chart-example.local
ingress.hosts[0].paths[0].pathSpecify ingress path./
ingress.hosts[0].paths[0].pathTypeSpecify path type.ImplementationSpecific
ingress.hosts[0].paths[0].serviceTypeSpecify service type. It can be can be nemo or openai -- make sure your model serves the appropriate port(s).openai
ingress.tlsSpecify list of pairs of TLS secretName and hosts.[]

Probe parameters

NameDescriptionValue
livenessProbe.enabledEnable livenessProbetrue
livenessProbe.methodLivenessProbe http or script, but no script is currently providedhttp
livenessProbe.pathLivenessProbe endpoint path/v1/health/live
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe15
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe1
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.successThresholdSuccess threshold for livenessProbe1
livenessProbe.failureThresholdFailure threshold for livenessProbe3
readinessProbe.enabledEnable readinessProbetrue
readinessProbe.pathReadiness Endpoint Path/v1/health/ready
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe15
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe1
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.successThresholdSuccess threshold for readinessProbe1
readinessProbe.failureThresholdFailure threshold for readinessProbe3
startupProbe.enabledEnable startupProbetrue
startupProbe.pathStartupProbe Endpoint Path/v1/health/ready
startupProbe.initialDelaySecondsInitial delay seconds for startupProbe40
startupProbe.timeoutSecondsTimeout seconds for startupProbe1
startupProbe.periodSecondsPeriod seconds for startupProbe10
startupProbe.successThresholdSuccess threshold for startupProbe1
startupProbe.failureThresholdFailure threshold for startupProbe180

Storage parameters

NameDescriptionValue
persistenceSpecify settings to modify the path /model-store if model.legacyCompat is enabled else /.cache volume where the model is served from.
persistence.enabledEnable persistent volumes.false
persistence.existingClaimNameSecify existing claim. If using existingClaim, run only one replica or use a ReadWriteMany storage setup.""
persistence.class Specify persistent volume storage class. If null (the default), no storageClassName spec is set, choosing the default provisioner.""
persistence.retain Specify whether the Persistent Volume should survive when the helm chart is upgraded or deleted.""
persistence.createPV True if you need to have the chart create a PV for hostPath use cases.false
persistence.accessModeSpecify accessModes. If using an NFS or similar setup, you can use ReadWriteMany.ReadWriteOnce
persistence.sizeSpecify size of claim (e.g. 8Gi).50Gi
lhostPathConfigures model cache on local disk on the nodes using hostPath -- for special cases. One should investigate and understand the security implications before using this option.""

Service parameters

NameDescriptionValue
service.typeSpecify service type for the deployment.ClusterIP
service.nameOverride the default service name""
service.http_portSpecify HTTP Port for the service.8080
service.annotationsSpecify additional annotations to be added to service.{}

Monitoring

NameDescriptionValue
zipkinDeployedSpecify if this chart should deploy zipkin for metrics.false
otelDeployedSpecify if this chart should deploy OpenTelemetry for metrics.false
otelEnabledSpecify if this chart should sink metrics to OpenTelemetry.false
otelEnvVarsEnv variables to configure OTEL in the container, sane defaults in chart.{}
logLevelLog Level to set for the container and metrics collection.{}

Opentelemetry configurations can be found here

Support Matrix

Hardware

NVIDIA NIMs will run on any NVIDIA GPU, as long as the GPU has sufficient memory, or on multiple, homogeneous NVIDIA GPUs with sufficient aggregate memory and CUDA compute capability > 7.0 or higher (8.0 for bfloat16). Some model/GPU combinations are optimized. See the following Supported Models section for further information.

Software

  • Linux operating systems (Ubuntu 20.04 or later recommended)
  • Docker >= 23.0.1
  • NVIDIA Driver >= 535

Supported Models

These models are optimized using TRT-LLM and are available as pre-built, optimized engines on NGC.

You are responsible for ensuring that your use of NVIDIA AI Foundation Models complies with all applicable laws.

NV-EmbedQA-Mistral-7b-v2

Load this NIM by adding the following to the helm upgrade command.

--set image.repository=nvcr.io/nim/nvidia/nv-embedqa-mistral-7b-v2 \
--set image.tag=1.0.0 \
Optimized configurations

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model; Profile is for what the model is optimized.

GPUGPU MemoryPrecisionDisk Space
H1007FP814
A10014FP1628
L40S PCIe7FP814
L40S PCIe14FP1628
A10G PCIe14FP1628
Non-optimized configuration

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model.

GPUsGPU MemoryPrecisionDisk Space
Any NVIDIA GPU with sufficient GPU memory or on multiple, homogeneous NVIDIA GPUs with sufficient aggregate memory and compute capability > 7.0 or higher (8.0 for bfloat16)26FP1616

NV-EmbedQA-E5-V5

Load this NIM by adding the following to the helm upgrade command.

--set image.repository=nvcr.io/nim/nvidia/nv-embedqa-e5-v2 \
--set image.tag=1.0.0 \
Optimized configurations

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model; Profile is for what the model is optimized.

GPUGPU MemoryPrecisionDisk Space
A1004FP168
A1004FP168
L40S PCIe4FP168
A10G PCIe4FP168
A10 PCIe4FP168
Non-optimized configuration

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model.

GPUsGPU MemoryPrecisionDisk Space
Any NVIDIA GPU with sufficient GPU memory or on multiple, homogeneous NVIDIA GPUs with sufficient aggregate memory and compute capability > 7.0 or higher (8.0 for bfloat16)26FP1616

Snowflake Arctic

Load this NIM by adding the following to the helm upgrade command.

--set image.repository=nvcr.io/nim/nvidia/arctic-embed-l \
--set image.tag=1.0.0 \
Optimized configurations

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model; Profile is for what the model is optimized.

GPUGPU MemoryPrecisionDisk Space
H1004FP164
A1004FP168
L4 PCIe4FP168
L40S PCIe4FP168
A10G PCIe4FP168
A10 PCIe4FP168
Non-optimized configuration

The GPU Memory and Disk Space values are in GB; Disk Space is for both the container and the model.

GPUsGPU MemoryPrecisionDisk Space
Any NVIDIA GPU with sufficient GPU memory or on multiple, homogeneous NVIDIA GPUs with sufficient aggregate memory and compute capability > 7.0 or higher (8.0 for bfloat16)26FP1616
Publisher
NVIDIA
NVIDIA
Latest Version1.0.0
UpdatedDecember 17, 2024 UTC
Compressed Size371.87 KB