Skip to main content

llama-index llms nvidia api catalog integration

Project description

NVIDIA's LLM connector

Install the connector,

pip install llama-index-llms-nvidia

With this connector, you'll be able to connect to and generate from compatible models available as hosted NVIDIA NIMs, such as:

First, get a free API key. Go to https://build.nvidia.com, select a model, click "Get API Key". Store this key in your environment as NVIDIA_API_KEY.

Then, try it out.

from llama_index.llms.nvidia import NVIDIA
from llama_index.core.llms import ChatMessage, MessageRole

llm = NVIDIA()

messages = [
    ChatMessage(
        role=MessageRole.SYSTEM, content=("You are a helpful assistant.")
    ),
    ChatMessage(
        role=MessageRole.USER,
        content=("What are the most popular house pets in North America?"),
    ),
]

llm.chat(messages)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_nvidia-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

llama_index_llms_nvidia-0.1.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page