Modell-Hardware-Matrix
Modelle, Quantisierung, VRAM und realistische Setups.
Modelle, Quantisierung, VRAM und realistische Setups. Lies zuerst die Kurzantwort und springe danach in die technische Herleitung.

Kapitel 6: Die Matrix – Welches Modell auf welcher Hardware?
Die Dimensionierung eines produktiven lokalen KI-Systems erfordert eine exakte Kalkulation des VRAM-Bedarfs. Der Gesamtspeicher im VRAM setzt sich aus drei Komponenten zusammen:
- Modellgewichte (abhängig von Parameteranzahl und Quantisierungsstufe)
- Key-Value-Cache (KV-Cache) (abhängig von Kontextlänge, Batch-Size, Layer-Anzahl, Attention-Heads und KV-Quantisierung)
- Aktivierungs- und CUDA-Runtime-Overhead (typischerweise 1,0 bis 2,5 GB Puffer)
$$\text{VRAM}{\text{gesamt}} = \text{VRAM}{\text{Modell}} + \text{VRAM}{\text{KV-Cache}}(N{\text{ctx}}, B) + \text{VRAM}_{\text{Overhead}}$$
6.1 Mathematische Berechnung des KV-Cache-Speicherbedarfs
Für Transformer-Architekturen mit Multi-Head Attention (MHA) bzw. Grouped-Query Attention (GQA) berechnet sich der Speicherbedarf des KV-Caches pro Token exakt wie folgt:
$$\text{KV-Bytes pro Token} = 2 \times n_{\text{layers}} \times n_{\text{kv_heads}} \times d_{\text{head}} \times b_{\text{kv}}$$
- Faktor $2$: Jeweils ein Tensor für Key und Value.
- $n_{\text{layers}}$: Anzahl der Transformer-Layer.
- $n_{\text{kv_heads}}$: Anzahl der Key/Value-Attention-Heads (bei GQA deutlich kleiner als die Query-Heads $n_{\text{heads}}$).
- $d_{\text{head}}$: Dimension eines Attention-Heads ($d_{\text{head}} = d_{\text{model}} / n_{\text{heads}}$).
- $b_{\text{kv}}$: Bytes pro Element (FP16 = 2 Bytes, FP8 = 1 Byte, Q4 = 0.5 Bytes).
Der gesamte KV-Cache-Bedarf für eine maximale Kontextlänge $N_{\text{ctx}}$ und Batch-Size $B$ beträgt:
$$\text{VRAM}{\text{KV-Cache}} [\text{GB}] = \frac{B \times N{\text{ctx}} \times \text{KV-Bytes pro Token}}{1024^3}$$
Beispiel: Llama 3.3 70B (Grouped-Query Attention)
- $n_{\text{layers}} = 80$
- $n_{\text{heads}} = 64$, $n_{\text{kv_heads}} = 8$ (GQA Verhältnis 8:1)
- $d_{\text{head}} = 128$
- FP16 KV-Cache ($b_{\text{kv}} = 2 \text{ Bytes}$)
$$\text{KV-Bytes pro Token} = 2 \times 80 \times 8 \times 128 \times 2 = 327.680 \text{ Bytes} \approx 320 \text{ KB / Token}$$
| Kontextlänge ($N_{\text{ctx}}$) | Batch-Size ($B$) | KV-Cache VRAM (FP16) | KV-Cache VRAM (FP8) | KV-Cache VRAM (Q4_0) |
|---|---|---|---|---|
| 8.192 (8k) | 1 | 2,50 GB | 1,25 GB | 0,63 GB |
| 32.768 (32k) | 1 | 10,00 GB | 5,00 GB | 2,50 GB |
| 131.072 (128k) | 1 | 40,00 GB | 20,00 GB | 10,00 GB |
| 8.192 (8k) | 4 | 10,00 GB | 5,00 GB | 2,50 GB |
| 32.768 (32k) | 4 | 40,00 GB | 20,00 GB | 10,00 GB |
[Architektur-Hinweis] FlashAttention und KV-Cache-Quantisierung
Standardmäßig allozieren viele Inferenz-Server den KV-Cache in FP16. In vLLM wird der Datentyp je nach Version über `--kv-cache-dtype fp8` konfiguriert; in llama.cpp existieren separate Optionen für Key- und Value-Cache, deren Verfügbarkeit vom Build abhängt. FP8/INT8 kann den Speicherbedarf ungefähr halbieren, bringt aber einen Genauigkeits- und Kompatibilitäts-Trade-off. Die 128k-Zeile ist deshalb eine Kapazitätsrechnung, keine Zusage für ein bestimmtes 48-GB-Setup.
6.2 Die umfassende Modell-Hardware-Matrix (Stand 2026)
Die folgende Referenztabelle deckt alle maßgeblichen State-of-the-Art-Architekturen ab:
- 8B Klasse: Llama 3.1 8B / Qwen 2.5 7B / Gemma 2 9B
- 14B Klasse: Qwen 2.5 14B / Pixtral 12B
- 32B Klasse: Qwen 2.5 32B / Qwen 2.5-Coder 32B
- 70B Klasse: Llama 3.3 70B / Qwen 2.5 72B
- MoE Klasse: Mixtral 8x7B (47B sparse, 13B aktiv)
- Flagship MoE: DeepSeek-V3 / DeepSeek-R1 (671B Total, 37B aktiv)
Matrix: Modellgröße $\times$ Quantisierung $\times$ VRAM $\times$ Hardware
| Modell & Architektur | Quantisierung | Reines Modell-Gewicht | VRAM inkl. 8k Cache (FP16) | VRAM inkl. 32k Cache (FP16) | VRAM inkl. 128k Cache (FP8) | Empfohlene Mindest-Hardware | Typischer Durchsatz (Batch=1) |
|---|---|---|---|---|---|---|---|
| Llama 3.1 8B | Q4_K_M | 4,9 GB | 6,5 GB | 8,5 GB | 10,5 GB | RTX 3060 12GB / Apple M4 (16GB) | 65 - 95 t/s (GPU) |
| (Dense, GQA) | Q8_0 | 8,5 GB | 10,1 GB | 12,1 GB | 14,1 GB | RTX 4060 Ti 16GB / RTX 4070 | 45 - 65 t/s (GPU) |
| FP16 | 16,0 GB | 17,6 GB | 19,6 GB | 21,6 GB | RTX 3090 / 4090 24GB | 50 - 70 t/s (GPU) | |
| Qwen 2.5 14B | Q4_K_M | 8,9 GB | 11,2 GB | 14,5 GB | 16,2 GB | RTX 4060 Ti 16GB / RTX 4070 Ti S | 40 - 55 t/s (GPU) |
| (Dense, GQA) | Q8_0 | 15,2 GB | 17,5 GB | 20,8 GB | 22,5 GB | RTX 3090 / 4090 24GB | 35 - 45 t/s (GPU) |
| FP16 | 29,0 GB | 31,3 GB | 34,6 GB | 36,3 GB | 2x RTX 3090 / Mac M4 Max 64GB | 28 - 38 t/s (Multi-GPU) | |
| Qwen 2.5 32B | Q4_K_M | 19,8 GB | 22,5 GB | 26,5 GB | 28,0 GB | RTX 3090 / 4090 24GB (bis 16k) | 28 - 38 t/s (GPU) |
| (Dense, GQA) | Q8_0 | 34,2 GB | 36,9 GB | 40,9 GB | 42,4 GB | 2x RTX 3090 / RTX 6000 Ada / Mac 64G | 22 - 30 t/s (Multi-GPU) |
| (Coder 32B) | FP16 | 65,0 GB | 67,7 GB | 71,7 GB | 73,2 GB | 4x RTX 3090 / Mac M2 Ultra 128GB | 14 - 20 t/s (Multi-GPU) |
| Mixtral 8x7B | Q4_K_M | 26,4 GB | 29,5 GB | 34,5 GB | 36,0 GB | 2x RTX 3090 / Mac M3 Max 64GB | 40 - 55 t/s (Sparse MoE) |
| (MoE 47B/13B act.) | Q8_0 | 49,5 GB | 52,6 GB | 57,6 GB | 59,1 GB | 3x RTX 3090 / Mac M2 Ultra 128GB | 25 - 35 t/s (Sparse MoE) |
| FP16 | 94,0 GB | 97,1 GB | 102,1 GB | 103,6 GB | 4x RTX 3090 / 2x A100 80GB | 18 - 25 t/s (Multi-GPU) | |
| Llama 3.3 70B | Q3_K_M | 31,5 GB | 34,8 GB | 42,3 GB | 42,5 GB | 2x RTX 3090 / 2x RTX 4090 (48 GB) | 24 - 32 t/s (2x GPU) |
| (Dense, GQA) | Q4_K_M | 39,6 GB | 42,9 GB | 50,4 GB | 50,6 GB | 2x RTX 3090 / Mac M4 Max 128GB | 18 - 26 t/s (2x GPU) |
| (Qwen 2.5 72B) | Q8_0 | 74,5 GB | 77,8 GB | 85,3 GB | 85,5 GB | 4x RTX 3090 (96 GB) / Mac M2 Ultra | 12 - 18 t/s (4x GPU) |
| FP16 | 141,0 GB | 144,3 GB | 151,8 GB | 152,0 GB | 2x A100 80GB / 2x H100 / Mac 192GB | 10 - 15 t/s (Cluster) | |
| DeepSeek-V3/R1 | UD-Q2_K | 180 GB | 192 GB | 215 GB | 205 GB | Mac M2 Ultra 192GB / 8x RTX 3090 | 12 - 16 t/s (Sparse MoE) |
| (MoE 671B/37B act.) | Q4_K_M | 385 GB | 398 GB | 425 GB | 412 GB | 2x Mac Studio 192G / 8x A100 80GB | 8 - 14 t/s (Cluster) |
| FP8 (Native) | 671 GB | 685 GB | 710 GB | 698 GB | 8x H100 80GB SXM5 (HGX) | 35 - 55 t/s (HGX vLLM) |
[Deep Dive] Warum MoE-Modelle (Mixtral / DeepSeek) trotz gigantischer Größe extrem schnell generieren
Bei dichten Modellen (Dense) müssen für jedes Token 100% aller Gewichte durch den Speicherbus geschleust werden.
Bei Sparse Mixture-of-Experts (MoE) wird für jedes Token nur ein Router-Subset der Parameter aktiviert:
- Mixtral 8x7B: 47B Gesamt-Parameter im VRAM, aber nur 13B aktivierte Parameter pro Token.
- DeepSeek-V3: 671B Gesamt-Parameter im VRAM, aber nur 37B aktivierte Parameter pro Token.
Inferenz-Konsequenz:
Der VRAM-Bedarf skaliert mit den GESAMTPARAMETERN (Modell muss komplett in den VRAM passen).
Die Token-Generierungsgeschwindigkeit (ITL) skaliert jedoch mit den AKTIVEN PARAMETERN!
Ein Mixtral 8x7B generiert daher bei gleichem Speicher fast so schnell wie ein 14B-Modell.
6.3 Konkrete Auslegungs-Rechenbeispiele für Standard-Szenarien
Szenario A: Einzelentwickler / Power-User (Local Coding Agent & RAG)
Anforderungsprofil:
- Use Case: Autonome Code-Vervollständigung, Agentic Workflows (z. B. Aider, Cline), lokales Dokumenten-RAG.
- Modell-Ziel: Qwen 2.5-Coder 32B (Q4_K_M) oder Llama 3.3 70B (Q3_K_M).
- Kontextanforderung: 16.384 bis 32.768 Tokens für vollständige Quellcodedateien.
- Gleichzeitige Nutzer: 1 Nutzer (Batch-Size = 1).
- Ziel-Latenz: $\ge 25 \text{ Tokens/s}$ (flüssiges Lesen/Agentic Feedback).
Mathematische VRAM-Kalkulation (Qwen 2.5-Coder 32B @ 32k Context):
- Modellgewicht ($M_{\text{weights}}$): $19{,}8 \text{ GB}$ (Q4_K_M)
- KV-Cache ($32.768 \text{ Tokens}$, FP8-Quantisierung):
$$\text{KV-Bedarf} = \frac{1 \times 32768 \times (2 \times 64 \times 8 \times 128 \times 1)}{1024^3} = 4{,}00 \text{ GB}$$ - CUDA Context & Framework Overhead: $1{,}2 \text{ GB}$
- Gesamter VRAM-Bedarf: $19{,}8 + 4{,}00 + 1{,}2 = 25{,}00 \text{ GB}$
Empfohlenes Hardware-Setup & Kostenanalyse:
- Option 1 (Desktop PC - Sweet Spot):
- GPU: $1 \times \text{NVIDIA GeForce RTX 4090 24GB}$ (Modell leicht reduziert auf 24k Context) oder $1 \times \text{NVIDIA GeForce RTX 5090 32GB}$
- CPU / RAM: AMD Ryzen 7 7800X3D, 64 GB DDR5-6000 RAM, 2 TB PCIe 4.0 NVMe SSD
- Netzteil: 1000 W (ATX 3.0 / PCIe 5.0 12VHPWR)
- Geschätzte Hardwarekosten: ca. 2.600 € (RTX 4090) bzw. 3.200 € (RTX 5090)
- Erreichter Durchsatz: $\approx 35 \text{ Tokens/s}$ (RTX 4090) / $\approx 55 \text{ Tokens/s}$ (RTX 5090)
- Option 2 (Apple Silent Workstation):
- Hardware: Mac Studio M4 Max (64 GB Unified Memory, 410 GB/s)
- Geschätzte Hardwarekosten: ca. 2.400 €
- Erreichter Durchsatz: $\approx 22 \text{ Tokens/s}$ (vollständig lautlos, 65 Watt)
Szenario B: 5-Personen-Entwicklungsteam (Zentralisierter lokaler Inferenz-Server)
Anforderungsprofil:
- Use Case: Gemeinsamer OpenAI-kompatibler API-Endpunkt für IDEs, Ticket-Klassifizierung und interne RAG-Suche.
- Modell-Ziel: Llama 3.3 70B (Q4_K_M) oder Qwen 2.5 72B (Q4_K_M).
- Kontextanforderung: 8.192 Tokens pro Request.
- Concurrency: 5 parallele Requests (Continuous Batching via vLLM oder SGLang).
- Ziel-Latenz: $\ge 15 \text{ Tokens/s}$ pro aktivem Stream.
Mathematische VRAM-Kalkulation (Llama 3.3 70B @ Batch=5, 8k Context):
- Modellgewicht ($M_{\text{weights}}$): $39{,}6 \text{ GB}$ (Q4_K_M / AWQ 4-Bit)
- KV-Cache ($B = 5$, $N_{\text{ctx}} = 8.192$, FP16 Paged Attention):
$$\text{KV-Bedarf} = 5 \times 2{,}50 \text{ GB} = 12{,}50 \text{ GB}$$ - vLLM Paged-Memory-Buffer & CUDA-Kernels: $3{,}5 \text{ GB}$
- Gesamter VRAM-Bedarf: $39{,}6 + 12{,}50 + 3{,}5 = 55{,}60 \text{ GB}$
Empfohlenes Hardware-Setup:
- GPU-Konfiguration: $2 \times \text{NVIDIA RTX 4090 24GB}$ ($48 \text{ GB}$ VRAM - reicht für Batch=2) oder ideal $3 \times \text{NVIDIA RTX 3090 24GB}$ ($72 \text{ GB}$ VRAM) bzw. $2 \times \text{RTX 6000 Ada 48GB}$ ($96 \text{ GB}$ VRAM).
- Plattform: AMD Threadripper 7960X (24 Cores, 128 PCIe 5.0 Lanes) auf TRX50 Mainboard.
- System-RAM: 128 GB Quad-Channel DDR5-5600 ECC.
- Netzteil: 1600 W BeQuiet / Seasonic Titanium.
- Serving-Stack: vLLM mit Tensor Parallelism = 2 oder 3 (
--tensor-parallel-size 2/3). - Erreichter Gesamt-Durchsatz: $\approx 95\text{--}130 \text{ Tokens/s}$ aggregiert über alle 5 Nutzer.
[Praxis-Tipp] Multi-User-Dimensionierung mit Continuous Batching
Im Multi-User-Betrieb skaliert die Inferenz-Effizienz drastisch nach oben:
Während bei Batch=1 die GPU 99% der Zeit auf VRAM-Transfers wartet, liest die GPU bei Batch=5 dieselben Modellgewichte EINMAL aus dem VRAM und wendet sie parallel auf 5 Token-Vektoren an.
Die Arithmetic Intensity steigt um das Fünffache!
Der Gesamtdurchsatz des Servers steigt von 25 t/s (Batch=1) auf ca. 110 t/s (Batch=5 aggregiert), während die Latenz pro Nutzer nur geringfügig von 25 t/s auf 22 t/s absinkt.
Szenario C: 20-Personen-Unternehmensabteilung (Enterprise On-Premise Cluster)
Anforderungsprofil:
- Use Case: Vollständiger Ersatz externer Cloud-APIs (DSGVO-konform, On-Premise). Gleichzeitige Workloads: Coding Agents, Kundenservice-Transkription (Whisper large-v3-turbo), Embedding-Generierung, 70B Text-Modell und Vision-Verarbeitung (Pixtral 12B).
- Concurrency: Bis zu 20 gleichzeitige Anfragen mit Lastspitzen.
- Hochverfügbarkeit: 24/7 Betrieb, redundante Netzteile, ECC-Speicher.
- Ziel-Throughput: Aggregiert $\ge 350 \text{ Tokens/s}$.
+-----------------------------------------------------------------------------+
| ENTERPRISE 20-PERSONEN SERVER ARCHITEKTUR |
+-----------------------------------------------------------------------------+
| |
| [Reverse Proxy & Load Balancer (Nginx / Envoy / LiteLLM Proxy)] |
| | |
| +-----------------------+-----------------------+ |
| | | | |
| [Instanz 1: LLM Serving] [Instanz 2: Vision/Embed] [Instanz 3: Audio STT] |
| vLLM / TensorRT-LLM vLLM (Pixtral 12B + BGE) Faster-Whisper |
| Llama 3.3 70B (FP8) Pixtral + BGE-M3 Whisper-large-v3-turbo |
| $2\times \text{A100 80GB}$ $1\times \text{RTX 4090 / A4000}$ $1\times \text{RTX 4000 Ada}$ |
| (160 GB HBM2e) (24 GB GDDR6X) (20 GB GDDR6) |
| |
| +-----------------------------------------------------------------------+ |
| | Hardware-Basis: 4U Rackmount Server, Dual AMD EPYC 9354 (64 Cores) | |
| | 512 GB Octa-Channel DDR5-4800 ECC, Dual 2000W Redundant PSU | |
| +-----------------------------------------------------------------------+ |
| |
+-----------------------------------------------------------------------------+
Mathematische Ressourcen-Aufteilung:
- LLM-Hauptdienst (Llama 3.3 70B FP8):
- Modellgewicht (FP8 nativ): $70{,}6 \text{ GB}$
- KV-Cache ($B = 20$, $N_{\text{ctx}} = 8.192$, FP8 Paged Attention):
$$\text{KV-Bedarf} = 20 \times 1{,}25 \text{ GB} = 25{,}0 \text{ GB}$$ - Paged-Cache Puffer: $30{,}0 \text{ GB}$
- Speicherbedarf: $125{,}6 \text{ GB}$ $\rightarrow$ Ideal abgedeckt durch $2 \times \text{NVIDIA A100 80GB PCIe}$ ($160 \text{ GB}$ HBM2e) oder $4 \times \text{RTX 6000 Ada 48GB}$ ($192 \text{ GB}$).
- Vision- & Embedding-Dienst (Pixtral 12B + BGE-large-en-v1.5):
- Pixtral 12B (Q8_0): $13{,}0 \text{ GB}$
- BGE Embedding Worker ($4 \times \text{Instanzen}$): $4 \times 1{,}3 \text{ GB} = 5{,}2 \text{ GB}$
- Speicherbedarf: $18{,}2 \text{ GB}$ $\rightarrow$ Zugewiesen an $1 \times \text{RTX 4090 24GB}$ oder $1 \times \text{RTX A5000}$.
- Audio-Transkription (Whisper large-v3-turbo):
- Faster-Whisper VRAM-Bedarf: $2{,}5 \text{ GB}$ pro Instanz.
- 4 parallele Worker: $10{,}0 \text{ GB}$ $\rightarrow$ Zugewiesen an separate GPU oder Rest-VRAM.
Zusammenfassende Kosten- und Leistungsbilanz
| Setup-Typ | Hardware-Komponenten | Gesamte VRAM-Kapazität | Max. gleichzeitige Nutzer | Aggregierter Durchsatz | Investitionskosten (Hardware) |
|---|---|---|---|---|---|
| Szenario A (Single User) | $1\times \text{RTX 4090 24GB}$ + Ryzen 7800X3D | 24 GB GDDR6X | 1 User | 35 - 55 t/s | 2.500 - 3.200 € |
| Szenario B (5-Team Server) | $3\times \text{RTX 3090 24GB}$ + Threadripper 7960X | 72 GB GDDR6X | 5 - 8 User | 95 - 130 t/s | 6.500 - 8.500 € |
| Szenario C (20-Org Cluster) | $2\times \text{A100 80GB}$ + $2\times \text{RTX 4090}$ + Dual EPYC | 208 GB HBM2e/GDDR | 20 - 30 User | 350 - 500 t/s | 28.000 - 38.000 € |
[Warnung] TCO-Kalkulation (Total Cost of Ownership) – Strom und Kühlung beachten
Ein Enterprise-Rig mit 4x High-End-GPUs zieht unter Volllast ca. 1,6 bis 2,2 kW.
Bei 24/7 Betrieb mit durchschnittlich 40% Last entspricht dies einem Jahresverbrauch von:
Energie = 0,8 kW x 24 h x 365 = 7.008 kWh pro Jahr.
Bei industriellen Stromkosten von 0,25 €/kWh fallen ca. 1.750 € jährliche Betriebskosten allein für den Stromverbrauch an.
Zusätzlich erfordert die Abwärme von 800-1600 Watt im Serverraum eine entsprechende Klimatisierung (PUE-Faktor 1.3 bis 1.5).
Kapitelinhalt: technische Herleitung und redaktionelle Einordnung; zeitabhängige Werte vor Einsatz prüfen.