What Is LLM Hosting? Running Open-Source Models on Rented Hardware
LLM hosting is the practice of provisioning GPU-accelerated infrastructure to serve inference requests for Large Language Models using backends like Ollama, vLLM, or Text Generation Inference (TGI). Unlike traditional web hosting, where the bottleneck is typically I/O wait or database query latency, LLM hosting is constrained by the physical capacity of VRAM and the memory bandwidth of the GPU. If your model parameters exceed your VRAM, the system will either crash with an “Out of Memory” (OOM) error or fall back to system RAM, which reduces inference speed from 50 tokens per second to less than 0.5 tokens per second—rendering the service unusable for real-time applications.
When you choose hardware for LLM hosting, you are essentially purchasing “inference headroom.” For a standard production environment, you need to calculate the memory required for the model weights, the KV cache (which grows with context length), and the CUDA overhead. If you are exploring container-based deployment options for smaller models, you might consider our guide on Railway vs Render vs Fly.io: PaaS Deployment Compared, but for serious LLM workloads, you will eventually migrate to dedicated bare-metal or cloud-GPU instances (e.g., A100s or L40s) to maintain consistent latency.
Quantization Formats and VRAM Footprint
Quantization is the process of reducing the precision of model weights from 16-bit floating point (FP16) to lower bit depths like 8-bit (INT8), 4-bit (GGUF/EXL2), or even 1.5-bit. This is the primary lever you have to fit larger models into smaller VRAM footprints. A 7B parameter model in FP16 requires approximately 14 GB of VRAM just to load the weights. By quantizing that same model to 4-bit, you reduce the footprint to roughly 4.5–5 GB, leaving enough headroom for a reasonable context window.
The choice of format dictates your runtime efficiency:
- GGUF: Best for CPU offloading or mixed-hardware setups where the GPU memory is insufficient. It is the standard for llama.cpp and Ollama.
- EXL2: Optimized specifically for NVIDIA GPUs; it offers superior tokens-per-second performance but requires a full load into VRAM.
- AWQ/GPTQ: Industry standards for high-throughput serving via vLLM; these formats are designed for batch processing and multi-user concurrency.
The 8 GB VRAM Constraint
If you are constrained to an 8 GB VRAM budget—common in consumer-grade RTX 3060/4060 instances—you must select models that stay within this limit while leaving at least 1–2 GB for the KV cache and overhead. When selecting a model, target these “sub-8GB” performers:
- Llama-3-8B (4-bit quantization): The current gold standard for general purpose instruction following.
- Mistral-7B-v0.3: Excellent for long-context tasks with a 32k window.
- Phi-3.5-mini: Highly efficient; you can run this at higher bit-precisions (8-bit) comfortably.
- Gemma-2-9B (3-bit quantization): Pushes the limits but offers superior reasoning capabilities.
- Qwen2.5-7B: Specifically tuned for code and structured data tasks.
- OpenChat-3.5: A fine-tune of Mistral that excels in conversational benchmarks.
- TinyLlama-1.1B: Useful for edge-case tasks where latency must be sub-10ms.
Hardware Selection Criteria
Selecting hardware is a trade-off between memory capacity, memory bandwidth (GB/s), and compute throughput (TFLOPS). For LLM hosting, memory bandwidth is almost always more critical than raw compute. A GPU with high TFLOPS but narrow memory buses will throttle during token generation. The following table provides a decision matrix for standard hosting scenarios.
| Hardware Class | Target VRAM | Primary Use Case | Recommended Quantization |
|---|---|---|---|
| Entry (RTX 3060) | 8 GB | Dev environment, internal tools | Q4_K_M (GGUF) |
| Mid (RTX 3090/4090) | 24 GB | Fine-tuning, heavy production | Q6_K / EXL2 6.0bpw |
| High (A6000/L40) | 48 GB | Large models (30B+), concurrency | FP8 / INT8 |
| Enterprise (H100) | 80 GB | Massive batch inference | FP16 / BF16 |
Managing Context Length Costs
The context window—the amount of text the model can process at once—is not “free.” Every token stored in the KV cache consumes VRAM. If your model is 7B parameters, and you want a 32k context window, you might find that the KV cache consumes an additional 2–4 GB of VRAM, depending on the architecture (e.g., Grouped Query Attention helps mitigate this, but it is not magic). If you exceed your VRAM limit during a conversation, the inference engine will either drop tokens (causing memory corruption and gibberish) or trigger the OOM killer.
To verify your current VRAM usage while a model is active, use nvidia-smi to monitor the memory utilization in real-time. If you are using vLLM, you can cap the memory usage explicitly:
# Start vLLM with a hard memory limit to prevent OOM
python3 -m vllm.entrypoints.openai.api_server \
--model meta-llama/Meta-Llama-3-8B-Instruct \
--gpu-memory-utilization 0.85 \
--max-model-len 8192 \
--port 8000
In this configuration, --gpu-memory-utilization 0.85 instructs the server to reserve only 85% of total VRAM for the model weights and cache, leaving 15% for CUDA kernels and background OS processes. Never set this value to 0.95 or higher unless you have strictly verified that your model weights and expected peak context length do not fluctuate, as a single spike in incoming request volume will crash the process.
Infrastructure Configuration and Drivers
The software layer between your hardware and the model (the backend) must be tuned to match your Linux kernel and driver versions. If you are running on a rented VPS with an NVIDIA GPU, you must ensure the CUDA toolkit version is compatible with your chosen serving framework. Using nvidia-smi, check your driver version before installing dependencies:
- Verify Driver:
nvidia-smi -q -d CAPABILITIES - Verify CUDA Runtime:
nvcc --version - Update the container runtime: If using Docker, ensure the
nvidia-container-toolkitis installed so your containers can interface with the host GPU drivers.
If you encounter a mismatch—for example, if your framework requires CUDA 12.1 but your host driver is stuck on a legacy 470.x branch—you will face “symbol not found” errors during model initialization. Always prefer Ubuntu 22.04 or 24.04 LTS for these setups, as most binary distributions of vLLM and llama.cpp are compiled specifically for those glibc versions. Attempting to run these on minimal Alpine-based containers often results in broken shared library dependencies that are not worth the minor disk-space savings.
Serving Strategies and Throughput Optimization
Once your model is loaded into VRAM, you must decide how to handle concurrent requests. Simply using a default Python script with transformers is insufficient for production. If you are serving multiple users, the primary bottleneck is the Key-Value (KV) cache. You should prioritize inference engines like vLLM or Text Generation Inference (TGI) over standard Hugging Face libraries because they implement PagedAttention.
PagedAttention manages KV cache memory in non-contiguous blocks, similar to how an OS handles virtual memory. This prevents memory fragmentation and allows you to increase your max_num_seqs (the number of concurrent requests) by 2x to 5x compared to naive implementations. When deploying, monitor the vllm:gpu_cache_usage_perc metric. If this consistently stays above 90%, you will face significant latency spikes. You can adjust the --gpu-memory-utilization flag to reclaim headroom for the system, though setting this above 0.95 often leads to OOM (Out of Memory) errors during burst traffic.
If you are running a multi-tenant application, you need to manage your resources as you would for traditional web stacks by utilizing Staging, Production and Preview Environments on a Single Plan to isolate inference workloads. For production-grade throughput, ensure your API gateway is configured to handle streaming responses. Without streaming, a user waits for the entire token generation sequence (which could be 500+ tokens) before seeing the first character, resulting in a poor perceived time-to-first-token (TTFT). Aim for a TTFT of under 300ms for conversational interfaces.
Network Latency and Data Transfer Bottlenecks
Many engineers overlook the network overhead associated with LLM hosting. If your model is hosted in a different availability zone than your application logic, the latency added by the payload transfer for large prompts can exceed the inference time itself. For a 4,000-token prompt, the JSON payload can reach 15–20MB. If you have 50 concurrent users, that is nearly 1GB of data per request cycle.
To mitigate this, implement a local reverse proxy like Nginx or HAProxy with Gzip compression enabled for your API endpoints. Additionally, pay attention to the PCIe bus speed if you are running multi-GPU setups. If you use a consumer-grade motherboard with PCIe 3.0 x4 lanes for your GPU, you will face massive bottlenecks during model loading and tensor parallel processing. Always verify your hardware topology with nvidia-smi topo -m to ensure your GPUs are communicating over NVLink or at least high-bandwidth PCIe 4.0/5.0 x16 lanes.
- PCIe Gen3 vs Gen4: Using Gen3 x8 lanes can increase model load times by 40% compared to Gen4 x16.
- Storage I/O: Loading a 70B parameter model in FP16 (approx. 140GB) from a SATA SSD takes roughly 3–5 minutes, whereas an NVMe Gen4 drive will finish in under 30 seconds.
- CPU Bottleneck: Do not neglect CPU core count. Inference engines spawn multiple worker processes; if your CPU has fewer cores than your GPU has compute units, you will see high iowait and CPU starvation.
Troubleshooting OOM and Thermal Throttling
Out of Memory (OOM) errors are the most frequent failure point in LLM hosting. When CUDA_OUT_OF_MEMORY triggers, the process usually hangs or crashes entirely. Before restarting the service, check the nvidia-smi output to see if there is a “ghost” process holding onto VRAM. Often, a failed Python script will not release its CUDA context, leaving 2GB-4GB of “zombie” memory behind. Use fuser -v /dev/nvidia* to identify and terminate these orphaned processes.
Thermal throttling is the silent killer for long-running inference jobs. If your GPU temperatures exceed 80°C, the core clock will downscale, causing your tokens-per-second (TPS) to drop sharply. In data center environments, you must ensure your server chassis has adequate front-to-back airflow. If you are using “blower-style” cards, keep the fan speeds fixed at 80% via nvidia-smi -i 0 -pl 250 to prevent the card from auto-downclocking under load. If you consistently hit 85°C, your hardware will eventually experience degraded performance or hard lockups.
Ready to Put This Into Practice?
Fast, reliable hosting with a free domain, free SSL, and a 30-day money-back guarantee.
Disclosure: this page may contain affiliate links. If you buy through them we may earn a commission at no extra cost to you. This never changes the technical advice on this site.
Common mistakes
- Running as Root: Running your inference server as root exposes your host to container breakout vulnerabilities; always use a dedicated service user with restricted permissions.
- Ignoring Disk Space: Failing to account for the size of model weights and their checkpoints on disk will lead to sudden disk-full errors that crash the OS logging services.
- Over-provisioning Context Window: Setting a 128k context window when your typical use case is 4k wastes massive amounts of VRAM on empty KV cache blocks, reducing your concurrency limit.
- Using Unsigned/Untrusted Models: Downloading models from unverified sources on Hugging Face can lead to malicious pickle files that execute arbitrary code upon loading.
- Neglecting Swap Space: Relying on system swap when you run out of VRAM will cause the system to “thrash,” effectively freezing your entire server for minutes at a time.
The Verdict: Your Deployment Path
Do not attempt to roll your own inference stack from raw PyTorch code unless you are conducting research. For production workloads, your path is clear: deploy vLLM inside a Docker container orchestrated by Nomad or Kubernetes. Use 4-bit or 8-bit quantization (AWQ or GPTQ) for all production models to maximize hardware efficiency without sacrificing significant perplexity. If your model fits in 24GB of VRAM (a standard RTX 3090/4090), use a single-node, single-GPU setup. If you require more, immediately move to enterprise-grade A6000 or A100/H100 cards to gain access to NVLink. Stop trying to optimize the model code and start optimizing your infrastructure’s concurrency and thermal management. Use the hardware as designed, monitor VRAM utilization at the process level, and keep your model weights on high-speed NVMe storage to ensure your system recovers from crashes in seconds, not minutes.