Run it all in Google Colab
No GPU? No install? Every notebook runs on a free Colab runtime. Click a badge and go.
- The notebooks
- What happens when you click
- Turn on the GPU
- Notebooks that need a server
- Things Colab will do to you
- Using your own documents
- Prefer to work locally?
The notebooks
What happens when you click
Colab fetches only the notebook file from GitHub — not the repository. So the first code cell in every notebook does the rest:
if "google.colab" in sys.modules:
# clone the repo so src/, data/ and the sample files exist
# pip install -r requirements.txt
# chdir into it
It is safe to re-run, and it does nothing on your own machine. That is why the same notebook works in both places.
The first run takes about a minute while it clones and installs. Subsequent cells are fast.
Turn on the GPU
Colab gives you CPU by default, which makes notebooks 03, 04, 08 and 11 slow.
Runtime → Change runtime type → T4 GPU, then confirm with:
!nvidia-smi
A free T4 has 16 GB of VRAM — enough for Qwen3-4B or Qwen3-8B in int4, and enough to do the LoRA fine-tuning in notebook 11.
Notebooks that need a server
Notebooks 06, 07, 09, 10 and 12 talk to a local OpenAI-compatible server. Colab has none, so those notebooks include a cell that builds one for you:
from qwen_workshop.colab import in_colab, start_ollama
if in_colab():
start_ollama("qwen3:0.6b")
That installs Ollama, starts it in the background, and pulls the model — two to
four minutes the first time. On a CPU-only runtime stay with qwen3:0.6b.
Things Colab will do to you
| Behaviour | What it means | What to do |
|---|---|---|
| Disconnects when idle | You lose the runtime and its disk | Re-run from the first cell; it re-clones |
| Wipes the disk each session | Models re-download every time | Expect a few minutes of setup per session |
| Free GPU quota is limited | You may get CPU-only at busy times | Use Qwen3-0.6B, or come back later |
| Edits are not saved to GitHub | Your changes vanish on disconnect | File → Save a copy in Drive before you start working |
Save a copy in Drive first if you intend to do the exercises. A Colab notebook opened from GitHub is read-only scratch space — closing the tab loses everything you typed.
Using your own documents
Notebook 09 gets far more interesting with your own notes. In Colab:
from google.colab import files
uploaded = files.upload() # pick your .md or .txt files
Then move them into data/notes/ and re-run the indexing cell. They are
deleted when the runtime ends, which is either a privacy feature or an
annoyance depending on your mood.
Prefer to work locally?
Colab is the fallback, not the point. The workshop is about running models on hardware you control — see Setup for the local path, which is faster after the first install and works offline.