Nim setup

From RHEcosystemAppEng/agentic-plugins · View interactive version

Nim setup is an AI agent skill from the GitHub repository RHEcosystemAppEng/agentic-plugins. Configure NVIDIA NIM platform on OpenShift AI for optimized model inference. Use when: - "Set up NIM on my cluster" - "Configure NGC credentials for NIM" - "I want to deploy a NIM model but haven't set up the platform" - "Create the NIM Account CR" One-time prerequisite before deploying models with

How to use this skill

Skill file

/nim-setup Skill

Configure the NVIDIA NIM platform on OpenShift AI. This is a one-time setup that creates NGC credentials and the NIM Account custom resource, enabling NIM-based model deployments via /model-deploy.

Prerequisites

Required MCP Server: openshift (OpenShift MCP Server)

Required MCP Tools (from openshift):

Optional MCP Server: rhoai (RHOAI MCP Server)

Optional MCP Tools (from rhoai):

Optional MCP Server: ai-observability (for get_gpu_info to verify GPU availability)

Common prerequisites (KUBECONFIG, OpenShift+RHOAI cluster, verification protocol): See skill-conventions.md.

Required User Input:

Additional cluster requirements:

When to Use This Skill

Use this skill when you need to:

Do NOT use this skill when:

Workflow

Step 0: Validate Target Namespace (Optional)

If the rhoai MCP server is available, validate that the target namespace is an RHOAI Data Science Project:

MCP Tool: list_data_science_projects (from rhoai)

If the namespace is not in the project list, warn: "Namespace [namespace] is not a Data Science Project. NIM setup may not work correctly. Consider creating a Data Science Project first."

If rhoai MCP is not available, skip this check and proceed.

Step 1: Verify GPU Operator and Node Feature Discovery

Document Consultation (read before verifying operators):

  1. Action: Read supported-runtimes.md using the Read tool to understand NIM platform requirements
  2. Output to user: "I consulted supported-runtimes.md to understand NIM platform requirements."

Check that the NVIDIA GPU Operator and NFD Operator are installed and healthy.

MCP Tool: resources_get (from openshift)

Parameters:

Expected Output: ClusterServiceVersion object with status.phase: "Succeeded"

Repeat for NFD Operator:

Error Handling:

Step 2: Collect NGC Credentials from User

Ask the user for their NGC API key. This key is used for two purposes:

  1. Pulling NIM container images from nvcr.io (image pull secret)
  2. Authenticating NIM API calls at runtime (API key secret)

Ask the user:

To set up NIM, I need your NVIDIA NGC API key.

You can generate one at: https://ngc.nvidia.com/setup/api-key

Please provide:
1. Your NGC API key
2. The target namespace for NIM resources (e.g., "my-ai-project")

WAIT for user to provide the NGC API key and namespace.

SECURITY: Store the key in memory only for the duration of this skill. Never echo or display the actual key value in output.

Step 3: Create NGC Image Pull Secret

Generate and display the docker-registry Secret YAML for pulling NIM images from nvcr.io.

Show the user the Secret manifest (with API key value redacted):

apiVersion: v1
kind: Secret
metadata:
  name: ngc-image-pull-secret
  namespace: [namespace]
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: [base64-encoded docker config for nvcr.io]

Note: The .dockerconfigjson contains:

Ask: "Should I create this image pull secret in namespace [namespace]? (yes/no)"

WAIT for explicit user confirmation.

MCP Tool: resources_create_or_update (from openshift)

Parameters:

Expected Output: Created Secret object with metadata.uid

Error Handling:

Step 4: Create NGC API Key Secret

Generate and display the generic Secret YAML for the NGC API key used at runtime.

Show the user the Secret manifest (with API key value redacted):

apiVersion: v1
kind: Secret
metadata:
  name: ngc-api-key
  namespace: [namespace]
type: Opaque
stringData:
  NGC_API_KEY: "[REDACTED]"

Ask: "Should I create this API key secret in namespace [namespace]? (yes/no)"

WAIT for explicit user confirmation.

MCP Tool: resources_create_or_update (from openshift)

Parameters:

Expected Output: Created Secret object with metadata.uid

Error Handling:

Step 5: Create NIM Account CR

