★ Reading this for free? Get 25 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 secondsOr own every course: $149 once

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.

8.03B
Parameters
32 × 4,096
Layers × hidden size
8K
Context window
68.4
MMLU, instruct model (Meta)

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 8BWhat it means
num_hidden_layers32transformer blocks
hidden_size4,096model width / embedding dimension
intermediate_size14,336feed-forward (FFN) width, 3.5× the hidden size
num_attention_heads32query heads per layer
num_key_value_heads8grouped-query attention: 4 query heads share each KV head
head dimension1284,096 ÷ 32
vocab_size128,256tokenizer vocabulary
max_position_embeddings8,192context length
rope_theta500,000rotary position embedding base; no scaling
hidden_act / rms_norm_epssilu / 1e-5activation and normalisation
parameters8,030,261,248Hugging 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.

ModelParamsHiddenFFNLayersHeadsKV headsContextVocab
Llama 1 7B6.74B4,09611,0083232—2,04832,000
Llama 1 13B13.0B5,12013,8244040—2,04832,000
Llama 1 33B (30B)32.5B6,65617,9206052—2,04832,000
Llama 1 65B65.3B8,19222,0168064—2,04832,000
Llama 2 7B6.74B4,09611,0083232324,09632,000
Llama 2 13B13.0B5,12013,8244040404,09632,000
Llama 2 70B69.0B8,19228,672806484,09632,000
Llama 3 8B8.03B4,09614,336323288,192128,256
Llama 3 70B70.6B8,19228,672806488,192128,256
Llama 3.1 8B8.03B4,09614,33632328131,072128,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.

QuantisationFileOllama tag (listed size)Memory needed (8K context)Fits
IQ2_XXS2.40 GBnot on Ollama~4.5 GB6 GB card, with heavy quality loss
Q2_K3.18 GB8b-instruct-q2_K (3.2GB)~5.3 GB6 GB card
Q3_K_M4.02 GB8b-instruct-q3_K_M (4.0GB)~6.1 GB8 GB card
q4_04.7 GB (Ollama)llama3:8b (4.7GB) — the default~6.8 GB8 GB card
Q4_K_M4.92 GB8b-instruct-q4_K_M (4.9GB)~7.0 GB8 GB card
Q5_K_M5.73 GB8b-instruct-q5_K_M (5.7GB)~7.8 GB8 GB card, with little to spare
Q6_K6.60 GB8b-instruct-q6_K (6.6GB)~8.7 GB12 GB card
Q8_08.54 GB8b-instruct-q8_0 (8.5GB)~10.6 GB12 GB card
fp1616.07 GB8b-instruct-fp16 (16GB)~18.1 GB24 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 tagDownloadQuantisationNote
llama3:8b4.7GBq4_0same file as llama3:latest, llama3:instruct and llama3:8b-instruct-q4_0
llama3:8b-instruct-q2_K3.2GBQ2_K
llama3:8b-instruct-q3_K_S3.7GBQ3_K_S
llama3:8b-instruct-q3_K_M4.0GBQ3_K_M
llama3:8b-instruct-q3_K_L4.3GBQ3_K_L
llama3:8b-instruct-q4_K_S4.7GBQ4_K_S
llama3:8b-instruct-q4_K_M4.9GBQ4_K_Mthe format llama3.1:8b defaults to
llama3:8b-instruct-q4_15.1GBq4_1
llama3:8b-instruct-q5_05.6GBq5_0
llama3:8b-instruct-q5_K_S5.6GBQ5_K_S
llama3:8b-instruct-q5_K_M5.7GBQ5_K_M
llama3:8b-instruct-q5_16.1GBq5_1
llama3:8b-instruct-q6_K6.6GBQ6_K
llama3:8b-instruct-q8_08.5GBQ8_0
llama3:8b-instruct-fp1616GBfp16unquantised
llama3:8b-text4.7GBq4_0base (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 8BLlama 2 7BLlama 2 13BLlama 3 70B
MMLU (5-shot)68.434.147.882.0
GPQA (0-shot)34.221.722.339.5
HumanEval (0-shot)62.27.914.081.7
GSM-8K (8-shot, CoT)79.625.741.293.0
MATH (4-shot, CoT)30.03.86.750.4
Benchmark (base models)Llama 3 8BLlama 2 7BLlama 2 13B
MMLU (5-shot)66.645.753.8
AGIEval English (3-5 shot)45.928.838.7
CommonSenseQA (7-shot)72.657.667.6
Winogrande (5-shot)76.173.375.4
BIG-Bench Hard (3-shot, CoT)61.138.147.0
ARC-Challenge (25-shot)78.653.767.6
TriviaQA-Wiki (5-shot)78.572.179.6
SQuAD (1-shot)76.472.272.1
QuAC (1-shot, F1)44.439.644.9
BoolQ (0-shot)75.765.566.9
DROP (3-shot, F1)58.437.949.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 useKV cache (f16, arithmetic)Total with the 4.92 GB Q4_K_M file
2,048 tokens0.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 8192

For 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

SpecLlama 3 8B
DeveloperMeta
Release date18 April 2024
Parameters8,030,261,248
Context length8K (8,192 tokens)
ArchitectureDense transformer with grouped-query attention: 32 layers, width 4,096, 32 attention heads, 8 key-value heads
Vocabulary128K tokens (128,256)
Training dataOver 15 trillion tokens of publicly available data; fine-tuning data includes over 10M human-annotated examples
Knowledge cutoffMarch 2023 (the 70B is December 2023)
Training compute1.3M GPU hours on H100-80GB (Meta’s card)
VariantsBase (pretrained) and Instruct; input and output are text only
Intended languageEnglish
LicenceMeta 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

Reading now
Join the discussion

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.

🎯
AI Learning Path

Go from reading about AI to building with AI

25 structured courses. Hands-on projects. Runs on your machine. Start free.

Or own it for life — Lifetime $149 $599, pay once
Barsha Mohapatra

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.

📅 Published: September 28, 2025🔄 Last Updated: October 15, 2026✓ Manually Reviewed
More on AI Models Directory
See the full AI Models Directory guide.
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Found your model? Now build something with it.

25 hands-on courses — RAG, agents, fine-tuning — all running locally. First chapter free, no card.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators