Hands-on tutorial

Tutorials · AI

How to Run a Private LLM on Your Own GPU Server

Serve an open large language model inside your network: choose a model that fits your GPU memory, run it in a container with an OpenAI-compatible API, and protect it with authentication, TLS and logging.

Intermediate35 min8 steps

Before you start

  • A GPU server with drivers and container support installed
  • A model licence that allows your use
  • A DNS name and certificate for the internal service

Step by step

  1. Pick a model that fits

    Estimate memory: about 2 bytes per parameter in FP16, 1 in 8-bit and 0.5 in 4-bit, plus 10 to 30% for active requests. Choose a size and quantisation that fit your total GPU memory with headroom.

  2. Download the model to local storage

    Store model files on the server's NVMe drives (or a nearby storage server) so restarts do not depend on the internet.

  3. Start an inference server

    Run an open-source inference server in a container, for example vLLM (OpenAI-compatible API) or Ollama for simpler setups. Give it access to the GPUs and the model folder, and split large models across several GPUs with the server's tensor-parallel option.

  4. Test locally

    Send a request with curl to the local API and check the answer, response time and GPU memory use.

  5. Put a reverse proxy in front

    Publish the API through a reverse proxy with TLS and an authentication method (API keys or single sign-on). Do not expose the inference port directly.

  6. Restrict network access

    Allow only the user and application VLANs that need the service, using firewall rules on the server and the network gateway.

  7. Log and monitor

    Keep access logs, watch GPU usage and response times, and set alerts for errors and high temperatures.

  8. Write a usage policy

    Tell users what data they may send, how long prompts are kept and who can read logs.

Pro tips

  • Start with a smaller model and measure before buying more GPUs.
  • Keep one GPU free for testing new models if you can.
  • Back up the model folder and configuration with your normal backups.

Last reviewed: