Llama 3 8B:
Technical Analysis & Setup
Updated: October 15, 2026
Llama 3 8B is the smaller of the two models Meta released on 18 April 2024. It has 8,030,261,248 parameters in 32 layers of width 4,096, with a 14,336-wide feed-forward block, 32 attention heads, 8 key-value heads and an 8,192-token context. The default Ollama build, llama3:8b, is a 4.7 GB download that runs on an 8 GB GPU. It has been replaced by Llama 3.1 8B, which has the same dimensions and a 128K context. Everything on this page is copied from Meta’s model card, licence and configuration file, and from the file sizes published on Ollama and Hugging Face; this site has not benchmarked the model.
Llama 3 8B architecture: layers, hidden size, FFN and heads
Llama 3 8B has 32 transformer layers, a hidden size of 4,096, a feed-forward intermediate size of 14,336, 32 attention heads and 8 key-value heads (head dimension 128), a 128,256-token vocabulary and 8,192 maximum positions. Every figure is from the model’s config.json. It is a dense decoder-only transformer with grouped-query attention, SwiGLU feed-forward blocks (SiLU activation) and RMSNorm; the model card adds that it was “trained on sequences of 8,192 tokens” and uses a 128K-token tokenizer, up from 32K in Llama 2.
| Field (config.json) | Llama 3 8B | What it means |
|---|---|---|
num_hidden_layers | 32 | transformer blocks |
hidden_size | 4,096 | model width / embedding dimension |
intermediate_size | 14,336 | feed-forward (FFN) width, 3.5× the hidden size |
num_attention_heads | 32 | query heads per layer |
num_key_value_heads | 8 | grouped-query attention: 4 query heads share each KV head |
| head dimension | 128 | 4,096 ÷ 32 |
vocab_size | 128,256 | tokenizer vocabulary |
max_position_embeddings | 8,192 | context length |
rope_theta | 500,000 | rotary position embedding base; no scaling |
hidden_act / rms_norm_eps | silu / 1e-5 | activation and normalisation |
| parameters | 8,030,261,248 | Hugging Face API count for the BF16 safetensors |
From config.json (ungated mirror of Meta’s repository) and the Hugging Face model page. The 8 key-value heads are why the context cache is small: 2 × 32 layers × 8 heads × 128 × 2 bytes is 128 KB per token, about 1.07 GB for the full 8,192-token window.
Llama architecture table: dimensions, layers and heads from 7B to 70B
The same four knobs (hidden size, feed-forward size, layer count, head count) define every Llama generation. Llama 3 8B keeps the 7B shape of Llama 1 and 2 but widens the feed-forward block from 11,008 to 14,336, switches to grouped-query attention, and quadruples the vocabulary, which is where the extra 1.3 billion parameters come from. The figures are from each model’s config.json and the Hugging Face parameter counts.
| Model | Params | Hidden | FFN | Layers | Heads | KV heads | Context | Vocab |
|---|---|---|---|---|---|---|---|---|
| Llama 1 7B | 6.74B | 4,096 | 11,008 | 32 | 32 | — | 2,048 | 32,000 |
| Llama 1 13B | 13.0B | 5,120 | 13,824 | 40 | 40 | — | 2,048 | 32,000 |
| Llama 1 33B (30B) | 32.5B | 6,656 | 17,920 | 60 | 52 | — | 2,048 | 32,000 |
| Llama 1 65B | 65.3B | 8,192 | 22,016 | 80 | 64 | — | 2,048 | 32,000 |
| Llama 2 7B | 6.74B | 4,096 | 11,008 | 32 | 32 | 32 | 4,096 | 32,000 |
| Llama 2 13B | 13.0B | 5,120 | 13,824 | 40 | 40 | 40 | 4,096 | 32,000 |
| Llama 2 70B | 69.0B | 8,192 | 28,672 | 80 | 64 | 8 | 4,096 | 32,000 |
| Llama 3 8B | 8.03B | 4,096 | 14,336 | 32 | 32 | 8 | 8,192 | 128,256 |
| Llama 3 70B | 70.6B | 8,192 | 28,672 | 80 | 64 | 8 | 8,192 | 128,256 |
| Llama 3.1 8B | 8.03B | 4,096 | 14,336 | 32 | 32 | 8 | 131,072 | 128,256 |
Llama 1 configs from the huggyllama mirrors (7B, 13B, 30B, 65B) and the LLaMA paper; Llama 2 from the NousResearch -hf mirrors; Llama 3 70B from its config. “—” means multi-head attention, where every query head has its own KV head. The parameter counts are the exact Hugging Face figures rounded: Llama 1 7B is 6,738,417,664, Llama 2 70B is 68,976,653,312, Llama 3 70B is 70,553,706,496. Pages for Llama 2 7B, Llama 2 13B, Llama 2 70B and Llama 3 70B.
Llama 3 8B hardware requirements
Llama 3 8B needs about 7 GB of memory at Q4_K_M with its full 8K context, so an 8 GB GPU is the standard setup; the default 4.7 GB q4_0 tag needs about 6.8 GB. A 12 GB card covers Q8_0, a 24 GB card the unquantised fp16 build, and 16 GB of system RAM is the equivalent floor without a GPU. The arithmetic is parameters × bits per weight ÷ 8: 8.03B × 4.90 bits ÷ 8 = 4.92 GB at Q4_K_M.
File sizes are from bartowski/Meta-Llama-3-8B-Instruct-GGUF and Ollama’s tag list. The context cache is 1.07 GB for 8,192 tokens (arithmetic from the configuration above). “Memory needed” is file + that cache + a 1 GB allowance for buffers.
| Quantisation | File | Ollama tag (listed size) | Memory needed (8K context) | Fits |
|---|---|---|---|---|
| IQ2_XXS | 2.40 GB | not on Ollama | ~4.5 GB | 6 GB card, with heavy quality loss |
| Q2_K | 3.18 GB | 8b-instruct-q2_K (3.2GB) | ~5.3 GB | 6 GB card |
| Q3_K_M | 4.02 GB | 8b-instruct-q3_K_M (4.0GB) | ~6.1 GB | 8 GB card |
| q4_0 | 4.7 GB (Ollama) | llama3:8b (4.7GB) — the default | ~6.8 GB | 8 GB card |
| Q4_K_M | 4.92 GB | 8b-instruct-q4_K_M (4.9GB) | ~7.0 GB | 8 GB card |
| Q5_K_M | 5.73 GB | 8b-instruct-q5_K_M (5.7GB) | ~7.8 GB | 8 GB card, with little to spare |
| Q6_K | 6.60 GB | 8b-instruct-q6_K (6.6GB) | ~8.7 GB | 12 GB card |
| Q8_0 | 8.54 GB | 8b-instruct-q8_0 (8.5GB) | ~10.6 GB | 12 GB card |
| fp16 | 16.07 GB | 8b-instruct-fp16 (16GB) | ~18.1 GB | 24 GB card |
- System RAM, no GPU: the file loads into RAM instead, so the same totals apply; 16 GB of RAM covers every build up to Q8_0 with room for the operating system. See running an LLM on CPU only.
- Mac: unified memory follows the same arithmetic; a 16 GB Mac is comfortable, an 8 GB Mac is a squeeze that only the Q2 and Q3 builds fit. See running Llama 3 on a Mac.
- 6 GB card: Q2_K or Q3_K_S fit entirely; anything larger spills part of the model to system RAM, which works but is slower.
- Disk: the download size in the table, once per build you pull.
This site has not measured generation speed for this model, so none is quoted. For what else fits each tier see best LLM for 8 GB of VRAM, best LLM for 12 GB of VRAM and the Ollama RAM and VRAM table; the build names are explained in quantization explained.
Llama 3 8B size in GB: every Ollama tag
The default llama3:8b is 4.7 GB, and it is the q4_0 format, not Q4_K_M. Ollama carries fifteen instruct builds of the 8B from 3.2 GB to 16 GB, all with the 8K context; the sizes below are copied from the tag list. Note that llama3 with no tag is this 8B model, not the 70B.
| Ollama tag | Download | Quantisation | Note |
|---|---|---|---|
llama3:8b | 4.7GB | q4_0 | same file as llama3:latest, llama3:instruct and llama3:8b-instruct-q4_0 |
llama3:8b-instruct-q2_K | 3.2GB | Q2_K | |
llama3:8b-instruct-q3_K_S | 3.7GB | Q3_K_S | |
llama3:8b-instruct-q3_K_M | 4.0GB | Q3_K_M | |
llama3:8b-instruct-q3_K_L | 4.3GB | Q3_K_L | |
llama3:8b-instruct-q4_K_S | 4.7GB | Q4_K_S | |
llama3:8b-instruct-q4_K_M | 4.9GB | Q4_K_M | the format llama3.1:8b defaults to |
llama3:8b-instruct-q4_1 | 5.1GB | q4_1 | |
llama3:8b-instruct-q5_0 | 5.6GB | q5_0 | |
llama3:8b-instruct-q5_K_S | 5.6GB | Q5_K_S | |
llama3:8b-instruct-q5_K_M | 5.7GB | Q5_K_M | |
llama3:8b-instruct-q5_1 | 6.1GB | q5_1 | |
llama3:8b-instruct-q6_K | 6.6GB | Q6_K | |
llama3:8b-instruct-q8_0 | 8.5GB | Q8_0 | |
llama3:8b-instruct-fp16 | 16GB | fp16 | unquantised |
llama3:8b-text | 4.7GB | q4_0 | base (pretrained) model; the 8b-text-* ladder mirrors the instruct sizes |
Sizes from ollama.com/library/llama3/tags. The original BF16 safetensors on Hugging Face are 8.03B × 2 bytes, about 16 GB. For the whole Llama family in one place: 70B models are 40–43 GB at 4-bit, and llama3.1:8b is 4.9 GB because its default is Q4_K_M.
Benchmarks published by Meta: the Llama 3 8B MMLU score
Llama 3 8B Instruct scores 68.4 on MMLU (5-shot) on Meta’s model card; the base model scores 66.6. These are Meta’s own results from its internal evaluation library. The card compares Llama 3 only with Llama 2; it contains no figures for any other company’s models, and nothing on it supports the 69.9 MMLU or 61.2 HumanEval that earlier versions of this page quoted.
| Benchmark (instruct models) | Llama 3 8B | Llama 2 7B | Llama 2 13B | Llama 3 70B |
|---|---|---|---|---|
| MMLU (5-shot) | 68.4 | 34.1 | 47.8 | 82.0 |
| GPQA (0-shot) | 34.2 | 21.7 | 22.3 | 39.5 |
| HumanEval (0-shot) | 62.2 | 7.9 | 14.0 | 81.7 |
| GSM-8K (8-shot, CoT) | 79.6 | 25.7 | 41.2 | 93.0 |
| MATH (4-shot, CoT) | 30.0 | 3.8 | 6.7 | 50.4 |
| Benchmark (base models) | Llama 3 8B | Llama 2 7B | Llama 2 13B |
|---|---|---|---|
| MMLU (5-shot) | 66.6 | 45.7 | 53.8 |
| AGIEval English (3-5 shot) | 45.9 | 28.8 | 38.7 |
| CommonSenseQA (7-shot) | 72.6 | 57.6 | 67.6 |
| Winogrande (5-shot) | 76.1 | 73.3 | 75.4 |
| BIG-Bench Hard (3-shot, CoT) | 61.1 | 38.1 | 47.0 |
| ARC-Challenge (25-shot) | 78.6 | 53.7 | 67.6 |
| TriviaQA-Wiki (5-shot) | 78.5 | 72.1 | 79.6 |
| SQuAD (1-shot) | 76.4 | 72.2 | 72.1 |
| QuAC (1-shot, F1) | 44.4 | 39.6 | 44.9 |
| BoolQ (0-shot) | 75.7 | 65.5 | 66.9 |
| DROP (3-shot, F1) | 58.4 | 37.9 | 49.8 |
The reading of these tables that matters for a buyer: the 8B beats the Llama 2 13B on every row of both tables except TriviaQA and QuAC, so “8B vs 13B” is settled by the card itself. Against the Llama 3 70B it is a different class of model, 14 points behind on MMLU and 20 on MATH. For the 3.1 refresh’s numbers on the same rows, see the Llama 3.1 8B page; what the benchmark names mean is covered in the guide to AI benchmarks.
Llama 3 8B context length: 8,192 tokens
The context length is 8,192 tokens. Meta’s card says the models were trained on sequences of 8,192 tokens, the configuration sets 8,192 maximum positions, and every Ollama tag is listed with an 8K window. Llama 3 8B has no RoPE scaling, so asking it for more than 8K does not work the way it does on Llama 3.1; that longer window is the main reason to pull the newer model instead.
| Context in use | KV cache (f16, arithmetic) | Total with the 4.92 GB Q4_K_M file |
|---|---|---|
| 2,048 tokens | 0.27 GB | ~6.2 GB |
| 4,096 tokens (Ollama default) | 0.54 GB | ~6.5 GB |
| 8,192 tokens (full window) | 1.07 GB | ~7.0 GB |
Ollama’s documentation says it opens a 4,096-token window by default; to use the full 8K, run /set parameter num_ctx 8192 inside ollama run, start the server with OLLAMA_CONTEXT_LENGTH=8192 ollama serve, or pass num_ctx in the API request. The cache figures are 2 × 32 layers × 8 KV heads × 128 × 2 bytes = 131,072 bytes per token; totals add a 1 GB buffer allowance.
Installation
With Ollama installed, pull the tag that matches your memory. Every tag below is on ollama.com/library/llama3/tags. Ollama’s CLI takes no --num-ctx or --num-gpu flags; those are parameters set inside a session, in a Modelfile, or through the API.
# Default 8B build: q4_0, 4.7 GB — for an 8 GB card
ollama pull llama3:8b
ollama run llama3:8b
# Q4_K_M, 4.9 GB — the newer 4-bit format
ollama pull llama3:8b-instruct-q4_K_M
# Q8_0, 8.5 GB — for a 12 GB card
ollama pull llama3:8b-instruct-q8_0
# Use the full 8K context inside a session (default is 4,096)
/set parameter num_ctx 8192For a quantisation Ollama does not carry, such as the 2.4 GB IQ2_XXS file, download the GGUF from the bartowski repository linked above and load it in llama.cpp or LM Studio. The original weights are on Hugging Face; the repository is gated, so you accept Meta’s licence before downloading. Serving it behind an API or a chat interface is covered in the Open WebUI setup guide.
Unless you need this exact model, pull llama3.1:8b instead. It is 4.9 GB, runs on the same hardware and has a 128K context.
Model specifications
| Spec | Llama 3 8B |
|---|---|
| Developer | Meta |
| Release date | 18 April 2024 |
| Parameters | 8,030,261,248 |
| Context length | 8K (8,192 tokens) |
| Architecture | Dense transformer with grouped-query attention: 32 layers, width 4,096, 32 attention heads, 8 key-value heads |
| Vocabulary | 128K tokens (128,256) |
| Training data | Over 15 trillion tokens of publicly available data; fine-tuning data includes over 10M human-annotated examples |
| Knowledge cutoff | March 2023 (the 70B is December 2023) |
| Training compute | 1.3M GPU hours on H100-80GB (Meta’s card) |
| Variants | Base (pretrained) and Instruct; input and output are text only |
| Intended language | English |
| Licence | Meta Llama 3 Community License |
From Meta’s Llama 3 model card; the layer and head counts are from the model’s configuration file.
The Llama 3 technical report
The Llama 3 paper is “The Llama 3 Herd of Models”, arXiv 2407.21783, published in July 2024 with the Llama 3.1 release. It covers the 8B, 70B and 405B models, the data mix, the scaling decisions and the evaluation method; it is the document to cite for architecture questions that the model card does not answer. Note that arXiv 2402.08945, which several pages (including an earlier version of this one) cited as the Llama 3 technical report, is an unrelated mathematics paper.
For the April 2024 release itself, Meta published the model card and an evaluation-details file in the same repository rather than a paper; the benchmark tables above are from that card. The original 2023 LLaMA paper, arXiv 2302.13971, is the source for the 7B/13B/33B/65B dimensions in the architecture table.
Licence
Llama 3 is released under the Meta Llama 3 Community License (version release date April 18, 2024). Meta describes it as a custom commercial licence. It is not an open-source licence such as MIT or Apache 2.0. The terms that matter in practice:
- Commercial use is permitted, along with modification and redistribution.
- If you distribute the model or a product that uses it, you must include the licence and “prominently display ‘Built with Meta Llama 3’” on a related website, interface, blog post, about page or documentation.
- A model you train or fine-tune from it and distribute must “include ‘Llama 3’ at the beginning of any such AI model name”.
- If, on the release date, your products or services had more than 700 million monthly active users in the preceding month, you must request a separate licence from Meta.
- Use is also subject to Meta’s Acceptable Use Policy; the card lists languages other than English as out of scope unless you fine-tune for them.
This is a summary, not legal advice; read the licence before relying on it. Other model licences are compared in LLM licences for commercial use.
What has replaced it
Llama 3 8B was superseded three months after release, and the 8K context is the main reason to move on:
- Llama 3.1 8B — released 23 July 2024 with a 128K context, eight supported languages and tool calling, on the same 8,030,261,248 parameters. Meta’s 3.1 card puts its MMLU at 69.4 (instruct) against 68.5 for this model on the same evaluation. It is the one to pull today.
- There is no Llama 3.3 8B. The Llama 3.3 model card lists a single 70B size, so searches for “Llama 3.3 8B” land on either this model or the 3.1 8B. See Llama 3.3 70B.
- Llama 3.2 3B and Llama 3.2 1B — smaller text models for machines where even 4.7 GB is too much.
- Llama 4 Scout — Meta’s next generation accepts images as well as text, but its Ollama tag is 67 GB; it is not a replacement for anything that runs on an 8 GB card.
If you have 8 or 12 GB and want the strongest model that fits rather than this model specifically, the best Ollama models list is kept current. Llama 3 8B is still worth keeping if you already have it and your prompts fit in 8K tokens.
Frequently asked questions
How many layers does Llama 3 8B have?
32, each with 32 attention heads, 8 key-value heads and a 14,336-wide feed-forward block, on a hidden size of 4,096. The 70B has 80 layers at width 8,192.
What is the Llama 3 8B hidden size?
4,096, the same as the Llama 1 and Llama 2 7B models. The parameter count grew to 8B because the feed-forward block is wider (14,336 vs 11,008) and the vocabulary is four times larger (128,256 vs 32,000).
What is the official MMLU score?
68.4 for the instruct model and 66.6 for the base model, both 5-shot, from Meta’s model card.
How big is Llama 3 8B in GB?
4.7 GB for the default Ollama tag (q4_0). Other builds range from 3.2 GB at Q2_K to 8.5 GB at Q8_0, and the full-precision fp16 build is 16 GB.
Can I run Llama 3 8B on a laptop?
With 16 GB of RAM, yes, for any build up to Q8_0; with an 8 GB laptop GPU the default build fits with about 1 GB to spare at the full 8K context. A laptop with 8 GB of RAM and no GPU should use a Q2 or Q3 build. These are totals from the memory table, not measurements.
Is there a Llama 3.3 8B?
No. Llama 3.3 is a 70B-only release. The newest 8B model from Meta is Llama 3.1 8B.
Should I use Llama 3 8B or Llama 3.1 8B?
Llama 3.1 8B. Same dimensions and hardware, a 0.2 GB larger default download, and a 128K window instead of 8K.
What should I use to serve it to many users at once?
Ollama is built for one machine and a handful of requests. For many simultaneous requests the usual choice is a batching server such as vLLM running the original weights, which at 16 GB in 16-bit precision fits one 24 GB card. This site has not run that configuration and has no throughput figures for it.
Sources
- Meta Llama 3 model card — release date, context, training data, knowledge cutoff, benchmark tables
- Meta Llama 3 Community License — the licence text
- Meta’s Llama 3 announcement
- The Llama 3 Herd of Models (arXiv 2407.21783) and LLaMA: Open and Efficient Foundation Language Models (arXiv 2302.13971)
- Meta-Llama-3-8B-Instruct on Hugging Face — original weights, parameter count
- config.json (ungated mirror) — layers, hidden size, FFN, heads, KV heads, vocabulary, positions
- Ollama tag list — every tag with its download size
- bartowski GGUF files — the file sizes in the hardware table
- Ollama FAQ — the 4,096-token default context window
- Llama 3.1 model card and Llama 3.3 model card — successors
Build Real AI on Your Machine
RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.
Go from reading about AI to building with AI
25 structured courses. Hands-on projects. Runs on your machine. Start free.

