Run the model in your IDE
The browser is the easiest place to explore. Use the local project when you want to set a breakpoint, change the arithmetic or build an experiment of your own.
Download the Python starter project
It includes the NumPy reference implementation, model configuration, trained weights, an editable experiment and a locked dependency file. No repository clone, GPU, model account or API key is needed.
Open and run
Section titled “Open and run”- Install uv if you do not have it.
- Extract the ZIP and open its
inside-the-modelfolder in your IDE. - Open the IDE’s terminal in that folder and run:
uv sync --lockeduv run experiment.pyuv creates .venv and can install Python 3.12 if needed. The first setup downloads Python/packages; subsequent experiments run locally on CPU with the included weights.
The experiment prints the most likely next tokens, changes temperature without changing weights, and compares two suffixes while holding the measured prefix fixed. A changed-prefix positive control checks that the measurement can detect a difference.
Make it yours
Section titled “Make it yours”Edit PROMPT and TEMPERATURE in experiment.py, then rerun it. Set a breakpoint in itm_model.py and follow its # step: comments alongside the browser Explorer.
For editor Run/Debug controls, select the Python interpreter inside .venv: .venv/Scripts/python.exe on Windows or .venv/bin/python on macOS/Linux. VS Code, Cursor and PyCharm can open this folder and use that interpreter; the terminal commands work regardless of editor choice.
The model has a 25-token vocabulary and a small synthetic grammar. It makes its arithmetic inspectable; it does not reproduce the capabilities of a production assistant. For a larger, pinned model, use the GPT-2 reproduction.
See Python development with Astral to add Ruff and ty, and methods and provenance for what the browser/reference comparison verifies.
Spotted a mistake, a confusing explanation or a broken widget? Report a problem with this page