Overview

How NeMo builds and customises models, how NIM serves them, and where each piece runs on OpenShift.

Updated CompTech Team

NeMo and NIM do different jobs. NeMo prepares a model: it cleans data, fine-tunes, evaluates and constrains what the model is allowed to say. NIM serves a model: a container with an OpenAI-compatible API, a fixed model, and the runtime already chosen. OpenShift is where both run.

You do not fine-tune a model to teach it this quarter's policy. You retrieve that. You fine-tune to change how a model behaves on a task you can show it examples of. This series uses a company policy assistant as the thread, and the RAG lab is the retrieval path those answers still depend on.

The pieces

Piece Role in this series Lab
NeMo Curator Clean, filter and deduplicate the training text Curator
NeMo Customizer LoRA fine-tune a Llama or Mistral model on that text Customizer
NeMo Evaluator Compare the base model with the fine-tuned one, and keep the score Evaluator
NeMo Guardrails Topic, safety and jailbreak checks around the chatbot Guardrails
NeMo Retriever NIMs Embedding and reranking for the RAG index Retriever
NIM Serve the base model, the LoRA adapter and the retriever models This page, and Triton when NIM does not fit

Curator and Evaluator also exist as Python libraries you can run in an OpenShift AI workbench. Customizer in this series is the NeMo microservice: you submit a job, a GPU pod trains, and the output is a named model you can serve. Guardrails is a library you run beside the chatbot. Retriever models are NIMs.

Build, then serve

A model moves through four states. Mixing them up is how a prototype becomes a model nobody can reproduce.

  1. Data. A JSONL file of policy questions and answers, cleaned in Curator. The file has a name and a date. Training reads that file, not "whatever was in the bucket".
  2. Weights. Customizer reads a base model (Llama 3.1 8B Instruct or a Mistral instruct model, both with freely downloadable weights) and writes a LoRA adapter. The base weights stay as they were.
  3. Score. Evaluator runs the same questions against the base NIM and the fine-tuned NIM. You keep both scores. A fine-tune that sounds better in a demo and scores worse on the question set does not ship.
  4. Service. NIM loads the base model and the adapter. Guardrails sits in front. Retriever NIMs feed the prompt when the question is about a document.
oc get pods -n nemo
oc get pods -n nim

In our lab the NeMo microservices and the NIM containers run as operators on the same OpenShift cluster as OpenShift AI. A GPU is scheduled with a nvidia.com/gpu request. The nodes that have one are labelled by the NVIDIA GPU Operator, which the Triton on OpenShift lab uses as well.

Fine-tune, retrieve, or both

You need Do this
Answers from documents that change, with a citation RAG. Start with the RAG lab and Retriever
A tone, a format, or a task the model does not follow from the prompt alone LoRA fine-tune in Customizer, on examples of that task
The model to refuse topics and jailbreak attempts Guardrails, in front of either of the above
A model NIM does not ship, or a custom pre/post pipeline Triton and TensorRT-LLM

A fine-tune does not quote its sources, and it does not learn a PDF you added yesterday. The pattern we use is a small LoRA on the organisation's question-answering style, with RAG for the facts and guardrails for the boundary.

What you run where

Workload Where it runs
Interactive curation and a notebook OpenShift AI workbench with a GPU
A repeatable fine-tune or evaluation NeMo Customizer and Evaluator jobs
Serving an unchanged model A NIM, one Deployment per model
Serving your own ONNX or a TensorRT-LLM engine Triton

Keep the base model, the dataset name, the adapter name and the evaluation result in one note for each run. The labs that follow each produce one of those four.

Names you can compare later

A run you cannot repeat is a demo. The note for each Customizer job has four labels, and the later labs refuse to compare two runs that do not share them.

Label Where it is set
Base model A config returned by Customizer, not a name you hoped was installed
Dataset The Curator file, registered once, with valid.jsonl held out of it
Adapter Customizer's output_model, loaded by the NIM as a LoRA
Score The phrase-check counts Evaluator prints for that file

Write the GPU the config expected next to the base model. A job that asks for a GPU the node does not have stays Pending, and no learning rate will fix that.

oc get nodes -l nvidia.com/gpu.present=true
oc get pods -A -o json | jq -r '.items[] | select(any(.spec.containers[]?; .resources.limits["nvidia.com/gpu"]? != null)) | "\(.metadata.namespace)/\(.metadata.name)"'

The second command lists pods that requested a GPU, across NeMo, NIM and Triton. One node shared by a fine-tune and a serving NIM will queue one of them. Decide which one is allowed to wait before you start the job, not after the chatbot has stopped answering.

The chatbot's request path, once the later labs are done, is short. Guardrails checks the question. Retriever embeds it, searches, and reranks. The NIM, with or without the LoRA adapter, writes the answer. Guardrails checks the answer. Curator, Customizer and Evaluator are how that adapter got there, and they do not sit on the request.

Serving a model that has no NIM is a different path. That is Triton, and it uses the same GPU pool.

What's next

  1. Curator turns a raw export into a training file.
  2. Customizer fine-tunes on it, and Evaluator records whether it helped.
  3. Guardrails and Retriever finish the chatbot the RAG series started.