claude-code-nim-opencode

Configure OpenCode to run NVIDIA NIM models as a Claude Code alternative.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/TylerSimons1127/vibe --skill claude-code-nim-opencode-tylersimons1127
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: claude-code-nim-opencode
Source: https://github.com/TylerSimons1127/vibe/tree/main/skills/devops/claude-code-nim-opencode
Command: npx skills add https://github.com/TylerSimons1127/vibe --skill claude-code-nim-opencode-tylersimons1127

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opencode-ai, @ai-sdk/openai-compatible.

What problem does it solve? Claude Code is hard-wired to Anthropic's /v1/messages protocol and cannot natively use NVIDIA NIM's OpenAI-compatible endpoints, leaving developers without a clean way to run NIM-hosted models like GLM 5.2 or Nemotron in an agentic coding CLI. ## Core Features & Use Cases - OpenCode Provider Configuration: Writes a complete opencode.json provider block using @ai-sdk/openai-compatible with the NIM base URL, API key, and five pre-configured models. - Per-Model maxTokens Capping: Prevents Bad Request context-length errors by capping each NIM model's completion tokens to fit its context window. - Rate-Limit Diagnosis: Distinguishes HTTP 429 throttling on free NIM keys from broken configuration, with curl-based recovery checks. - Use Case: A developer on Windows wants to use GLM 5.2 for agentic coding without an Anthropic subscription; this Skill installs OpenCode, writes the NIM provider config, verifies the model list, and runs a smoke test. ## Quick Start Set up OpenCode with my NVIDIA NIM API key so I can run GLM 5.2 and Nemotron models for coding tasks.

Frequently Asked Questions about claude-code-nim-opencode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use NVIDIA NIM models with Claude Code?▼

Claude Code cannot use NIM directly because its engine is hard-wired to Anthropic's /v1/messages protocol. Use OpenCode instead, which natively speaks the OpenAI-compatible /v1/chat/completions protocol that NIM exposes.

How to configure OpenCode with an NVIDIA NIM API key?▼

Install OpenCode with npm i -g opencode-ai, then write ~/.config/opencode/opencode.json defining an nvidia-nim provider using @ai-sdk/openai-compatible with baseURL https://integrate.api.nvidia.com/v1 and your nvapi key. Verify with opencode models nvidia-nim.

Why does OpenCode return Bad Request max context length with NIM models?▼

OpenCode defaults to a 32000-token completion request, which exceeds small NIM models like Nemotron Mini with a 4096 context window. Set a per-model maxTokens value in opencode.json for every configured model.

Why does opencode run hang or exit empty with NIM?▼

Free NIM API keys are heavily rate-limited and return HTTP 429, causing runs to hang or produce empty output. Wait and retry, or confirm key recovery with a direct curl to /v1/chat/completions.

Can I bridge Claude Code to NIM with LiteLLM?▼

LiteLLM can present an Anthropic-compatible endpoint in front of NIM via ANTHROPIC_BASE_URL, but it is flaky for agentic tool-use. OpenCode is the recommended path for NIM models.