Generate and display the NIM Account custom resource that manages the NIM platform lifecycle.

Show the user the Account CR manifest:

apiVersion: nim.opendatahub.io/v1
kind: Account
metadata:
  name: nim-account
  namespace: [namespace]
spec:
  apiKeySecret:
    name: ngc-api-key
  imagePullSecret:
    name: ngc-image-pull-secret

Ask: "Should I create this NIM Account CR in namespace [namespace]? (yes/no)"

WAIT for explicit user confirmation.

MCP Tool: resources_create_or_update (from openshift)

Parameters:

Expected Output: Created Account object with metadata.uid

Error Handling:

Step 6: (Optional) Configure NIM Model Catalog

Ask: "Would you like to customize which NIM models appear in the catalog? (yes/no, default: no)"

If user says no -> Skip to Step 7 (default catalog is used).

If user says yes:

Show the user the ConfigMap template:

apiVersion: v1
kind: ConfigMap
metadata:
  name: nim-model-catalog
  namespace: [namespace]
data:
  model-catalog.json: |
    [
      {
        "name": "[model-name]",
        "displayName": "[display-name]",
        "shortDescription": "[description]"
      }
    ]

Ask user which models to include, generate the ConfigMap, and confirm before creating.

MCP Tool: resources_create_or_update (from openshift)

Step 7: Validate NIM Platform Readiness

Check that the NIM platform is ready for model deployments.

Step 7a: Check Account CR Status

MCP Tool: resources_get (from openshift)

Parameters:

Expected Output: Account object with status.conditions showing ready state

Step 7b: Verify NIM ServingRuntimes

MCP Tool: list_serving_runtimes (from rhoai) - preferred if rhoai MCP available

Parameters:

Fallback MCP Tool: resources_list (from openshift)

Expected Output: List of ServingRuntime objects including NIM runtimes

Step 7c: (Optional) GPU Inventory Check

If ai-observability MCP server is available, use get_gpu_info to report cluster GPU inventory.

Report results showing: Account CR status, credentials status (created/existing), available NIM ServingRuntimes, GPU inventory (if available), and next steps (/model-deploy).

On failure: Report Account CR status details and error message. Suggest troubleshooting steps: check Account CR events, verify NGC API key validity, check OpenShift AI operator logs. Ask if user wants help troubleshooting.

Common Issues

For common issues (GPU scheduling, OOMKilled, image pull errors, RBAC), see common-issues.md.

Issue 1: Account CR Stuck in "Pending"

Error: Account CR status.conditions shows pending state indefinitely

Cause: NGC credentials are invalid, expired, or the RHOAI operator cannot reach NGC services.

Solution:

  1. Verify NGC API key is valid by testing at https://ngc.nvidia.com
  2. Check Account CR events: use events_list filtered by namespace to find events related to the Account resource
  3. Regenerate NGC API key and re-run /nim-setup with new credentials

Issue 2: GPU Operator Not Installed

Error: ClusterServiceVersion for gpu-operator-certified not found

Cause: NVIDIA GPU Operator was not installed from OperatorHub.

Solution:

  1. Install NVIDIA GPU Operator from OperatorHub in the OpenShift console
  2. Wait for the operator to reach Succeeded phase
  3. Verify GPU nodes are detected: check for nvidia.com/gpu resources on nodes
  4. Re-run /nim-setup

Issue 3: NIM ServingRuntimes Not Appearing

Error: resources_list for ServingRuntimes returns no NIM runtimes

Cause: Account CR is not yet ready, or the RHOAI operator version does not include NIM support.

Solution:

  1. Check Account CR status — runtimes are created asynchronously after the Account becomes ready
  2. Wait 2-3 minutes and re-check
  3. Verify RHOAI operator version supports NIM integration
  4. Check operator logs for errors

Dependencies

MCP Tools

See Prerequisites for the complete list of required and optional MCP tools.

Related Skills

NIM Deployment Handoff to /model-deploy

When handing off to /model-deploy after NIM setup, note these NIM-specific considerations:

Reference Documentation

Critical: Human-in-the-Loop Requirements

See skill-conventions.md for general HITL and security conventions.

Skill-specific checkpoints:

Example Usage

See nim-setup examples for a complete first-time NIM setup walkthrough.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.