Microsoft Phi-4 14B (Q4_K_M) : VRAM exacte, KV-Cache & Tenseurs
14B dense orienté logique, mathématiques et code synthétique, très agile sur cartes 12 et 16 Go.
⚡ Simuler sur votre GPU dans l’onglet (WASM)
Mesurer & signer Ed25519 dans Local Cockpit 0.4.0
Voir le fichier sur HuggingFace
VRAM min (8k · KV FP16)10,74 Gio32k en KV Q8_0 : 12,70 Gio
Poids binaires .GGUF8,43 Gio4,94 bits/poids effectifs
Paramètres (Actifs / Totaux)14,66 / 14,66 Md243 tenseurs analysés
Coût du Cache KV200,0 Mio/1kEn Q8_0 : 106,2 Mio / 1 000 tok
1. Provenance binaire HuggingFace
| Dépôt officiel | bartowski/phi-4-GGUF |
|---|---|
| Fichier inspecté | phi-4-Q4_K_M.gguf (8,43 Gio) |
| Commit HuggingFace | 19cd65f97c2f |
| Date de lecture | 2026-11-29 15:28:26 UTC |
| En-tête analysé | 3 555 756 octets (SHA-256 aff66e668e50b490a793…) |
2. Architecture & dimensions GQA
| Architecture GGUF | phi3 (Dense) |
|---|---|
| Couches Transformer | 40 couches (~198,8 Mio / couche) |
| Dimensions (d_model / FFN) | 5120 / 17920 |
| Têtes d’attention (Q / KV) | 40 Q / 10 KV (GQA 4,0:1, dim 128) |
| Contexte natif & Vocabulaire | 16 384 tokens · vocab 100 352 |
3. Distribution réelle des types de quantification GGML dans ce fichier
Contrairement à une quantification uniforme, un fichier Q4_K_M conserve certains tenseurs critiques dans une précision supérieure :
| Type GGML | Nombre de tenseurs | Volume | Part du poids | Répartition |
|---|---|---|---|---|
Q4_K | 101 | 5,62 Gio | 66,7 % | |
Q6_K | 21 | 1,79 Gio | 21,3 % | |
Q5_K | 40 | 1,01 Gio | 11,9 % | |
F32 | 81 | 0,00 Gio | 0,0 % |
4. Falaise du Cache KV de 2k à 128k tokens (FP16 vs Q8_0 vs Q4_0)
Activer Flash Attention et un cache KV en Q8_0 divise presque par deux la mémoire de contexte sans modifier les poids du modèle :
| Longueur de contexte | KV seul (FP16) | KV seul (Q8_0) | KV seul (Q4_0) | VRAM totale (FP16) | VRAM totale (Q8_0) |
|---|---|---|---|---|---|
| 2k (2 048) | 0,39 Gio | 0,21 Gio | 0,11 Gio | 9,57 Gio | 9,39 Gio |
| 4k (4 096) | 0,78 Gio | 0,42 Gio | 0,22 Gio | 9,96 Gio | 9,60 Gio |
| 8k (8 192) | 1,56 Gio | 0,83 Gio | 0,44 Gio | 10,74 Gio | 10,01 Gio |
| 16k (16 384) | 3,13 Gio | 1,66 Gio | 0,88 Gio | 12,31 Gio | 10,84 Gio |
| 32k (32 768) | 6,25 Gio | 3,32 Gio | 1,76 Gio | 15,43 Gio | 12,50 Gio |
| 64k (65 536) | 12,50 Gio | 6,64 Gio | 3,52 Gio | 21,68 Gio | 15,82 Gio |
| 128k (131 072) | 25,00 Gio | 13,28 Gio | 7,03 Gio | 34,18 Gio | 22,46 Gio |
5. Matrice de placement couche par couche par configuration matérielle
Simulation déterministe incluant la réserve VRAM du système d’exploitation et les tampons d’évaluation :
| Configuration matérielle | Contexte & KV | Couches en VRAM | VRAM occupée | Débordement RAM | Verdict mémoire |
|---|---|---|---|---|---|
| GPU 8 Go + 16 Go RAM | 8k · KV FP16 | 27 / 40 | 7,19 Gio | 3,06 Gio | Débordement RAM |
| GPU 8 Go + 16 Go RAM | 32k · KV FP16 | 17 / 40 | 7,16 Gio | 8,05 Gio | Débordement RAM |
| GPU 8 Go + 16 Go RAM | 32k · KV Q8_0 | 22 / 40 | 7,27 Gio | 5,01 Gio | Débordement RAM |
| GPU 12 Go + 32 Go RAM | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | 100 % VRAM |
| GPU 12 Go + 32 Go RAM | 32k · KV FP16 | 28 / 40 | 10,96 Gio | 4,25 Gio | Débordement RAM |
| GPU 12 Go + 32 Go RAM | 32k · KV Q8_0 | 36 / 40 | 11,13 Gio | 1,15 Gio | Débordement RAM |
| GPU 16 Go + 32 Go RAM | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | 100 % VRAM |
| GPU 16 Go + 32 Go RAM | 32k · KV FP16 | 39 / 40 | 14,85 Gio | 0,36 Gio | Débordement RAM |
| GPU 16 Go + 32 Go RAM | 32k · KV Q8_0 | 40 / 40 | 12,28 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 32k · KV FP16 | 40 / 40 | 15,21 Gio | — | 100 % VRAM |
| GPU 24 Go + 64 Go RAM | 32k · KV Q8_0 | 40 / 40 | 12,28 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 32k · KV FP16 | 40 / 40 | 15,21 Gio | — | 100 % VRAM |
| GPU 32 Go + 64 Go RAM | 32k · KV Q8_0 | 40 / 40 | 12,28 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 32k · KV FP16 | 40 / 40 | 15,21 Gio | — | 100 % VRAM |
| Bi-GPU 48 Go + 128 Go RAM | 32k · KV Q8_0 | 40 / 40 | 12,28 Gio | — | 100 % VRAM |
| Mémoire unifiée 64 Go | 8k · KV FP16 | 40 / 40 | 10,26 Gio | — | Mémoire unifiée |
| Mémoire unifiée 64 Go | 32k · KV FP16 | 40 / 40 | 15,21 Gio | — | Mémoire unifiée |
| Mémoire unifiée 64 Go | 32k · KV Q8_0 | 40 / 40 | 12,28 Gio | — | Mémoire unifiée |
6. Commandes d’exécution locale prêtes à copier
Avec Ollama :
ollama run phi4:14b
Avec
llama-server (Flash Attention + Cache KV Q8_0 calibré pour 16 Go VRAM) :llama-server -m phi-4-Q4_K_M.gguf -ngl 40 -c 32768 -fa --cache-type-k q8_0 --cache-type-v q8_0
7. Bancs réels certifiés Ed25519 sur ce modèle
Aucun passeport Ed25519 certifié n’est encore enregistré pour cette variante exacte (aucun débit tok/s n’est jamais inventé). Lancez ce modèle dans Local Cockpit 0.4.0 pour publier la première mesure signée /b/lc-… !