The Open Model EcosystemLesson 22 of 71

Module 3 · Inside the files

Every number in config.json

In this lesson

  • 10 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 2 of 10 in this chapter

This chapter’s goalOpen a model repository you have never seen and predict, from config.json and the tokenizer alone, its parameter count, its memory footprint at a given context length, its per-token cost in your languages and the exact conversation format it requires; then verify each prediction with a command and diagnose a runaway or garbled generation from the files rather than by guessing.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Where the parameters are, per layer, in Llama-3.1-8BFeed-forward: gate, up anddown176.2Query projection16.8Output projection16.8Key and value projectionstogether8.4million parameters in one layerTwo hundred and eighteen million per layer, of which the feed-forward stack is about eighty per cent.Most of a transformer is the part nobody talks about. The key and value projections are small becausenum_key_value_heads is 8 against 32 attention heads, and that same field makes the cache four timessmaller.
Two hundred and eighteen million per layer, of which the feed-forward stack is about eighty per cent. Most of a transformer is the part nobody talks about. The key and value projections are small because num_key_value_heads is 8 against 32 attention heads, and that same field makes the cache four times smaller.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Twelve numbers that decide everything

Here is a real configuration, lightly trimmed, from a Llama-3.1-8B repository:

JSON
{
  "hidden_size": 4096,
  "intermediate_size": 14336,
  "num_hidden_layers": 32,
  "num_attention_heads": 32,
  "num_key_value_heads": 8,
  "vocab_size": 128256,
  "max_position_embeddings": 131072,
  "rope_theta": 500000.0,
  "rms_norm_eps": 1e-05,
  "tie_word_embeddings": false,
  "torch_dtype": "bfloat16",
  "architectures": ["LlamaForCausalLM"]
}

Everything you need to size, serve and budget for this model is in that block. Learning to read it takes twenty minutes and pays for itself the first time somebody claims a model will fit on a machine where it will not.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Maths You Actually Need exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Every number in config.json’, in The Open Model Ecosystem. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/open-models/reading-config-json (Accessed: 29 November 2026).