Skip to content

bisug/nvidia-nim-provider

 
 

Repository files navigation

NVIDIA NIM Provider

A lightweight VS Code extension that connects NVIDIA NIM models to GitHub Copilot Chat, so you can use NVIDIA-hosted LLMs (including DeepSeek, Llama, Qwen, Nemotron, and more) directly from the Copilot Chat model picker.

Features

  • Live model discovery — Models are fetched dynamically from the NVIDIA NIM /models endpoint, so you always get the latest available models with no hardcoded catalog.
  • Agent mode tool calling — Repairs and retries malformed tool-call arguments, and recovers from invalid tool calls with corrective guidance instead of surfacing raw control tokens.
  • Reasoning-model support — Filters <think> / chain-of-thought markers from streamed output and optionally surfaces reasoning content.
  • Vision support — Routes image-analysis requests to a cached vision-capable NVIDIA NIM model.
  • Resilient streaming — Exponential-backoff retries with Retry-After support, dynamic idle timeouts scaled to max_output_tokens, and clean cancellation handling.
  • Minimal footprint — Ships only the compiled runtime; no bundled dependencies and a lazy activation model.

Requirements

  • VS Code 1.104.0 or later
  • GitHub Copilot extension installed and active
  • An NVIDIA NIM API key from build.nvidia.com/models

Installation

From Source

  1. Clone this repository.
  2. Run bun install --ignore-scripts && bun run compile.
  3. Press F5 in VS Code to launch the Extension Development Host.

From VSIX

  1. Run bun install --ignore-scripts && bun run package:vsix.
  2. Install the generated .vsix file via the Extensions view (Install from VSIX...).

Setup

  1. Open Copilot Chat and choose the model picker.
  2. Select Manage Models, then add/configure NVIDIA NIM.
  3. Paste the API key obtained from build.nvidia.com/models.
  4. Select one of the NVIDIA NIM models returned by your account.

You can also run NVIDIA NIM: Manage NVIDIA NIM API Key from the Command Palette. The extension will migrate that key into VS Code's language model provider group so the model picker can resolve NVIDIA NIM models. The VS Code model settings flow is recommended for new setups.

Supported Models

The extension dynamically fetches available models from https://integrate.api.nvidia.com/v1/models. It does not ship a hardcoded fallback model catalog; the Copilot Chat model picker shows the models returned by your NVIDIA NIM account.

When NVIDIA's /models response omits tool-calling capability metadata, chat models are treated as tool-capable so they remain selectable in Copilot Chat Agent mode. Models that explicitly report tool_calling: false are still treated as non-tool models.

Usage

  1. Open Copilot Chat (Cmd/Ctrl + Alt + I).
  2. Select NVIDIA NIM from the provider selector.
  3. Choose one of the dynamically discovered NVIDIA NIM models and start chatting.

Development

bun install --ignore-scripts
bun run compile
bun run lint
bun test

Press F5 in VS Code to launch the Extension Development Host.

Available Scripts

Script Description
bun run compile Compile TypeScript to out/.
bun run watch Compile and recompile on file changes.
bun test Run the test suite with the Bun test runner.
bun run lint Run ESLint over src/ and tests/.
bun run lint:fix Run ESLint and auto-fix fixable issues.
bun run format Format source with Prettier.
bun run package:vsix Build and package the extension into a .vsix.

Marketplace Packaging

bun run package:vsix

The command above produces a .vsix that can be uploaded in the VS Code Marketplace publisher portal.

Privacy

  • Your API key is stored securely through VS Code's language model provider configuration and, for legacy command-palette setup, VS Code SecretStorage.
  • Chat completions and model discovery requests are sent to https://integrate.api.nvidia.com/v1.

About

A lightweight VS Code extension that connects NVIDIA NIM models to GitHub Copilot Chat, so you can use NVIDIA-hosted LLMs (including DeepSeek, Llama, Qwen, Nemotron, and more) directly from the Copilot Chat model picker.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages