Llama 3.1 8B requirements on a CPU server, measured: it needs 8 GB of RAM. On our two 4 GB servers it did not run at all. On 8 GB it ran with 5941 MiB of system RAM used and generated 6.3 tokens/s on a Hetzner CX33; on 16 GB it generated 9.7 tokens/s on a CX43. A GPU is optional, not required.

This matters now because 8B is the size where small open models start to feel useful, and most requirement guides you find were written for GPUs. They quote VRAM and leave CPU servers at a vague "16 GB or more". We rented five servers and checked.

Tested in the Lab Hetzner CX23, CX33, CX43, CAX11, CAX21 · Nov 2026

This page is part of our self-hosted LLM section. For the smaller sibling model, see Llama 3.2 3B requirements.

The short answer

Minimum that workedComfortable
RAM8 GB (5941 MiB used on the CX33)16 GB (6023 MiB used of 15613 MiB on the CX43)
vCPU48
Speed5.7 to 6.3 tokens/s9.7 tokens/s
Disk4.9GB for the model fileSame, plus room for other models
GPUNot neededNot needed
Did not work4 GB x86 (CX23) and 4 GB ARM (CAX11)n/a

Units used here: a vCPU is one virtual processor core on a cloud server. MiB is a mebibyte (1,048,576 bytes), so 8 GB of RAM shows up as about 7751 MiB. Tokens/s is how many tokens, the word pieces a model writes, it generates per second.

What "llama3.1" in Ollama actually is

When you run ollama run llama3.1, you get the latest tag, which Ollama's library lists as identical to llama3.1:8b. Its model page shows 8.03B parameters, quantization Q4_K_M and a 4.9GB download, with a 128K context window supported by the model.

Quantization means the weights are stored with fewer bits to save memory and disk. The tags page lists the other 8B instruct builds if you want a different trade-off, among them:

TagQuantizationDownload size
8b-instruct-q2_Kq2_K3.2GB
8b-instruct-q3_K_Mq3_K_M4.0GB
8b-instruct-q4_K_M (default)q4_K_M4.9GB
8b-instruct-q5_K_Mq5_K_M5.7GB
8b-instruct-q8_0q8_08.5GB
8b-instruct-fp16fp1616GB

We measured only the default Q4_K_M. Smaller builds need less RAM and lose some quality; we have not tested whether q2_K or q3_K_M fit a 4 GB server.

Our measurements on five CPU servers

Setup: Ollama 0.40.14, installed natively, CPU only, on Hetzner Cloud in Helsinki with Ubuntu 24.04. One fixed prompt, a 256-token answer, temperature 0, seed 42. We report the second run for speed, so the model is already loaded. RAM is total system memory in use (from free -m) while the model was loaded, so it includes Ubuntu itself.

ServerModelGeneration
tokens/s
Prompt
tokens/s
Load timeRAM used (system)Note
Hetzner CX232 vCPU · 4 GB · x86_64Llama 3.1 8Bdid not run–––OOM-killed after ~50 s: Ollama fit check reported it would leave 1698 MiB free,
Hetzner CX334 vCPU · 8 GB · x86_64Llama 3.1 8B6.3258.610.0 s5,941 MiB
Hetzner CX438 vCPU · 15 GB · x86_64Llama 3.1 8B9.7447.47.9 s6,023 MiB
Hetzner CAX112 vCPU · 4 GB · aarch64Llama 3.1 8Bdid not run–––llama-server process has terminated: exit status 1: ggml_aligned_malloc: insuffi
Hetzner CAX214 vCPU · 8 GB · aarch64Llama 3.1 8B5.7226.512.3 s5,796 MiB

Measured by AI Hosting Lab on 2026-11-05 · 5 servers · method · raw data

CX336.3CX439.7CAX215.7
Llama 3.1 8B: tokens/s (higher is better) · x86 ARM

Reading the numbers:

  • CX43 (8 vCPU, 16 GB): 9.7 tokens/s generation, 447.4 tokens/s prompt reading, 7.9 s load, 6023 MiB RAM used.
  • CX33 (4 vCPU, 8 GB): 6.3 tokens/s, 258.6 tokens/s prompt, 10 s load, 5941 MiB.
  • CAX21 (4 ARM vCPU, 8 GB): 5.7 tokens/s, 226.5 tokens/s prompt, 12.3 s load, 5796 MiB.
  • CX23 and CAX11 (2 vCPU, 4 GB): no result. Details below.

What 6.3 tokens/s feels like: a 256-token answer takes about 41 seconds. At 9.7 tokens/s it takes about 26 seconds. For background jobs that is fine; for a live chat it feels slow. Doubling the vCPUs from the CX33 to the CX43 raised speed from 6.3 to 9.7 tokens/s, about half again, not double.

Why it failed on 4 GB

This is the part most guides cannot show, because they never tried. Both 4 GB servers failed, in two different ways.

x86: Hetzner CX23, killed after about 50 seconds

Ollama checks whether a model fits before loading it. On the CX23 it reported the model would leave 1698 MiB free and started loading. About 50 seconds later the kernel's OOM killer (OOM: out of memory) stopped llama-server, with 3.5 GB of anonymous memory in use. The server had no swap. In practice your request waits, then returns an error instead of an answer.

ARM: Hetzner CAX11, failed at once

On the CAX11 the error came immediately: llama-server process has terminated: exit status 1: ggml_aligned_malloc: insufficient memory (attempted to allocate 4402.48 MB). A clean failure, at least: nothing else on the server was disturbed.

The lesson: Ollama's fit check is an estimate. On the x86 box it said yes and was wrong. Size by measured RAM, not by the estimate, and leave headroom. We have not tested the 4 GB servers with swap added.

Minimum and comfortable server

Minimum: 8 GB, 4 vCPU

Our pick is the Hetzner CX33 at 10.27 € a month: 6.3 tokens/s with 5941 MiB of 7751 MiB used, so about 1810 MiB stays free. That is enough for the model and a light API in front of it. It is not enough for n8n plus the model with real headroom. The ARM CAX21 at 12.69 € works too, slightly slower at 5.7 tokens/s.

Comfortable: 16 GB, 8 vCPU

The Hetzner CX43 at 19.35 € a month: 9.7 tokens/s, and with 6023 MiB used out of 15613 MiB it has room for n8n, a database or a second, smaller model. This is the size we suggest if the server does anything besides serving the model.

Prices, gross from the Hetzner Cloud API, Helsinki, checked 5 November 2026:

PlanCPUvCPURAMDiskPer month excl. VATPer month incl. 21% VATPer hour incl. VAT
CAX11arm24 GB40 GB5.99 €7.25 €0.0116 €
CAX21arm48 GB80 GB10.49 €12.69 €0.0203 €
CAX31arm816 GB160 GB20.99 €25.40 €0.0407 €
CAX41arm1632 GB320 GB40.99 €49.60 €0.0795 €
CCX13x8628 GB80 GB42.99 €52.02 €0.0834 €
CCX23x86416 GB160 GB85.99 €104.05 €0.1667 €
CCX33x86832 GB240 GB138.49 €167.57 €0.2685 €
CCX43x861664 GB360 GB275.99 €333.95 €0.5352 €
CCX53x8632128 GB600 GB533.49 €645.52 €1.0346 €
CCX63x8648192 GB960 GB853.49 €1,032.72 €1.6550 €
CPX11x8622 GB40 GB5.49 €6.64 €0.0106 €
CPX02x8611 GB20 GB5.99 €7.25 €0.0116 €
CPX21x8634 GB80 GB9.49 €11.48 €0.0184 €
CPX12x8612 GB40 GB11.49 €13.90 €0.0223 €
CPX31x8648 GB160 GB17.49 €21.16 €0.0339 €
CPX22x8624 GB80 GB19.49 €23.58 €0.0378 €
CPX41x86816 GB240 GB32.49 €39.31 €0.0630 €
CPX32x8648 GB160 GB35.49 €42.94 €0.0688 €
CPX42x86816 GB320 GB69.49 €84.08 €0.1348 €
CPX51x861632 GB360 GB70.99 €85.90 €0.1377 €
CPX52x861224 GB480 GB100.49 €121.59 €0.1948 €
CPX62x861632 GB640 GB129.99 €157.29 €0.2520 €
CX23x8624 GB40 GB5.49 €6.64 €0.0106 €
CX33x8648 GB80 GB8.49 €10.27 €0.0165 €
CX43x86816 GB160 GB15.99 €19.35 €0.0310 €
CX53x861632 GB320 GB29.49 €35.68 €0.0572 €

