NVIDIA NIM Agent for VS Code
NVIDIA provides free API on build.nvidia.com. You can run DeepSeek V4, Nemotron, and GLM directly inside Copilot without any monthly provider subscription.
Why NVIDIA NIM Agent?
The extension routes Copilot Chat to NVIDIA NIM models with automatic failover, reasoning controls, agent-mode tool support, and a status bar that shows live token use.
Key Features
Reasoning controls. Collapsible thinking blocks via VS Code's LanguageModelThinkingPart, plus per-turn effort control from None to Max in the Copilot model dropdown.
Failover. When the active model returns 429, 404, 410, an empty stream, or a timeout, the same prompt is rerouted to a backup. A configurable fallback.priorityList is tried first; text requests fall back to Nemotron 3.5 Lightning and image requests to Muse Glimmer by default. The next turn retries the original model, unless NVIDIA has retired it (HTTP 410): a retired model is skipped and hidden from the picker for the rest of the session.
Repetition guard. Detects degenerate "Let me fix..." output loops mid-stream and ends the turn cleanly instead of spinning forever.
Tool calls. A single streaming tag-stack XML scanner handles OpenAI JSON, XML control blocks, and Hermes/Anthropic-style tags. Malformed arguments are auto-repaired through jsonrepair, and a call repeated with identical arguments more than tools.maxConsecutiveIdenticalCalls times in one task (default 4) is dropped as a loop.
Context auto-compaction. Long sessions get compacted in the background by a dedicated model so you don't hit HTTP 400 Context Window Exceeded.
Status bar & diagnostics. Token utilization in the status bar, prompt/completion counts in Copilot's context window widget, and millisecond TTFT logs when debug logging is on.
Supported Models
The extension connects to official NVIDIA NIM endpoints (https://integrate.api.nvidia.com/v1) and ships per-model adapters.
| Model |
Intelligence Index |
Context Window |
Reasoning Modes |
Tools |
Vision |
Notes |
| DeepSeek V4.1 Flash |
33 |
1M |
None, Low, High, Max |
Yes |
Yes |
Fast multimodal reasoning, agentic coding, architecture |
| MiniMax M3.1 Flash |
29 |
262K |
Low to Max |
Yes |
Yes |
Fast multimodal MoE for agentic coding and visual input |
| Step 5 Preview |
29 |
1M |
Always on |
Yes |
Yes |
StepFun preview; reasoning cannot be turned off |
| GLM 5.3 Flash |
28 |
1M |
Low, High, Max |
Yes |
Yes |
Fast multimodal reasoning, code generation, instant response in Low |
| Mistral Large 4 |
26 |
1M |
Low, Medium, High |
Yes |
Yes |
Large multimodal MoE for agentic coding and document analysis |
| Nemotron 3.5 Super VL |
14 |
1M |
None, Low, High |
Yes |
Yes |
Coding, tools, and image input in one model |
| Nemotron 3 Ultra |
12 |
1M |
None, Medium, High |
Yes |
No |
Heavy multi-step reasoning, technical docs |
| Muse Glimmer |
6 |
131K |
None to Max |
Yes |
Yes |
Visual UX/UI work; default vision fallback |
| Nemotron 3.5 Lightning |
6 |
1M |
None, Medium, High, XHigh |
Yes |
No |
Fast agentic turns; default text fallback and summarizer |
Intelligence Index values are from the Artificial Analysis Intelligence Index v5.0.1 (checked 2026-11-07).
Reasoning is on by default: High, or Medium on Nemotron 3.5 Lightning. Step 5 Preview always reasons and has no Reasoning Mode. Change it per model with Reasoning Mode in the model picker, or for all models with nvidia-nim.reasoning.mode. Copilot agent sessions offer the reasoning level as well; Context Size is available in local chat sessions only.
Documentation & Settings
The full settings.json reference, failover policies, network parameters, and agentic tool configuration live in the dedicated guide:
Full Documentation & Configuration Guide (docs/README.md)
Quick Start
1. Install
2. Requirements
- VS Code
1.125.0 or later
- GitHub Copilot, installed and signed in
- An NVIDIA NIM API key (free credits at build.nvidia.com)
- Open Copilot Chat (
Ctrl + Alt + I / Cmd + Alt + I).
- Click the model selector dropdown, then Manage Models, then NVIDIA NIM.
- Paste your key (
nvapi-...).
Alternatively, run NVIDIA NIM: Manage NVIDIA NIM API Key from the Command Palette.
4. Start Chatting
Pick any NVIDIA NIM model in Copilot Chat or Copilot Agent Mode.
5. Copilot Agent Sessions and the Agents Window
NVIDIA NIM models also work in chat sessions run by the Copilot harness (VS Code's agent host), both in the regular chat view and in the separate Agents window (VS Code 1.145 or later). These sessions differ from Local ones; see Copilot vs Local Chat Sessions.
The agent host offers extension models only when BYOK models are enabled. VS Code 1.145 turns this on by default. On older builds:
- Open
settings.json (Preferences: Open User Settings (JSON) in Command Palette).
- Add:
"chat.agentHost.byokModels.enabled": true
If NVIDIA NIM models are missing from the model picker in the Agents window, allow the extension there in settings.json:
"extensions.supportAgentsWindow": {
"neuraldock.nvidia-nim-agent": true
}
Recommended settings for heavy agent sessions:
- Recommended Models:
z-ai/glm-5.3-flash for multi-step reasoning and deep codebase context.
- TTFT Timeout: Set
"nvidia-nim.fallback.firstTokenTimeoutSeconds": 120 (or 180) to allow NVIDIA NIM time for KV-cache prefill on large prompts with multiple MCP tools.
- Idle Watchdog:
"nvidia-nim.network.streamIdleTimeout": 120 (or 180) ensures stalled streams are cleanly aborted and failed over.
- Failover Restarts:
"nvidia-nim.fallback.maxChainRestarts": 2 automatically retries the model chain with backoff if upstream endpoints hit transient 503/529 overload.
Extension Commands
Open the Command Palette (Ctrl + Shift + P / Cmd + Shift + P).
| Command |
Identifier |
Description |
| Manage API Key |
nvidia-nim.manage |
Store or update your NVIDIA NIM API key in OS SecretStorage. |
| Refresh Models |
nvidia-nim.refreshModels |
Re-sync the available model list and invalidate the local cache. |
| Toggle Debug Logging |
nvidia-nim.toggleDebugLogging |
Toggle verbose diagnostic logs. |
| Open Debug Log |
nvidia-nim.openDebugLog |
Open the NVIDIA NIM Output channel. |
Privacy & Security
All requests go directly from your VS Code client to the official NVIDIA NIM API at https://integrate.api.nvidia.com/v1. There are no third-party telemetry endpoints or proxy gateways. The API key is encrypted in VS Code's OS-level SecretStorage. The extension stores no chat logs, file contents, or personal credentials.
Frequently Asked Questions
Q: Do I need a paid NVIDIA subscription?
A: No. NVIDIA provides free API on build.nvidia.com for developers.
Q: Does it work with Copilot Agent Mode and Tools?
A: Yes. The supported chat models are tool-capable and support autonomous file editing, terminal execution, and MCP tools with automatic JSON repair.
Q: How do I check if NVIDIA NIM is busy or down?
A: While unofficial, try this page: https://nimstats.aathil.com/
Development
Prerequisites
Install dependencies
npm install
Build the extension
npm run compile # produces the compiled output in ./out
Run the test suite
npm test # runs Jest; all tests should pass
Create a VSIX package (for local installation)
npm run package:vsix # compiles then packages the extension
The resulting .vsix file can be installed via Extensions → Install from VSIX… in VS Code.
Support
This extension is maintained on a best-effort basis. Fixes for retired or changed NVIDIA NIM models still land, but replies to issues can take a while. Bug reports with the turn report file attached get priority: run NVIDIA NIM: Save Last Turn Report right after the failing turn and drag and drop the saved file into the issue. Reports without it are closed automatically.
If this extension saves you time and makes working with NVIDIA NIM in Copilot Chat smoother, you can support its maintenance on Ko-fi.
License
MIT