# Running local LLMs on an RTX 3070 8GB: tokens/s, VRAM and power for eight models

> Ollama benchmarks on an RTX 3070 8GB: Gemma 3 (1B, 4B in three quantizations, 12B), Llama and Phi-4 mini. Speed, VRAM, cold start and power, two rounds each, plus the measurement traps I hit.

- Date: 2026-11-27
- Topics: AI, Performance
- Chinese original: https://kbs0830.com/blog/rtx-3070-local-llm-benchmark

The [VRAM calculator](/tools/vram) (in Chinese) can only estimate. At the bottom of that page I wrote "the numbers from actually running these will be written up separately". This post is those numbers: **one RTX 3070 8GB, eight models actually run with Ollama, measuring speed, VRAM and power.**

This card is the host for the site's [/ask assistant](/ask) (in Chinese), so choosing a model is not a hobby; it has to run there for the long term.

## The conclusion first

- **The sweet spot for 8GB is 3B to 4B**: Gemma 3 4B runs at about 96 tokens/s and the model takes 3.0GB of VRAM, still leaving room for the embedding model and the desktop
- **8B is borderline**: Llama 3.1 8B runs at about 75 tokens/s with a 5.5GB model, which with the desktop's 1.5GB is already 7GB, leaving no room for anything else
- **Do not use 12B**: Gemma 3 12B needs 8.9GB, only 59% of it is on the GPU, the rest is on the CPU, and speed drops to about 7 to 8 tokens/s, 13 times slower than 4B, with a 2.4 to 3.5 second wait for the first token
- **One answer costs very little electricity**: for 4B to generate an answer of about 300 tokens takes roughly 0.15 Wh; a thousand answers is under 0.2 kWh

## How I measured

| | |
|---|---|
| Machine | Desktop i7-12700, 32GB, RTX 3070 8GB, Windows 11; the desktop (including Parsec) already takes 1.5GB of VRAM at idle |
| Software | Ollama 0.40.18, with all models unloaded before measuring each one |
| Settings | temperature 0, seed 1; `num_ctx` 4096 for short prompts and 6144 for long ones (same as the site) |
| Short prompt | "Explain in three paragraphs why a self-hosted site needs health checks", generating 256 tokens |
| Long prompt | About 1,500 tokens of site article content plus a question, generating 120 tokens (simulating /ask with reference material) |
| Runs | Median of 3 per item, **the whole suite run twice**, with the table showing the range across the two rounds |
| Power | Whole-card power sampled by `nvidia-smi` every 250 ms (average while generating, with GPU use above 30%); idle is about 46W |

I only tested models from US companies: Google Gemma, Meta Llama and Microsoft Phi. That was my premise when choosing (no Chinese-made models), not a claim that the others are bad.

The script is in the repo: `scripts/bench-ollama.mjs`, and you can run it yourself with another model or another GPU.

## Results

The speed column uses the "long prompt" item (a 1,500-token prompt, generating 120 tokens). The reason is in "Measurement traps" below.

| Model | VRAM (ctx 6144) | Generation tokens/s | First-token wait for a 1,500-token prompt | Cold-start load | Whole-card power while generating | Energy per token |
|---|---|---|---|---|---|---|
| Gemma 3 1B | 0.95 GB | 196 to 198 | 0.14 s | 3.5 to 4.3 s | 123 to 125 W | 0.6 J |
| Llama 3.2 3B | 2.9 GB | 137 to 143 | 0.25 s | 4.8 to 11 s | 188 to 190 W | 1.4 J |
| Phi-4 mini (3.8B) | 3.5 GB | 116 | 0.28 s | 4.4 to 4.8 s | 172 to 180 W | 1.5 J |
| **Gemma 3 4B (default)** | **3.0 GB** | **96** | 0.4 s | 6.3 to 7.8 s | 167 to 177 W | 1.8 J |
| Gemma 3 4B QAT | 3.7 GB | 85 to 87 | 0.4 s | 6.5 to 7.2 s | 139 to 160 W | 1.7 J |
| Gemma 3 4B Q8_0 | 4.5 GB | 75 | 0.41 s | 7.2 to 7.4 s | 167 to 170 W | 2.3 J |
| Llama 3.1 8B | 5.6 GB | 74.5 | 0.51 s | 6 to 7 s | 204 W | 2.7 J |
| Gemma 3 12B | 5.3 GB (8.9 GB total, 59% on GPU) | 7.2 to 7.9 | 2.4 to 3.5 s | 11.7 to 12.6 s | 96 to 103 W | 13 J |

"Energy per token" is whole-card power divided by generation speed. It is only an estimate, and it includes the power the desktop was already using.

## A few findings worth telling

### Why 12B is 13 times slower, not 3 times

12B is 3 times the size of 4B, so intuitively it should be about 3 times slower. It was 13 times slower, because the 8.9GB model does not fit in an 8GB card (the desktop takes another 1.5GB). Ollama automatically puts some layers on the CPU, and on this card only 59% is on the GPU.

Two consequences are interesting:

- **The GPU waits for the CPU**: whole-card power is actually the lowest of all the models (about 100W), yet the energy per token is 7 times that of 4B
- **Prompt processing collapses too**: for a 1,500-token prompt, processing speed fell from about 4,000 tokens/s for 4B to around 600, so the first token takes 2.4 to 3.5 seconds. For chat, that hurts more than slow generation

So the rule for an 8GB card is not "the model file is under 8GB"; it is that **the model plus the KV cache plus the desktop all have to fit**.

### VRAM is more than what `ollama ps` shows

