Notebooks and materials for teaching language models by running small open models right inside Jupyter.
This is the companion repo for our SIGCSE TS 2027 demo, Teaching LLM Engineering with Tiny Open Models in Jupyter - Cloudbank Classroom (Sacramento, February 17-20, 2027).
Most students meet a language model through a chat app or a commercial API, so the model stays invisible. Here the model is just another object in your notebook. You load it, see the exact chat template it receives, change the system prompt, turn the generation knobs, and test what comes back with a few lines of Python.
Everything is in open-models.ipynb, one part per section. Part 1 is ready. The rest are coming. Each part stands on its own, so you can start anywhere.
Token Lab shows where tokens come from: build a vocabulary one merge at a time, see each token's ID and its row of numbers, then nudge a row with gradient descent until it predicts the right next token.
Instructors run instructor/get-the-models.ipynb once before class to download the models into the shared folder.
| # | Notebook | What you do |
|---|---|---|
| 1 | Run the model | Load a model in a few lines of Python. See the chat template and the tokens it actually gets, why it cannot count the r's in strawberry, and what thinking on and off does. Then run the same questions on all four sizes and watch the answers go from wrong to right. |
| 2 | Prompts and behavior | Change the system prompt and conversation history. Predict how the answers change. |
| 3 | Generation | Turn temperature and the other generation settings and watch what happens. |
| 4 | Evaluation | Build a small set of test questions and compare models, prompts, and settings, instead of judging one answer at a time. |
| 5 | Build a tutor | Put the model, the system prompt, and some Python together into a tutor that guides a student to the answer instead of giving it away. |
These come from ds-modules/Small_Models_SP26, our Spring 2026 intro to AI materials. We are drawing on them for the notebooks above.
- Small LM demo with llama-cpp-python: loading a model,
max_tokens,temperature, system messages, few-shot, chat format - Context management and dynamic system prompts
- Personal writing assistant: temperature, few-shot, hallucination, sycophancy
- SAT test taker: scoring a model on a set of questions
- RAG course tutor with llama-cpp-python
- Model weights and tokens
- Downloading models from Hugging Face
- llama.cpp GPU explorer: GPU layers, threads, context size, and GPU memory
One family in four sizes, so the only thing that changes is size: Qwen3.5 0.8B, 2B, 4B, and 9B, all 4-bit GGUF files (0.5 to 5.7 GB). Apache 2.0.
- The smaller ones run fine on CPU.
- The larger ones run faster on a shared classroom GPU (NVIDIA T4, 16 GB). The 9B model is 5.7 GB, so two students sharing one T4 both fit.
You can run these on any JupyterHub or on your own laptop. No commercial API account is needed.
If you teach with CloudBank Classroom, the Python packages are already in the hub image, so students do not install anything.
BSD 3-Clause. Use it, change it, and teach with it.