Written by
Barsha Mohapatra
Founder and Editor, Local AI Master · Founder, Little AI Master
Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.
Related Guides
Continue your local AI journey with these comprehensive guides
Llama 3.1 8B
The same weights layout with a 128K window: what the longer context costs in memory.
Llama 3 70B
The larger April 2024 release: 40 GB on Ollama and what it needs to run.
Quantization Explained
What q4_0, Q4_K_M and Q8_0 mean, and where quality falls off.
Ollama RAM and VRAM table
The same memory arithmetic for every popular Ollama model.
- PILLARLocal AI Models Directory: Every Model Compared
- Alpaca 7B: Stanford\
- Amazon Chronos: Time Series Forecasting Models (Complete Guide)
- Anima 2.9B on 8GB: The Anime Model Taking Over Civitai
- Aquila 7B by BAAI: Chinese-English Bilingual (FlagAI)
- Baichuan2-13B: Chinese LLM | 59% CMMLU, Bilingual, Free License 2026
- Bark by Suno AI: Open-Source Text-to-Audio Generation Guide
- ChatGLM3-6B: Tsinghua Chinese AI | Code Interpreter, 6GB RAM 2026
- Claude 3 Opus Review: Benchmarks, Pricing & API Guide 2026
- Claude 3 Sonnet Review: Benchmarks, API Pricing & Alternatives 2026
Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide
No spam. Unsubscribe with one click.
Found your model? Now build something with it.
25 hands-on courses — RAG, agents, fine-tuning — all running locally. First chapter free, no card.