Skip to main content

Overview

NVIDIA NIM (NVIDIA Inference Microservices) packages optimised LLMs as containers exposing an OpenAI-compatible API. NIMs run on-premises on NVIDIA GPU infrastructure or on NGC-hosted endpoints. Because NIM speaks the OpenAI API protocol, Cognisafe intercepts all traffic transparently — no NIM configuration changes required.

Self-hosted NIM

Prerequisites

  • NVIDIA GPU with CUDA 12.x
  • Docker with NVIDIA Container Toolkit
  • NGC API key from ngc.nvidia.com

Run a NIM container

NIM exposes the OpenAI-compatible API at http://localhost:8000/v1.

Proxy configuration

SDK setup

NGC-hosted NIM endpoints

NVIDIA hosts NIM endpoints at https://integrate.api.nvidia.com/v1. These are useful for testing before deploying your own GPU infrastructure.
The Cognisafe proxy strips and rewrites the base_url — your client always points at the proxy, and the proxy forwards to UPSTREAM_URL. This means your application code never contains the NIM endpoint URL directly.

Kubernetes with NVIDIA GPU Operator

Set UPSTREAM_URL=http://nim-llama.cognisafe-system.svc.cluster.local:8000 on the Cognisafe proxy.
NIM containers are large (10–30 GB). Use a dedicated node pool with local NVMe storage and pre-pull the image via a DaemonSet to avoid cold-start delays in production.

Air-gapped safety scoring with NIM

NVIDIA publishes a NIM for content safety:
Configure the safety worker to use it:
This keeps all scoring on-premises — no OpenAI dependency.