NVIDIA NIM Provider
Run Nemotron 3 and other NIM models from the TypeScript SDK with just NVIDIA_API_KEY
Point an agent at NVIDIA NIM with one llm string and one API key.
Quick Start
- Simple Usage
bash export NVIDIA_API_KEY=nvapi-...typescript import { Agent } from 'praisonai'; const agent = new Agent({ instructions: 'Be brief.', llm: 'nvidia/nemotron-super', }); await agent.chat('Hello in one sentence.'); - With Per-Agent Credentials
typescript import { Agent } from 'praisonai'; const agent = new Agent({ instructions: 'Be brief.', llm: 'nvidia/nemotron-super', apiKey: process.env.MY_NVIDIA_KEY, baseURL: 'https://integrate.api.nvidia.com/v1', });
Model Names
NIM model ids always carry their publisher; short aliases map to the catalog slug, and a bare name under the nvidia prefix gets nvidia/ reattached. nvidia/, nim/ and nvidia-nim/ all select the same provider.
| You write | Sent on the wire |
|---|---|
nvidia/nemotron-super | nvidia/nemotron-3-super-120b-a12b |
nvidia/nemotron-nano | nvidia/nemotron-nano-3-30b-a3b |
nvidia/nemotron-ultra | nvidia/nemotron-3-ultra-550b-a55b |
nvidia/nemotron-3-super-120b-a12b | nvidia/nemotron-3-super-120b-a12b |
nvidia/meta/llama-3.3-70b-instruct | meta/llama-3.3-70b-instruct |
nim/nemotron-super | nvidia/nemotron-3-super-120b-a12b |
nvidia-nim/nvidia/nemotron-3-super-120b-a12b | nvidia/nemotron-3-super-120b-a12b |
Environment Variables
# Hosted (build.nvidia.com)
export NVIDIA_API_KEY=nvapi-...
# Optional overrides
export NVIDIA_NIM_API_KEY=nvapi-... # takes precedence over NVIDIA_API_KEY
export NVIDIA_NIM_API_BASE=http://localhost:8000/v1 # any OpenAI-compatible NIM endpoint- Key order: explicit
apiKey→NVIDIA_NIM_API_KEY→NVIDIA_API_KEY.OPENAI_API_KEYis never used. - Base-URL order: explicit
baseURL→NVIDIA_NIM_API_BASE→https://integrate.api.nvidia.com/v1.
Reasoning Mode (Nemotron 3)
Nemotron 3 on NIM switches thinking through chat_template_kwargs, and the SDK translates reasoningEffort for you.
import { Agent } from 'praisonai';
const agent = new Agent({
instructions: 'Be brief.',
llm: 'nvidia/nemotron-super',
reasoningEffort: 'off', // or 'minimal' | 'low' | 'medium' | 'high'
});reasoningEffort | Sent to NIM |
|---|---|
"off" | chat_template_kwargs: { enable_thinking: false } |
"minimal" or "low" | chat_template_kwargs: { enable_thinking: true, low_effort: true } |
"medium" or "high" | chat_template_kwargs: { enable_thinking: true } |
| unset | nothing — server default (thinking on) |
This mapping only applies to Nemotron 3 (and nemotron-nano-3) via the NIM route. Nemotron served by other providers, and non-Nemotron models on NIM, use the standard reasoning_effort path.
Local NIM Container
Point baseURL at your own NIM container; no key is needed.
import { Agent } from 'praisonai';
const agent = new Agent({
instructions: 'Be brief.',
llm: 'nvidia/nemotron-super',
baseURL: 'http://localhost:8000/v1',
});Any baseURL outside integrate.api.nvidia.com is treated as a local or self-hosted NIM, and the SDK sends a placeholder key if none is set. Set NVIDIA_NIM_API_BASE to the same URL to make it the default.
Tools and Streaming
Tools
import { Agent } from 'praisonai';
const getWeather = (city: string) => `Weather in ${city}: 20C, sunny`;
const agent = new Agent({
instructions: 'Report the weather using the tool.',
llm: 'nvidia/nemotron-super',
reasoningEffort: 'off',
tools: [getWeather],
});
await agent.start('Weather in Paris?');Streaming
import { Agent } from 'praisonai';
const agent = new Agent({
instructions: 'You tell stories.',
llm: 'nvidia/nemotron-super',
reasoningEffort: 'off',
});
for await (const token of agent.stream('Tell me a short story about a robot')) {
process.stdout.write(token);
}