Overview
NvidiaLLMService provides access to NVIDIA’s NIM language models through an OpenAI-compatible interface. It inherits from OpenAILLMService and supports streaming responses, function calling, and context management.
NVIDIA NIM LLM API Reference
Pipecat’s API methods for NVIDIA NIM integration
Example Implementation
Complete example with function calling
NVIDIA NIM Documentation
Official NVIDIA NIM documentation and setup
NVIDIA Developer Portal
Access NIM services and manage API keys
Installation
To use NVIDIA NIM services, install the required dependencies:Prerequisites
NVIDIA NIM Setup
Before using NVIDIA NIM LLM services, you need:- NVIDIA Developer Account (cloud endpoint only): Sign up at NVIDIA Developer Portal
- API Key (cloud endpoint only): Generate an NVIDIA API key for NIM cloud services
- Model Selection: Choose from available NIM-hosted models
- Local NIM Setup (optional): For local deployments, configure NIM on-premises and set the
base_urlto your local endpoint
Environment Variables
NVIDIA_API_KEY: Your NVIDIA API key for authentication (required for the cloud endpoint)
Configuration
str | None
default:"None"
NVIDIA API key for authentication. Required when using the cloud endpoint
(
https://integrate.api.nvidia.com/v1). Can be omitted for a local NIM
deployment that doesn’t check keys.str
default:"https://integrate.api.nvidia.com/v1"
Base URL for NIM API endpoint. Defaults to NVIDIA’s cloud endpoint. For local
deployments, pass the local address (e.g.,
http://localhost:8000/v1).str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use
settings=NvidiaLLMService.Settings(model=...) instead.default_headers, service_tier,
retry_on_timeout, and retry_timeout_secs, as described for
OpenAILLMService.
Settings
Runtime-configurable settings passed via thesettings constructor argument using NvidiaLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details.
This service uses the same settings as OpenAILLMService. See OpenAI LLM Settings for the full parameter reference.
The default model is "nvidia/nemotron-3-super-120b-a12b".
Usage
Basic Setup
With Custom Settings
Notes
- Token reporting: Token usage is reported once per completion at the end of each request.
-
Cloud vs. local deployment: NIM supports both cloud-hosted and on-premises deployments. For on-premises, override the
base_urlto point to your local NIM endpoint. -
Reasoning content: The service automatically detects and filters reasoning content from model responses, emitting it as
LLMThought*Frameobjects. This applies to:- Models with API-level reasoning separation (e.g., Nemotron Nano models) that include a
reasoning_contentorreasoningfield - Models that begin their response with a
<think>...</think>block (e.g., DeepSeek-R1, some Nemotron models)
- Models with API-level reasoning separation (e.g., Nemotron Nano models) that include a