Table of Contents
Full CUDA LLM stack on the RTX 5070: vLLM with PagedAttention, llama.cpp CUDA, TensorRT-LLM, FlashAttention 3, bitsandbytes INT4/INT8. 12 GB GDDR7 at 672 GB/s delivers ~75 tok/s on Llama 3.1 8B Q4. Main limit: 12 GB max — 7B FP16 and above doesn’t fit. FP8 (Blackwell-native) is the recommended production precision: halves VRAM vs FP16, retains 99% quality.
The CUDA Inference Stack
The RTX 5070 runs every major LLM inference framework without modification:
| Framework | RTX 5070 support | Notes |
|---|---|---|
| llama.cpp (CUDA) | Full | Build with -DGGML_CUDA=ON |
| Ollama | Full, automatic | No config needed |
| vLLM | Full — CUDA + FlashAttention 3 | PagedAttention, continuous batching |
| TensorRT-LLM | Full — Blackwell optimised | FP8/FP4 Tensor Core paths |
| HuggingFace transformers | Full | Standard .to("cuda") |
| bitsandbytes | Full — INT4/INT8 GPU | QLoRA fine-tuning also works |
| FlashAttention 3 | Full — Blackwell native | Significant speedup vs FA2 |
| Unsloth | Full | Fast fine-tuning framework |
| SGLang | Full | Structured generation runtime |
Model VRAM Table
| Model | FP16 VRAM | FP8 VRAM | Q4_K_M VRAM | Fits 12 GB? |
|---|---|---|---|---|
| Llama 3.1 8B | 16 GB ✗ | 8 GB ✓ | 5.2 GB ✓ | FP8 or Q4 |
| Mistral 7B | 14 GB ✗ | 7 GB ✓ | 4.4 GB ✓ | FP8 or Q4 |
| Gemma 2 9B | 18 GB ✗ | 9 GB ✓ | 5.8 GB ✓ | FP8 or Q4 |
| Qwen 2.5 7B | 14 GB ✗ | 7 GB ✓ | 4.4 GB ✓ | FP8 or Q4 |
| Qwen 2.5 14B | 28 GB ✗ | 14 GB ✗ | 8.7 GB ✓ | Q4 only |
| Llama 3 13B | 26 GB ✗ | 13 GB ✗ | 7.9 GB ✓ | Q4 only |
| DeepSeek-R1 7B | 14 GB ✗ | 7 GB ✓ | 4.4 GB ✓ | FP8 or Q4 |
| Llama 3.1 70B | 140 GB ✗ | 70 GB ✗ | 41 GB ✗ | No |
FP8 is the recommended production precision on Blackwell. It halves VRAM vs FP16, enabling models that technically wouldn’t fit at FP16 to fit at FP8, and Blackwell’s 5th Gen Tensor Cores run FP8 natively with no performance penalty versus INT8.
LlamaCPP CUDA Setup
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
mkdir build && cd build
cmake .. -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Run Llama 3.1 8B Q4_K_M (all 32 layers on GPU)
./bin/llama-cli \
-m /models/llama-3.1-8b-instruct-q4_k_m.gguf \
-ngl 32 \
-c 8192 \
--temp 0.7 \
-p "You are a helpful assistant." \
--interactive
# HTTP server (OpenAI-compatible)
./bin/llama-server \
-m /models/llama-3.1-8b-instruct-q4_k_m.gguf \
-ngl 32 \
-c 8192 \
--host 0.0.0.0 --port 8080
Set -ngl to the total number of transformer layers in your model (32 for 7–8B models, 40 for 13B). All layers go to GPU — CPU offload is only needed if the model exceeds 12 GB, which at Q4_K_M means models larger than ~20B.
vLLM Setup
vLLM’s PagedAttention and continuous batching are well-supported on Blackwell. Install and run:
pip install vllm
# Serve Llama 3.1 8B at FP8 (Blackwell-optimised)
vllm serve meta-llama/Meta-Llama-3.1-8B-Instruct \
--dtype fp8 \
--max-model-len 8192 \
--gpu-memory-utilization 0.90 \
--host 0.0.0.0 --port 8000
# Or serve at Q4 via GGUF
vllm serve /models/llama-3.1-8b-instruct-q4_k_m.gguf \
--tokenizer meta-llama/Meta-Llama-3.1-8B-Instruct \
--max-model-len 4096 \
--host 0.0.0.0 --port 8000
For Qwen 2.5 14B at Q4 (8.7 GB weights), use --gpu-memory-utilization 0.85 to leave headroom for KV cache:
vllm serve Qwen/Qwen2.5-14B-Instruct \
--quantization gptq \
--max-model-len 4096 \
--gpu-memory-utilization 0.85 \
--host 0.0.0.0 --port 8000
OpenAI-Compatible Serving
Both llama.cpp server and vLLM expose OpenAI-compatible endpoints. To call from a client:
from openai import OpenAI
# Point at your local server (llama.cpp or vLLM)
client = OpenAI(base_url="http://localhost:8080/v1", api_key="unused")
response = client.chat.completions.create(
model="llama-3.1-8b-instruct",
messages=[{"role": "user", "content": "What is Blackwell FP8?"}],
temperature=0.7,
max_tokens=512
)
print(response.choices[0].message.content)
FP8 Inference on Blackwell
Blackwell’s 5th Gen Tensor Cores natively compute FP8 matrix operations. For LLM inference this means:
- Llama 3.1 8B FP8: ~8 GB VRAM (vs 16 GB at FP16) — fits on 12 GB with 4 GB for KV cache at 8K context
- Mistral 7B FP8: ~7 GB — comfortable
- Gemma 2 9B FP8: ~9 GB — fits with ~3 GB KV budget
- Quality loss vs FP16: typically <1% on standard benchmarks
FP8 is superior to INT8 for inference quality on Blackwell because it maintains a floating-point exponent — key for the wide dynamic range in transformer attention layers. Use --dtype fp8 in vLLM or the AutoFP8 quantisation library for on-the-fly FP8 quantisation.
Throughput Estimates
| Model | Framework | Precision | Est. tok/s (decode) |
|---|---|---|---|
| Llama 3.1 8B | llama.cpp | Q4_K_M | ~75–85 |
| Llama 3.1 8B | vLLM | FP8 | ~80–95 |
| Mistral 7B | llama.cpp | Q4_K_M | ~80–90 |
| Qwen 2.5 14B | llama.cpp | Q4_K_M | ~45–55 |
| Llama 3 13B | llama.cpp | Q4_K_M | ~50–60 |
| Gemma 2 9B | vLLM | FP8 | ~65–75 |
RTX 5070 vs RTX 3090 for LLM
| Factor | RTX 5070 (£139/mo) | RTX 3090 (£159/mo) |
|---|---|---|
| VRAM | 12 GB | 24 GB |
| Bandwidth | ~672 GB/s | 936 GB/s |
| Llama 8B Q4 tok/s | ~80 | ~65–70 |
| 7B at FP16 | No (12 GB) | Yes (24 GB) |
| FP8 inference | Native Blackwell | Limited (Ampere) |
| vLLM FlashAttention 3 | Yes | No (FA2 only) |
| Max model at Q4 | ~13B | ~27B |
| Price | £139/mo | £159/mo |
Interestingly, the RTX 5070 is faster per token than the RTX 3090 on smaller models at Q4 — Blackwell’s architecture and CUDA improvements outpace Ampere despite the lower raw bandwidth. But the 3090’s 24 GB VRAM wins decisively for 13B+ models at Q4 and any FP16 inference. See the full RTX 5070 vs RTX 3090 comparison.
Deploy LLM inference on RTX 5070
12 GB GDDR7 · vLLM + llama.cpp CUDA · FP8 Blackwell-native · £139/mo · Order the RTX 5070 or compare all GPUs.