LLM service implementation using NVIDIA’s NIM (NVIDIA Inference Microservice) API with OpenAI-compatible interface
NimLLMService
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, with special handling for NVIDIA’s incremental token reporting.
Complete API documentation and method details
Official NVIDIA NIM documentation and setup
Working example with function calling
To use NVIDIA NIM services, install the required dependencies:
You’ll also need to set up your NVIDIA API key as an environment variable: NVIDIA_API_KEY
.
Get your API key from NVIDIA Build.
OpenAILLMContextFrame
- Conversation context and historyLLMMessagesFrame
- Direct message listVisionImageRawFrame
- Images for vision processingLLMUpdateSettingsFrame
- Runtime parameter updatesLLMFullResponseStartFrame
/ LLMFullResponseEndFrame
- Response boundariesLLMTextFrame
- Streamed completion chunksFunctionCallInProgressFrame
/ FunctionCallResultFrame
- Function call lifecycleErrorFrame
- API or processing errorsLearn how to implement function calling with standardized schemas, register handlers, manage context properly, and control execution flow in your conversational AI applications.
Learn how to manage conversation context, handle message history, and integrate context aggregators for consistent conversational experiences.
Includes specialized token usage tracking for NIM’s incremental reporting:
Enable with:
LLM service implementation using NVIDIA’s NIM (NVIDIA Inference Microservice) API with OpenAI-compatible interface
NimLLMService
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, with special handling for NVIDIA’s incremental token reporting.
Complete API documentation and method details
Official NVIDIA NIM documentation and setup
Working example with function calling
To use NVIDIA NIM services, install the required dependencies:
You’ll also need to set up your NVIDIA API key as an environment variable: NVIDIA_API_KEY
.
Get your API key from NVIDIA Build.
OpenAILLMContextFrame
- Conversation context and historyLLMMessagesFrame
- Direct message listVisionImageRawFrame
- Images for vision processingLLMUpdateSettingsFrame
- Runtime parameter updatesLLMFullResponseStartFrame
/ LLMFullResponseEndFrame
- Response boundariesLLMTextFrame
- Streamed completion chunksFunctionCallInProgressFrame
/ FunctionCallResultFrame
- Function call lifecycleErrorFrame
- API or processing errorsLearn how to implement function calling with standardized schemas, register handlers, manage context properly, and control execution flow in your conversational AI applications.
Learn how to manage conversation context, handle message history, and integrate context aggregators for consistent conversational experiences.
Includes specialized token usage tracking for NIM’s incremental reporting:
Enable with: