NVIDIA NIM Provider Guide
Hundreds of optimised AI models on NVIDIA's GPU-accelerated inference platform — or your own self-hosted NIM deployment
Overview
NVIDIA NIM (NVIDIA Inference Microservices) is a managed inference platform that hosts a large catalog of open-weight models — Meta Llama, DeepSeek, Mistral, Microsoft Phi, Google Gemma, and more — all GPU-optimised and served through an OpenAI-compatible API. You can also point NeuroLink at a self-hosted NIM cluster by overriding the base URL.
Key Facts
- Hosted base URL:
https://integrate.api.nvidia.com/v1 - Protocol: OpenAI-compatible (
/v1/chat/completions) - Vision: Yes, on supported models (Llama 3.2 Vision, etc.)
- Reasoning: Yes, model-dependent. The default
openai/gpt-oss-20bis a reasoning model and returns its reasoning trace on every request; see Reasoning andthinkingLevelfor what NeuroLink'sthinkingLeveldoes on NIM - Streaming: Supported
- Tool calling: Supported on most models
- Self-hosting: Override
NVIDIA_NIM_BASE_URLto point at a private NIM cluster
NIM-Specific Extras
NIM supports additional generation parameters beyond the standard OpenAI surface: top_k, min_p, repetition_penalty, min_tokens, and per-model chat_template overrides. The NeuroLink provider automatically passes these via the providerOptions.openai.body mechanism. If a model rejects an unsupported parameter with HTTP 400, the provider retries the request with that parameter stripped.
Quick Start
1. Get an API Key
Sign up at https://build.nvidia.com and create an API key under API Keys.
2. Configure Environment
Add to your .env file:
# Required
NVIDIA_NIM_API_KEY=nvapi-...
# Optional: override the default model (default: openai/gpt-oss-20b)
NVIDIA_NIM_MODEL=openai/gpt-oss-20b
# Optional: self-hosted NIM base URL (default: https://integrate.api.nvidia.com/v1)
NVIDIA_NIM_BASE_URL=https://integrate.api.nvidia.com/v1
# Optional: NIM-specific generation parameters
NVIDIA_NIM_TOP_K=40
NVIDIA_NIM_MIN_P=0.05
NVIDIA_NIM_REPETITION_PENALTY=1.1
NVIDIA_NIM_MIN_TOKENS=1
NVIDIA_NIM_CHAT_TEMPLATE=
3. Install NeuroLink
npm install @juspay/neurolink
# or
pnpm add @juspay/neurolink
4. Generate Your First Response
import { NeuroLink } from "@juspay/neurolink";
const ai = new NeuroLink();
const result = await ai.generate({
provider: "nvidia-nim",
input: { text: "Explain gradient descent in simple terms." },
});
console.log(result.content);
Supported Models
NIM hosts hundreds of models. NeuroLink ships with these popular models pre-enumerated:
OpenAI gpt-oss (default)
| Model ID | Context | Vision | Reasoning |
|---|---|---|---|
openai/gpt-oss-20b | 128K | No | Yes |
openai/gpt-oss-20b always reasons: the trace comes back as reasoning_content whether or not you pass a thinking option, and it counts against maxTokens. See Reasoning and thinkingLevel.
Meta Llama
| Model ID | Context | Vision | Reasoning |
|---|---|---|---|
meta/llama-3.3-70b-instruct | 128K | No | No |
meta/llama-3.1-405b-instruct | 128K | No | No |
meta/llama-3.1-70b-instruct | 128K | No | No |
meta/llama-3.2-90b-vision-instruct | 128K | Yes | No |
meta/llama-3.2-11b-vision-instruct | 128K | Yes | No |
NVIDIA Nemotron (Reasoning)
| Model ID | Context | Vision | Reasoning |
|---|---|---|---|
nvidia/llama-3.3-nemotron-super-49b-v1 | 128K | No | Yes |
nvidia/llama-3.1-nemotron-nano-8b-v1 | 128K | No | Yes |
nvidia/llama-3.1-nemotron-70b-instruct | 128K | No | Yes |
DeepSeek (Hosted on NIM)
| Model ID | Context | Vision | Reasoning |
|---|---|---|---|
deepseek-ai/deepseek-r1 | 128K | No | Yes |
deepseek-ai/deepseek-r1-distill-llama-70b | 128K | No | Yes |
Other Models
| Model ID | Context | Notes |
|---|---|---|
mistralai/mixtral-8x22b-instruct-v0.1 | 64K | Large MoE |
mistralai/mixtral-8x7b-instruct-v0.1 | 32K | Efficient MoE |
microsoft/phi-4 | 16K | Compact, capable |
google/gemma-3-27b-it | 128K | Google Gemma |
Availability, checked 2026-10-24. NVIDIA's
GET https://integrate.api.nvidia.com/v1/modelslistsopenai/gpt-oss-20b,meta/llama-3.2-90b-vision-instruct,meta/llama-3.2-11b-vision-instructandnvidia/llama-3.1-nemotron-70b-instructfrom the tables above, and none of the others. A chat request tometa/llama-3.3-70b-instructormeta/llama-3.1-70b-instructanswers HTTP 410, "has reached its end of life on 2026-08-26T09:00:00Z and is no longer available";nvidia/llama-3.3-nemotron-super-49b-v1andmistralai/mixtral-8x22b-instruct-v0.1also answer 410, anddeepseek-ai/deepseek-r1andmeta/llama-3.1-405b-instructanswer 404.nvidia/llama-3.1-nemotron-70b-instructis listed but answered 404 ("not found for account") to the key used for the check.openai/gpt-oss-20bandmeta/llama-3.2-11b-vision-instructeach answered a plain request and a tool-calling request. TheNvidiaNimModelsenum keeps the retired members so existing code compiles.
Browse the full catalog at https://build.nvidia.com/models. You can pass any model ID via --model or model: — NIM returns 404 for IDs that are not in the catalog.
SDK Usage
Basic Generation
import { NeuroLink } from "@juspay/neurolink";
const ai = new NeuroLink();
const result = await ai.generate({
provider: "nvidia-nim",
input: { text: "Write a TypeScript utility to deep-clone a plain object." },
});
console.log(result.content);
Using a Specific Model
const result = await ai.generate({
provider: "nvidia-nim",
model: "mistralai/mixtral-8x22b-instruct-v0.1",
input: { text: "Summarise the key ideas in the CAP theorem." },
});
Reasoning and thinkingLevel
Two separate questions decide what you get:
- Does the model reason? That is a property of the model.
openai/gpt-oss-20b, the default, reasons on every request: NIM returns the trace asreasoning_contentand NeuroLink exposes it asresult.reasoning(and as reasoning chunks when streaming). No option is needed to turn it on. - Can NeuroLink switch it on or tune it? That is a property of the provider code, and on NIM it is narrower than the
thinkingLeveltype suggests:thinkingLevelis honoured onstream()only. Any level other thanminimaladdschat_template_kwargs: { thinking: true, enable_thinking: true, reasoning_budget: <maxTokens> }to the request.generate()does not forward it: the request body carries nochat_template_kwargs.- The three active levels are not distinguished.
low,mediumandhighsend the same flags, sothinkingLevelis an on/off switch here, withminimalmeaning off. - NeuroLink never sends
reasoning_effortto NIM, so that knob is not available through it. - An HTTP 400 that names
reasoning_budgetorchat_templategets one automatic retry without that field. A 400 about the other thinking flags (thinking,enable_thinking) is not retried and is returned to you.
// The trace is there without any thinking option.
const result = await ai.generate({
provider: "nvidia-nim",
model: "openai/gpt-oss-20b",
input: { text: "What is 17 * 23? Answer with just the number." },
maxTokens: 512,
});
console.log(result.reasoning); // the model's reasoning trace
console.log(result.content); // the answer
Reasoning tokens count toward maxTokens. With a small budget the model can spend all of it reasoning and stop with finish_reason: "length" and an empty content. On openai/gpt-oss-20b, maxTokens: 16 returned an empty answer for a one-word reply, while 64 and 256 returned it. Leave a few hundred tokens of headroom for short answers, more for hard prompts.
Streaming
import { NeuroLink } from "@juspay/neurolink";
const ai = new NeuroLink();
const stream = await ai.stream({
provider: "nvidia-nim",
model: "openai/gpt-oss-20b",
input: {
text: "Walk me through building a REST API with Hono and TypeScript.",
},
});
for await (const chunk of stream.stream) {
process.stdout.write(chunk);
}
Per-Call Credential Override
const result = await ai.generate({
provider: "nvidia-nim",
input: { text: "Hello" },
credentials: {
nvidiaNim: {
apiKey: "nvapi-per-user-key",
},
},
});
For self-hosted NIM clusters, override the base URL per call:
const result = await ai.generate({
provider: "nvidia-nim",
input: { text: "Hello from self-hosted NIM" },
credentials: {
nvidiaNim: {
apiKey: "internal-token",
baseURL: "https://nim.internal.example.com/v1",
},
},
});
CLI Usage
Basic Commands
# Generate with the default model
pnpm run cli generate "What is the transformer architecture?" --provider nvidia-nim
# Use provider aliases
pnpm run cli generate "Hello" --provider nim
pnpm run cli generate "Hello" --provider nvidia
# Specify a model
pnpm run cli generate "Explain reinforcement learning" \
--provider nvidia-nim \
--model mistralai/mixtral-8x22b-instruct-v0.1
# Reasoning model with thinking enabled
pnpm run cli generate "Solve: what is 17! mod 13?" \
--provider nvidia-nim \
--model deepseek-ai/deepseek-r1 \
--thinking-level high
# Interactive loop
pnpm run cli loop --provider nvidia-nim
Provider Aliases
| Alias | Example |
|---|---|
nvidia-nim | --provider nvidia-nim |
nvidia | --provider nvidia |
nim | --provider nim |
Configuration Reference
| Environment Variable | Required | Default | Description |
|---|---|---|---|
NVIDIA_NIM_API_KEY | Yes | — | NVIDIA NIM API key (starts with nvapi-) |
NVIDIA_NIM_MODEL | No | openai/gpt-oss-20b | Default model |
NVIDIA_NIM_BASE_URL | No | https://integrate.api.nvidia.com/v1 | Base URL (override for self-hosted NIM) |
NVIDIA_NIM_TOP_K | No | — | Top-K sampling; -1 to disable |
NVIDIA_NIM_MIN_P | No | — | Minimum token probability; 0 to disable |
NVIDIA_NIM_REPETITION_PENALTY | No | — | Anti-repetition factor; 1 is neutral |
NVIDIA_NIM_MIN_TOKENS | No | — | Minimum output length in tokens |
NVIDIA_NIM_CHAT_TEMPLATE | No | — | Override the model's default chat template |
Self-Hosted NIM
If you run NIM on your own GPU cluster, set NVIDIA_NIM_BASE_URL to point at your cluster. Authentication is still forwarded via Authorization: Bearer, so set NVIDIA_NIM_API_KEY to any non-empty value if your cluster does not require it (or to your actual cluster token if it does).
NVIDIA_NIM_API_KEY=internal-token
NVIDIA_NIM_BASE_URL=https://nim.cluster.example.com/v1
Feature Support
| Feature | Supported | Notes |
|---|---|---|
| Text generation | Yes | |
| Streaming | Yes | |
| Tool calling | Yes | Most models; depends on model support |
| Vision / images | Yes | Model-dependent (Llama 3.2 Vision, etc.) |
| Reasoning trace | Yes | Model-dependent; openai/gpt-oss-20b always returns one. thinkingLevel is an on/off switch on stream() only |
| Embeddings | No | Use OpenAI or Bedrock for embeddings |
Troubleshooting
"Invalid NVIDIA NIM API key"
The NVIDIA_NIM_API_KEY is missing, expired, or incorrect.
echo $NVIDIA_NIM_API_KEY
export NVIDIA_NIM_API_KEY=nvapi-...
Get or rotate keys at https://build.nvidia.com/settings/api-keys.
"NVIDIA NIM rate limit exceeded"
Your account has hit its request-per-minute or token-per-day limit. Upgrade your account, reduce request frequency, or implement backoff. Check your current usage at https://build.nvidia.com/usage.
"NVIDIA NIM model not available"
The model ID is not in the NIM catalog, or your account tier does not have access.
# Browse the catalog
open https://build.nvidia.com/models
Use the exact model ID shown on the model's page (e.g., openai/gpt-oss-20b).
HTTP 410 "has reached its end of life"
The request named a model NVIDIA has retired, for example meta/llama-3.1-70b-instruct or meta/llama-3.3-70b-instruct (retired 2026-08-26). If you did not pass model:, look for a stale NVIDIA_NIM_MODEL in your .env or shell: it takes precedence over the built-in default (openai/gpt-oss-20b). Remove it or set it to a model from the current catalog.
"NVIDIA NIM quota exceeded"
Account-level token or compute quota reached. Check your NIM dashboard.
HTTP 400 with reasoning_budget or chat_template in the error
The model does not support one of the NIM-specific extras. The provider automatically retries without the rejected parameter. If you see this error surfaced, it means the second attempt also failed — check the rest of the error message for the root cause.
Empty content with finish_reason: "length"
A reasoning model spent the whole maxTokens budget on its reasoning before it started the answer. The reasoning is in result.reasoning; raise maxTokens (a few hundred tokens is enough for a short answer on openai/gpt-oss-20b).
Thinking level has no visible effect
- On
generate(),thinkingLevelis not forwarded to NIM at all; usestream(). - On
stream(), any level exceptminimalsends the same thinking flags, solow,mediumandhighbehave alike. - A model that already reasons on every request, such as
openai/gpt-oss-20b, returns its trace with or without the flags. - If the model rejects
reasoning_budgetwith a 400 that names it, the provider retries once without it. A rejection ofthinkingorenable_thinkingis not retried and comes back as the 400.
See Also
- Implementation spec — internal wire-format details and NIM-specific extras
- DeepSeek provider — if you only need DeepSeek-R1 via the official DeepSeek API
- OpenAI Compatible provider — generic provider for any OpenAI-compatible endpoint
Need Help? Join the GitHub Discussions or open an issue.