From the Hetzner Cloud API, location hel1, checked 2026-11-05. "Incl. VAT" is what our Czech (EU consumer) account pays; businesses and buyers outside the EU usually pay the price excl. VAT. Primary IPv4 is billed separately.

To size a mixed server, tick the model and your other apps in the calculator. It adds our measured RAM for each part and names the cheapest tested server that fits with 15% headroom:

Prompt length matters too

Generation speed is only half of the wait. Before the model writes anything, it reads your prompt. We measured prompt reading at 447.4 tokens/s on the CX43, 258.6 tokens/s on the CX33 and 226.5 tokens/s on the CAX21. A 1,000-token prompt, such as a pasted email thread or a document chunk for search, therefore takes about 2.2 seconds to read on the CX43 and about 3.9 seconds on the CX33 before the first word appears. For short questions this is negligible; for document workflows it adds up.

Llama 3.1 8B or a smaller model?

On the same servers, the smaller Llama 3.2 models were much faster and lighter. Here is the 8B next to Llama 3.2 3B on the two servers where both ran:

ServerLlama 3.2 3BLlama 3.1 8B
CX33 (4 vCPU, 8 GB)13.5 tokens/s, 3068 MiB used6.3 tokens/s, 5941 MiB used
CX43 (8 vCPU, 16 GB)21.2 tokens/s, 3196 MiB used9.7 tokens/s, 6023 MiB used

The 3B model also ran on both 4 GB servers, which the 8B could not. Pick the 8B when answer quality on open-ended questions matters more than speed, for example drafting text or answering from a longer context. Pick the 3B for classification, extraction, routing and short summaries, where it is roughly twice as fast on the same hardware and leaves RAM for other apps. Skip the 8B on CPU entirely if you need replies in a few seconds for several users at once.

Things that change the requirement

  • Context length. Ollama's FAQ says it uses a 4096-token context window by default. The model supports 128K, but a longer context needs more memory. Our numbers are at the default; we have not measured long contexts yet.
  • Parallel requests. Ollama processes 1 request per model at a time by default (OLLAMA_NUM_PARALLEL). More parallel requests need more memory.
  • Keep-alive. By default a model unloads after 5 minutes idle. The next request pays the load time again: 7.9 s to 12.3 s on our servers.
  • GPU. With a GPU, the model would sit in VRAM instead; we have not tested GPU servers yet. Our view on when that pays off is in CPU vs GPU for LLM.

Install and run it

These are the commands our benchmark used on each server:

curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.1:8b

Pulling the 4.9GB model took 13.6 s on the CX43, 18.6 s on the CX33 and 17.1 s on the CAX21. Then call it through the local API on port 11434, which is how our test sent its prompt.

Next step: follow our Ollama install guide to set it up on an 8 GB or 16 GB server with the settings used in these tests.

Hetzner prices on this page include 21% VAT, as charged to our Czech (EU consumer) account by the Hetzner API on 2026-11-05. Without VAT (businesses, most buyers outside the EU): CX23 5.49 €, CX33 8.49 €, CX43 15.99 €, CAX11 5.99 €, CAX21 10.49 € per month.

FAQ

How much RAM does Llama 3.1 8B need?

With Ollama's default Q4_K_M build and default settings, our 8 GB servers used 5796 to 5941 MiB of total system RAM with the model loaded, and our 16 GB server 6023 MiB. Both 4 GB servers failed. Plan 8 GB as the minimum and 16 GB if anything else runs on the server.

Can Llama 3.1 8B run on a CPU without a GPU?

Yes. On CPU only, it generated 6.3 tokens/s on a Hetzner CX33 (4 vCPU, 8 GB) and 9.7 tokens/s on a CX43 (8 vCPU, 16 GB).

What quantization does ollama run llama3.1 use?

The default tag llama3.1:latest is the same as llama3.1:8b: 8.03B parameters, Q4_K_M quantization, a 4.9GB download, as listed on ollama.com on 5 November 2026.

Will Llama 3.1 8B run on a 4 GB VPS?

Not in our tests. On a 4 GB x86 server it was OOM-killed after about 50 seconds, and on a 4 GB ARM server it failed at once trying to allocate 4402.48 MB.

Sources

  1. Ollama, llama3.1 model library page (2026)
  2. Ollama, llama3.1 tags (2026)
  3. Ollama, llama3.1:8b model details (2026)
  4. Ollama Docs, FAQ (2026)