Skip to main content

LlamaIndex Embeddings Integration: NVIDIA NIM Microservices

The llama-index-embeddings-nvidia package contains LlamaIndex integrations for building applications with NVIDIA NIM microservices. With the NVIDIA embeddings connector, you can connect to, and generate content from, compatible models.

NVIDIA NIM supports models across domains like chat, embedding, and re-ranking, from the community as well as from NVIDIA. Each model is optimized by NVIDIA to deliver the best performance on NVIDIA-accelerated infrastructure and is packaged as a NIM, an easy-to-use, prebuilt container that deploys anywhere using a single command on NVIDIA accelerated infrastructure. At their core, NIM microservices are containers that provide interactive APIs for running inference on an AI Model.

NVIDIA-hosted deployments are available on the NVIDIA API catalog to test each NIM. After you explore, you can download NIM microservices from the API catalog, which is included with the NVIDIA AI Enterprise license. The ability to run models on-premises or in your own cloud gives your enterprise ownership of your customizations and full control of your IP and AI application.

Use this documentation to learn how to install the llama-index-embeddings-nvidia package and use it to connect to a model. The following example connects to the NVIDIA Retrieval QA E5 Embedding Model.

Install the Package

To install the llama-index-embeddings-nvidia package, run the following code.

pip install llama-index-embeddings-nvidia

Access the NVIDIA API Catalog

To get access to the NVIDIA API Catalog, do the following:

  1. Create a free account on the NVIDIA API Catalog and log in.

  2. Click your profile icon, and then click API Keys. The API Keys page appears.

  3. Click Generate API Key. The Generate API Key window appears.

  4. Click Generate Key. You should see API Key Granted, and your key appears.

  5. Copy and save the key as NVIDIA_API_KEY.

  6. To verify your key, use the following code.

    import getpass
    import os
    
    if os.environ.get("NVIDIA_API_KEY", "").startswith("nvapi-"):
        print("Valid NVIDIA_API_KEY already in environment. Delete to reset")
    else:
        nvapi_key = getpass.getpass("NVAPI Key (starts with nvapi-): ")
        assert nvapi_key.startswith(
            "nvapi-"
        ), f"{nvapi_key[:5]}... is not a valid key"
        os.environ["NVIDIA_API_KEY"] = nvapi_key
    

You can now use your key to access endpoints on the NVIDIA API Catalog.

Work with the API Catalog

To submit a query to the nv-embedqa-e5-v5 model, run the following code.

from llama_index.embeddings.nvidia import NVIDIAEmbedding

embedder = NVIDIAEmbedding(model="nv-embedqa-e5-v5")
embedder.get_query_embedding("What's the weather like in Komchatka?")

Self-host with NVIDIA NIM Microservices

When you are ready to deploy your AI application, you can self-host models with NVIDIA NIM. For more information, refer to NVIDIA AI Enterprise.

The following example code connects to a locally-hosted NIM Microservice.

from llama_index.embeddings.nvidia import NVIDIAEmbedding

# connect to an embedding NIM running at localhost:8080
embedder = NVIDIAEmbeddings(base_url="http://localhost:8080/v1")

Metadata

Release files for llama-index-embeddings-nvidia 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-embeddings-nvidia 0.7.0
File Size Uploaded Provenance Actions
llama_index_embeddings_nvidia-0.7.0.tar.gz 8.4 kB Without provenance Details for llama_index_embeddings_nvidia-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-embeddings-nvidia 0.7.0
File Interpreter ABI Platform Actions
llama_index_embeddings_nvidia-0.7.0-py3-none-any.whl Python 3 none any Details for llama_index_embeddings_nvidia-0.7.0-py3-none-any.whl

Total release size: 16.8 kB

Release files / llama_index_embeddings_nvidia-0.7.0.tar.gz

Download URL llama_index_embeddings_nvidia-0.7.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fb3e1c8ad3443e2680afb51662e3f81af50f73ad548f5bb1ce01860efd4f542a
BLAKE2b-256 checksum
How to use checksums
61d81efe899e8ce932f2f3186e09ac9cbd311472e3959665852b2fdb57cb47ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_embeddings_nvidia-0.7.0-py3-none-any.whl

Download URL llama_index_embeddings_nvidia-0.7.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4993aa16bbe6372759a1e849171fd53fe4fe553236375216b107566da79a79b
BLAKE2b-256 checksum
How to use checksums
4a120eb8298e4310d55ba36f2140c76d3306ed1663bb4dbdaa911750c647d5c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-embeddings-nvidia 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page