The SIZE in `ollama ps` counts only the model and the context. The real whole-card usage (the peak in `nvidia-smi`, including the desktop's 1.5GB): about 2.6GB for 1B, 6.3GB for 4B, 6.8GB for 8B and 7.5GB for 12B (in GiB). For Gemma 3 4B, whole-card usage is about 1.9GB more than the model itself, and for Llama 3.1 8B almost nothing more. I did not dig into why; I only warn: **leave room when planning VRAM, and do not add up the `ollama ps` numbers to exactly 8.**

### Three quantizations of 4B: trade-offs in speed and VRAM

Gemma 3 4B default, QAT (Google's quantization-aware-trained version) and Q8_0:

- VRAM: 3.0 → 3.7 → 4.5 GB
- Speed: 96 → 85 → 75 tokens/s

Q8_0 is 22% slower than the default and uses 1.5GB more, so there is no reason to use it on this card. QAT is somewhat slower than the default and uses 0.7GB more, **but answered better on the same question** (see below). That is why I want to compare once more later with the site's own test questions.

### Chinese quality: an observation on one question, not a ranking

I used the same long prompt to ask "Why did this site once go down? Answer in three sentences", with the reference material being the post [My site was down for 4 days](/en/blog/tunnel-down-four-days). **This is one question, judged right or wrong by me, and cannot be taken as a quality ranking**; it just records what I saw:

- **Gemma 3 1B**: made up a date and said a watchdog restart caused the outage, the opposite of the post. 1B is not suitable for answering factual questions
- **Gemma 3 4B default**: two of three points right; the first (a Next.js server restart closing the Tunnel) does not quite match the post
- **Gemma 3 4B QAT and Q8_0**: three sentences right: the Tunnel start command had no arguments, it did not recover after the reboot, and watchdog monitoring was added
- **Llama 3.2 3B**: all three points right, but in the short prompt it popped up with mainland-Chinese terms for "hardware" and "hard disk" instead of the Taiwanese ones
- **Phi-4 mini**: too brief, covering only half, with a mainland-style word for "application" in the short prompt and a nonsensical phrase meaning roughly "disk emptiness"
- **Llama 3.1 8B**: right, with details as well
- **Gemma 3 12B**: the most complete, but at that speed it is unusable

The Traditional Chinese wording is worth noticing: Llama and Phi mixed mainland usage into these outputs and Gemma did not (again only an observation from these few questions, with a very small sample). For a Traditional Chinese site, that is something to look at when picking a model, not only speed.

## Measurement traps I hit

### 1. Prompt caching made the number absurdly fake

The first version of the script measured "prompt processing speed for 1,541 tokens: 52,250 tokens/s", more than 4 times the real figure. The reason: the same prompt was sent 3 times in a row, and Ollama cached the prefix, so the last two barely needed any recomputation.

The fix: put a different number at the very **start** of every prompt, so the prefix changes and the cache cannot be used. After the fix it was 12,000 tokens/s (1B). If you see someone else's processing speed that is unreasonably high, think of this first.

### 2. A single measurement drifts 30%

For Gemma 3 4B default, the short-prompt speed was 78 in the first round and 103 in the second; for QAT, 94 in the first round and 66 in the second. With only one round I would have drawn the wrong conclusion: "QAT is 20% faster than default".

The long-prompt speeds, however, were very stable (96.5 vs 96.2, 87 vs 84.8, 75.5 vs 74.5). The other models differed by under 5% between rounds, and **only the short-prompt speeds of these three Gemma 3 4B variants drift**, and I do not know why. So:

- The speeds in the table use the steadier "long prompt" item
- Every number is run at least twice and read as a range
- A metric whose two rounds disagree is not used for ranking

### 3. Power is the whole card, not the model

`nvidia-smi` measures the whole card's power, which is already 46W at idle. So "energy per token" is an upper bound, and when GPU use is below 100% (especially for small models), the smaller the model, the more this number is pushed up by the fixed draw.

## What the site uses now

I chose **Gemma 3 4B (default)** as the chat model, with embeddinggemma for retrieval, based on the conclusions above: fast enough, 3GB of VRAM leaves room for the embedding model and the desktop, and no mixed-in mainland wording. The whole local AI story is in these posts:

1. [A local AI chat API for a personal site](/en/blog/local-ai-ollama-gemma-chat-api): model choice, the chat API, cold start
2. [Making a 4B model answer from my own site](/en/blog/local-ai-ask-small-model-knowledge-base): retrieval, prompts, sources
3. [Beyond chat](/en/blog/local-ai-embedding-search-404-mcp): Ctrl+K semantic search, 404 suggestions, an MCP tool
4. [An AI-written radar daily note](/en/blog/radar-ai-daily-report-numbers-by-code): the code owns the numbers, the model only writes the sentences
5. [Logging what visitors ask without collecting personal data](/en/blog/ask-log-without-collecting-personal-data): the question log and masking

## What this benchmark does not cover

- **Several people asking at once**: the site limits it to at most 2 generations at a time, and I did not measure the speed with two requests running together
- **Longer context**: I only tested 4,096 and 6,144
- **Bigger models such as gpt-oss:20b**: about 14GB, which does not fit on this card, so not tested
- **Quality**: Chinese quality is an observation on one question, with no systematic evaluation
- **Electricity cost**: to convert it to money you can use the [electricity cost calculator](/tools/power-cost) (in Chinese), but I measured whole-card power, not the whole computer

---

Author: PINGWEI LI (李秉威, Li Ping-Wei)
Original page: https://kbs0830.com/en/blog/rtx-3070-local-llm-benchmark
