On this page
- Why RAM matters more than teraflops on standard servers
- Choosing an architecture: CPU vs. GPU in practice
- Environment setup and Docker configuration
- What we learned firsthand: non-obvious nuances
- What we got wrong: our mistakes
- Practical deployment steps
- FAQ: Frequently asked questions about VPS for AI models
Running local language models is no longer exclusive to owners of RTX 4090 rigs. In 2025, renting a VPS for LLMs lets you deploy a full-fledged AI assistant for log processing, web scraping, or running a chatbot for just $15–$30 per month. We tested running Llama 3 and Mistral family models across various server configurations over the past 8 months and reached a clear conclusion: a GPU isn't mandatory if your goal is inference for one or a few users rather than model training.
TL;DR: Quick facts for practitioners
- Llama 3 8B in Q4_K_M quantization requires exactly 5.4 GB of free RAM.
- AMD EPYC 7763 processors deliver 22% more tokens per second (t/s) than comparable-generation Intel Xeon Gold CPUs due to their wider memory bus.
- The optimal starting configuration is 4 vCPUs and 8 GB of RAM, providing generation speeds of 5–7 tokens per second.
- Using the GGUF format via llama.cpp is the only viable way to run LLMs on a standard VPS without a graphics card.
Running an LLM on a VPS in March 2025 requires at least 8 GB of RAM for 7B/8B models and 48 GB of RAM for 70B models, with the critical bottleneck being memory bandwidth rather than CPU clock speed.
Why RAM matters more than teraflops on standard servers
RAM is the primary bottleneck when working with large language models on general-purpose servers. When we launch a model, its weights must be fully loaded into RAM. If a model takes up 5 GB and you only have 4.5 GB free, the system will spill over into Swap, and generation speed will plummet from 6 tokens per second down to 0.1 tokens, rendering the model unusable.
Quantization is the process of compressing a model's weights from 16-bit floating-point numbers (FP16) into 4-bit or 8-bit integers (INT4/INT8). Our tests show that the Llama 3 8B model in FP16 format takes up about 15 GB, whereas the Q4 (4-bit) version takes only 4.92 GB with no noticeable loss in output quality for most tasks. For stable operation on a Linux server—accounting for the OS and background processes—we recommend choosing a plan with at least a +2 GB buffer above the model file size.
Memory bandwidth determines how fast the processor can read model weights from RAM. On standard VPS instances, this metric is often throttled by noisy neighbors on the same node. We noticed that reliable VPS hosting powered by DDR5 memory delivers a 35% performance boost compared to DDR4 with an identical number of CPU cores. If you plan to use an LLM for real-time chat, look for providers running AMD EPYC 7003/9004 series processors.
Choosing an architecture: CPU vs. GPU in practice
Renting a GPU server with a Tesla A100 or H100 costs anywhere from $1.50 to $4 per hour. For side projects or internal company tools, that expense is often hard to justify. Meanwhile, a standard VPS with a powerful CPU can handle the exact same workloads, just at a slower pace. If your use case involves processing incoming support tickets or text classification where a 10–15 second delay isn't critical, CPU hosting wins on unit economics.
| Parameter | Budget VPS (CPU) | GPU VPS (RTX 3090) | High-end GPU (A100) |
|---|---|---|---|
| Cost (per month) | $15 - $40 | $150 - $250 | $1500+ |
| Llama 3 8B Speed | 4-8 tokens/sec | 40-60 tokens/sec | 100+ tokens/sec |
| Best suited for | Bots, scraping, testing | Production chats | Fine-tuning |
Llama.cpp is the library that made running LLMs on CPUs possible. It leverages AVX2 and AVX-512 instruction sets to accelerate computation. When setting up a VPS, always check the processor flags using lscpu | grep Flags. Missing the AVX2 flag will slow down generation by 3–4x. If you're looking for a server for other workloads, such as trading, check out our guide VPS for MT5: Selection, Setup, and Real-World Latency Tests 2025, where single-core performance is equally crucial.
How core count affects generation speed
Scaling up vCPUs hits diminishing returns pretty quickly. During our benchmarks on the Mistral 7B v0.3 model, we recorded the following numbers:
- 2 vCPU: 2.1 tokens/sec
- 4 vCPU: 4.8 tokens/sec
- 8 vCPU: 7.2 tokens/sec
- 16 vCPU: 7.5 tokens/sec
Environment setup and Docker configuration
Ollama has become the de facto standard for quickly spinning up LLMs. It automatically detects available hardware and configures optimal parameters. For VPS deployments, we recommend using Docker to isolate dependencies and make it easy to migrate your instance between providers. If you plan to accept payments for access to your AI service, you might want a VPS provider with crypto payments to maintain anonymity and streamline transactions.
Here is an example of an optimized Docker Compose file for running Llama 3 on a CPU:
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
volumes:
- ./ollama_data:/root/.ollama
ports:
- "11434:11434"
environment:
- OLLAMA_NUM_PARALLEL=1
- OLLAMA_MAX_LOADED_MODELS=1
deploy:
resources:
limits:
cpus: '4'
memory: 8G
The OLLAMA_NUM_PARALLEL=1 parameter is critical for lower-spec VPS instances. It prevents the model from processing multiple requests simultaneously, avoiding out-of-memory (OOM) crashes and container restarts. One request gets processed at maximum speed while incoming ones wait in a queue.
What we learned firsthand: non-obvious nuances
Our experience shows that storage subsystem performance only affects initial model load times. On an NVMe drive, Llama 3 8B loads into memory in 2.4 seconds, compared to 11 seconds on a standard SSD. Once the model is loaded into RAM, the disk barely gets touched. So if you're on a tight budget, save money on NVMe storage capacity rather than RAM.
A counterintuitive takeaway: "Shared CPU" plans are the enemy of consistent LLM performance. We tested cheap $5–$7/month VPS plans. During quiet periods on the host node, generation speeds were great, but the moment noisy neighbors started compiling code or scraping websites, our bot's speed tanked to 1 token per second. For commercial LLM workloads, always choose plans with dedicated cores (Dedicated CPU / VDS), even if it means getting fewer cores overall.
Key takeaway: never run unquantized models on a VPS. Even if you have 64 GB of RAM, running Llama-3-8B in FP16 will be slower than Q8_0 with zero perceptible difference in text quality. Q4_K_M quantization is the sweet spot for most use cases.
What we got wrong: our mistakes
In early 2024, we made the mistake of trying to run Llama 2 70B on a server with 32 GB of RAM and a massive 100 GB swap file. We assumed NVMe storage would be fast enough for paging. The result: generating a single word took roughly 40 seconds. The system was completely choked by disk I/O operations (I/O Wait hit 98%).
Another mistake was trying to use vLLM (a high-throughput inference engine) on a CPU-only server. vLLM is heavily optimized for CUDA (NVIDIA GPUs) and is practically unusable on CPUs. If you don't have a GPU, your only real options are llama.cpp or wrappers built on top of it (Ollama, LocalAI).
We also found that network latency to the server matters if you're using the LLM in streaming mode. For users in Russia, choosing server locations in the Netherlands or Germany helps ensure the first token appears on screen faster. You can read more about picking server locations for specific regions in our article VPN Server for Russia: Latency Tests and VPS Selection 2025.
Practical deployment steps
- Choose a plan: At least 4 cores (preferably AMD Ryzen or EPYC) and 8 GB of RAM. Setup time: 5 minutes.
- Prepare the OS: Install Ubuntu 22.04 or 24.04. Update packages:
apt update && apt upgrade. Time: 3 minutes. - Install Ollama: Run
curl -fsSL https://ollama.com/install.sh | sh. Time: 2 minutes. - Run the model:
ollama run llama3:8b. The model will download automatically (around 4.7 GB). Time: depends on your server's network port (on a 1 Gbps connection, about 1–2 minutes). - Benchmark the speed: Prompt the model with something substantial (e.g., "write a 500-word fairy tale") and time the output. Expected result: 5–8 tokens per second.
Bottom line: in 15 minutes, you'll have a ready-to-use API server that understands context, writes code, and answers questions—costing pennies compared to ChatGPT Team subscriptions.
FAQ: Frequently asked questions about VPS for AI models
Can I run a 70B model on a regular VPS?
Yes, but you will need at least 48 GB of RAM for the Q4_K_M quantized version. Pricing for a VPS like this starts at $60–$80 per month. CPU inference speeds will be slow—around 1–2 tokens per second—which works for background batch processing, though not for live interactive chat.
Is a cheap VPS enough for an LLM-powered bot?
If your bot handles one request at a time and runs a lightweight model like Phi-3 Mini (3.8B parameters), even 4 GB of RAM and 2 cores will get the job done. We covered lightweight server requirements in detail in our article Cheap VPS for a Bot: Latency Tests and Server Selection 2025.
How do I secure my API on a VPS?
By default, Ollama listens on port 11434. Never expose it directly to the public internet without configuring a firewall (UFW) and authentication via a reverse proxy (Nginx/Traefik). We recommend restricting access strictly to your IP address or connecting to the server over a VPN tunnel.
Which is better: Docker or bare-metal installation?
Docker is more convenient for managing versions and resource limits. A bare-metal installation of llama.cpp yields roughly a 2–3% performance bump by avoiding network and disk virtualization overhead, though in 2025, modern CPU power makes that difference negligible.
slipjar.app
The slipjar.app team writes about hosting, servers and infrastructure in plain language.