GPU and AI
How to run your own LLM on a GPU server
From a fresh GPU server to a private, OpenAI-compatible endpoint: drivers, a model server, and safe remote access.

This guide takes a freshly delivered GPU server to a private, OpenAI-compatible endpoint that your own applications can call. It covers two model servers: Ollama, the quickest route to a working model, and vLLM, the one to choose when many requests arrive at once. Commands assume Ubuntu 24.04 with NVIDIA drivers installed, and 203.0.113.10 as the server address.
1. Check the GPU
Log in over SSH and run:
nvidia-smi
You should see your card, its total memory and no running processes. If the command is missing, the drivers are not installed: reinstall the server with the image that includes them.
2. Choose a model that fits
Parameters in billions × bytes per weight × 1.2 must be below the card’s VRAM. At 4-bit a weight takes about 0.6 byte, so a 32 GB card holds up to about 40B parameters, less with a long context. The method is explained in How much VRAM do you need to run an LLM?
3. Option A: Ollama
Ollama downloads quantized models and serves them with one command. Install it:
curl -fsSL https://ollama.com/install.sh | sh
Pull a model and talk to it. Replace the name with any model from the Ollama library:
ollama run llama3.2
Ollama also runs as a service and listens on 127.0.0.1:11434. It speaks the OpenAI API format:
curl http://127.0.0.1:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
4. Option B: vLLM
vLLM batches concurrent requests on the GPU, which makes it far more efficient when several users or jobs call the model at the same time. Run it from its official container; Docker and the NVIDIA container toolkit are part of our GPU image, and need installing first anywhere else. Replace the model with the Hugging Face repository you want:
docker run -d --name vllm --restart unless-stopped --gpus all --ipc=host \
-p 127.0.0.1:8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
vllm/vllm-openai:latest \
--model Qwen/Qwen2.5-7B-Instruct \
--api-key CHANGE-THIS-KEY
The first start downloads the weights. Follow it with docker logs -f vllm, then test:
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer CHANGE-THIS-KEY" \
-d '{"model": "Qwen/Qwen2.5-7B-Instruct", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
This model is loaded at 16-bit and needs about 17 GB: it fits a 32 GB card and larger. On a 16 GB card, pick a smaller model or a quantized repository.
Some models require you to accept a license on Hugging Face first; in that case add a line -e HF_TOKEN=your_token \ before the line of the image, vllm/vllm-openai:latest. With several GPUs, add --tensor-parallel-size 2 (or 4) after --model to spread the model across them.
5. Keep the endpoint private
Both commands above bind the API to 127.0.0.1, so it is reachable only from the server itself. That is deliberate: an open model endpoint on the internet is found and abused within hours. Two safe ways to use it from elsewhere:
An SSH tunnel, for yourself
On your own computer:
ssh -N -L 8000:127.0.0.1:8000 root@203.0.113.10
While that command runs, http://127.0.0.1:8000 on your computer is the server’s endpoint, encrypted through SSH. Use port 11434 for Ollama.
A reverse proxy with HTTPS, for applications
Put Nginx in front, with a certificate, and make it require the key. Install Nginx and the certificate as in Host a website on a VPS with Nginx and free HTTPS, then use this block for the application. vLLM checks the key itself; Ollama has no key, so Nginx must check it:
location / {
if ($http_authorization != "Bearer CHANGE-THIS-KEY") { return 401; }
proxy_pass http://127.0.0.1:11434; # 8000 for vLLM
proxy_set_header Host localhost:11434; # Ollama refuses other host names
proxy_buffering off;
proxy_read_timeout 600s;
}
Keep the key long and secret, and test from another machine that a request without it is answered 401.
6. Point your code at it
Any library that speaks the OpenAI API works by changing the base URL:
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="CHANGE-THIS-KEY")
reply = client.chat.completions.create(
model="Qwen/Qwen2.5-7B-Instruct",
messages=[{"role": "user", "content": "Summarize this in one sentence: ..."}],
)
print(reply.choices[0].message.content)
7. Watch it work
watch -n 1 nvidia-smi
Memory used should sit below the card’s total with a little room to spare, and GPU utilization should rise while requests run. If loading fails with an out-of-memory error, choose a smaller model, a lower precision or a shorter maximum context.
8. Keep it running
An endpoint is only useful if it survives a reboot. The command of step 4 carries --restart unless-stopped, so the container comes back by itself; for a container created without it, run docker update --restart unless-stopped vllm. Ollama already runs as a system service.
Our GPU servers are billed by the month at a flat price, with no meter on GPU time or bandwidth, so there is nothing to gain by switching the model off at night. Plans and prices: GPU servers and LLM hosting.
Sources and further reading
Read nextTwo guides to follow this one.
All GPU and AI guides
GPU and AIMonthly vs hourly GPU rental: where the break-even isThe formula that decides between a flat month and an hourly meter, with our prices spread over 730 hours and worked examples.
GPU and AIHow much VRAM do you need to run an LLM?A sizing rule you can do in your head: parameters, quantization and context, with worked examples from 16 to 288 GB.
A whole GPU, one flat monthly price.
GPU servers from $165 a month, at a flat price: no meter on hours or bandwidth.
- No KYCNo email, no ID
- No DMCANotices not acted on
- Crypto friendlyBTC, ETH, XMR, USDT, SOL
- UnmeteredOn every plan