BUILD A LOCAL CHATBOT · MODULE 0 — SETUP · bc-00 Real Python, every page

Module 0 · Setup

Your local AI lab

Four steps, once, and you'll never repeat them for the rest of this series: check your hardware, isolate a Python environment, install two packages, and run a script that actually downloads and runs a real model on your own machine.

Step 1 of 4

What you actually downloaded

A folder of numbers, not an app

After the smoke test runs once, look in your Hugging Face cache folder (~/.cache/huggingface/hub/ on Mac/Linux, C:\Users\<you>\.cache\huggingface\hub\ on Windows). This is exactly what's in there for SmolLM2-135M-Instruct — a real listing, not a mockup:

config.json
the architecture's shape
576-dim hidden state, 30 transformer layers, 9 attention heads
this is Module 2's block, stacked 30 times
tokenizer.json / vocab.json / merges.txt
the vocabulary
49,152 subword pieces — the same idea as page 7's hand-rolled BPE
this is what tokenize() actually looks up
model.safetensors
the weights, ~256 MB
134,515,008 real numbers, nothing else
this file is the model — no code lives in it
Try this

Change max_new_tokens=20 to max_new_tokens=60 in bc-00-setup.py ⬇ and re-run it. Predict first: will the sentence keep making sense, or start to drift? Either way, you're about to watch the actual mechanism the rest of this series explains — not a diagram of it.

So what

"Downloading a model" is downloading a folder — a recipe file and a big table of numbers — not installing an application.