Running models

Call a cloud API or serve the weights yourself: inference servers, GPU memory, and the OpenShift path we use in the lab.

Updated CompTech Team

A model file does nothing until a process loads it and accepts requests. That process is an inference server. You either rent someone else's, which is an API, or you run your own. The decision of which weights, and whether they are allowed to see the data, is How to choose a model and Open-weight vs closed. This page is the serving.

An API call

A closed model is an HTTPS endpoint. You send the messages and a model id, and you stream the tokens back. The same shape fits a self-hosted server that speaks the OpenAI-compatible API, which is what vLLM and NIM both do. Applications should target that shape so the URL can change without a rewrite.

curl -s "$OPENAI_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"llama","messages":[{"role":"user","content":"Say ready"}],"max_tokens":16}'

Point OPENAI_BASE_URL at the vendor or at https://<your-route>/v1. Keep the key in a Secret on OpenShift, not in the image and not in Git. Log the model id and the token counts. Log the prompt only if the data classification allows the log store to hold it.

An API fails as a dependency. Timeouts, a retired model id, and a region outage are operational events. Pin the id, set a timeout, and decide what the application shows when the model is down. "Wait forever" is the default you get if you do not decide.

Serving it yourself

For weights you host, three servers cover almost every lab and production case we run:

Server Use it when
vLLM Open-weight language models on NVIDIA GPUs. Paged attention, continuous batching, an OpenAI-compatible API. The default in our OpenShift AI work.
NVIDIA NIM A supported container for a named model (Llama, Nemotron, the NeMo Retriever embedding and reranking builds). Pull from NGC, run on the GPU driver NIM expects.
TensorRT-LLM You are building an engine for a fixed checkpoint and you will measure it against vLLM. The Triton and TensorRT-LLM series.

Ollama and llama.cpp are the right tools on a workstation, for a GGUF file, while someone is exploring. They are the wrong place to hang a shared bank assistant. Promote the checkpoint to vLLM or NIM once more than one person depends on it.

On OpenShift the serving object is a ServingRuntime and an InferenceService (KServe), or the NIM container as a Deployment. The click-by-click path is Model serving. What matters in the runtime:

  • The GPU count and the GPU product. A model that does not fit will sit in Pending or be killed. Size it first.
  • A persistent volume or an OCI modelcar for the weights, so every replica starts from the same bytes. A download from the internet at pod start will not work on a disconnected cluster, and it will not be the same bytes next week.
  • A readiness probe that performs a tiny inference, not only an open TCP port. A process can be up and still not have finished loading the weights.
  • Horizontal scale by replica count, each replica holding a full copy of the weights. You cannot split one request across replicas unless the server is built for tensor parallelism, which you configure on purpose for a model that needs several GPUs.

Sizing the GPU

Start from the specs arithmetic. Weights in GB, plus KV cache for the context you will really send, times concurrent requests.

A single recent data-centre GPU with 24 GB holds a quantised model of around 7 to 8 billion parameters and a modest batch. 48 GB holds more context or a larger quantised model. 80 GB and above is where 70-billion-parameter models start to fit, often still quantised, often across two cards if you refuse to quantise. These are starting bands, not promises. nvidia-smi after load is the measurement.

oc exec -n <serving-namespace> deploy/<model> -- \
  nvidia-smi --query-gpu=name,memory.used,memory.total --format=csv

If the second replica will not schedule, the cluster does not have a free GPU of that type. Time-slicing shares one GPU between pods that are mostly idle. It does not make one card hold two models that each needed the whole card. The GPU engineering labs cover time-slicing, MPS and what each one sacrifices.

Batching is how a GPU earns its cost. One user at a time on a large model wastes it. vLLM batches concurrent requests automatically. If you have no concurrency, a smaller model is the better purchase.

A single GPU process, before the platform

On a workstation, vLLM is one command, and it is the fastest way to learn whether the file fits:

vllm serve meta-llama/Llama-3.1-8B-Instruct \
  --dtype auto \
  --max-model-len 8192 \
  --gpu-memory-utilization 0.90

Use the checkpoint you are allowed to download. --max-model-len is the context you will pay KV cache for. Set it to what the prompt needs, not to the model's maximum, or a 24 GB card will refuse a model the arithmetic said would fit. When this process answers the curl from the previous section, you have a measured memory number. Take that number to OpenShift. Do not start by requesting four GPUs because a catalogue page showed four.

The same flags exist on the KServe runtime as arguments on the container. Write them down next to the revision. A serving config that only says "the Llama NIM" will be re-debated at every upgrade.

Embeddings and rerankers

Serve them as their own replicas. They are small next to the LLM and they are on the critical path of every question. A single embedding replica in front of a large language model becomes the bottleneck, and it is the cheap one to double. The NIM names we use are in the RAG overview.

Call them from the application over the cluster network. Do not shell out to a laptop. Do not embed in the language-model process "to keep it simple": the two scale differently, and a crash in one should not take the other down.

Two sites

A model service has an RTO only if the other site can load the same weights. Replicate the model volume (the OpenShift AI DC/DR labs use SnapMirror for that) or ship the same OCI artefact to both clusters through GitOps. A failover that starts a multi-gigabyte download does not meet an RTO measured in minutes.

The API URL in the application should be a name you can swing, not a pod DNS name in one namespace.

Concurrency is the number the GPU sizing forgot. One request that fits in memory is not ten requests that fit. vLLM and TensorRT-LLM batch them, and the KV cache for those concurrent prompts is what pushes a card over the edge. Measure with the concurrency you expect at the busy minute, not with a single curl. If that minute needs a queue, put the queue in the application and return a clear "busy" rather than timing out inside the model server.

What's next

The current landscape is what you are likely to be asked to serve next: reasoning models, agents, small models. Risks and responsible use is the controls around the endpoint you just exposed. The supported NVIDIA stack is NVIDIA AI Enterprise.