Guide

Your first model server

A machine with a GPU

You can rent a machine with a GPU by the hour from a cloud provider. You log in with SSH and work in a terminal. The GPU has its own memory, VRAM, separate from the machine's normal RAM. Common sizes are 24 GB and 80 GB, and the model must fit in it.

Driver, CUDA and PyTorch

GPU software comes in layers:

  • The driver, at the bottom, talks to the GPU.
  • CUDA is NVIDIA's toolkit for running code on its GPUs.
  • A framework like PyTorch sits on top, built for one CUDA version.

Each layer must fit the one below; a mismatch is the most common first error. nvidia-smi shows the driver version and the newest CUDA it supports.

Picking a model

Open models, like Llama, Mistral or Qwen, give you the weight files to run yourself. Check two things first:

  • Size: an 8B model at 2 bytes per weight needs about 16 GB, so it fits a 24 GB GPU with room left.
  • License: it must allow what you plan to do, like a paid app.

Start with 1B to 8B. Download the weights, the tokenizer files and the config file.

Load, generate, stream

Loading copies the weights from disk into VRAM and can take minutes, so do it once at startup. Then for each request: tokenize the prompt, make the next token, turn it back into text, stream it out, and repeat until a stop token or max tokens.

Serve and watch

Put the model behind an HTTP endpoint so apps can call it. Servers like vLLM offer an OpenAI-shaped API. While requests run, watch nvidia-smi for memory used, utilization (how busy the GPU is) and power. vLLM takes most of the VRAM up front, so high memory use at start is normal.

Remember

  • The model must fit in VRAM.
  • Driver, CUDA and PyTorch must match.
  • Check size and license; start small.
  • Load once; stream each token.
  • Watch memory, utilization and power with nvidia-smi.