Running LLM Inference On-Premises

Sizing GPUs, serving with vLLM or Ollama, network and security considerations for private model hosting.

Published Mar 31, 202611 min read4 views
  • ai
  • docker
  • linux
  • observability

Why on-prem at all

Data residency, predictable cost at sustained load, and latency to internal systems. If your usage is bursty and small, a hosted API will be cheaper — measure before buying hardware.

Sizing

Model size

Precision

Approx. VRAM

Practical GPU

7-8B

FP16

~16 GB

1x 24 GB

7-8B

4-bit

~6 GB

1x 12 GB

70B

4-bit

~40 GB

2x 24 GB or 1x 48 GB

Add roughly 20% for the KV cache at long context lengths, and more for concurrent requests — the cache scales with tokens times concurrency.

Serving

Bash
docker run --gpus all -p 8000:8000 \
  -v /srv/models:/models \
  vllm/vllm-openai:latest \
  --model /models/llama-3.1-8b-instruct \
  --max-model-len 8192 \
  --gpu-memory-utilization 0.90

Put it behind a gateway

  • Terminate TLS and authenticate every caller — the inference server has no useful auth of its own.

  • Rate-limit per client; one runaway loop will saturate the GPU.

  • Log prompts only with an explicit retention policy; they frequently contain sensitive data.

Observability

text
vllm:num_requests_running
vllm:num_requests_waiting
vllm:gpu_cache_usage_perc
vllm:time_to_first_token_seconds
DCGM_FI_DEV_GPU_TEMP

Queue depth and time-to-first-token tell you when to add capacity long before users complain about throughput.

Back to all docs