Stations 1–3 · What is this → Meet the models → Talk to AI with code.
Length: ~75 min · You'll need: a laptop + the Session 1 Colab notebook · Ages: high schoolers
The shape of today
Learn a little → build a little
Every station has two halves
Idea slides (5–8 min) — the concept in plain English.
Colab practical (8–12 min) — you run code and test that it worked before we move on.
3 stations today. We climb one, prove it in code, then climb the next.
1
Station 1 · Start Here
What is this, really?
Concept · Two roles
Builder vs. researcher
Hard to start
Researcher
Invents new models. Deep math, huge budgets, years. Builds the engine.
Start today
Builder
Takes a finished model and makes useful things with it. Needs a laptop + curiosity. Drives the car.
🚗 Analogy
You don't design a car engine to become a great driver. Today you're learning to drive — the engine already exists.
Concept · The machine
An LLM is a giant next-word predictor
LLM = Large Language Model. It read a huge slice of the internet and learned the patterns of language — not facts in a database.
🔑 The one idea to remember
It takes the text so far and predicts the most likely next chunk of text. Then repeats. That loop writes whole paragraphs.
See it happen
Watch it choose, one word at a time
# The text so far:
"The best part of summer is going to the ___"
# The model ranks likely next words:
beach 41% pool 22%
lake 12% movies 7%
dentist 0.2%
The catch
It picks a believable word — not a verified-true one. That's why AI can sound sure and still be wrong.
Why this matters all day
One weakness, born from the same trick
⚠️ Hallucination
Because it predicts likely text, an LLM will happily invent a fake book, a fake quote, or a wrong date — with total confidence.
Superpower and flaw are the same trait.
Good builders design around it (we'll do this in Session 3).
🧪 Practical · Colab — Station 1
Talk to Gemini & catch it predicting
Run the Setup cell — paste your free Gemini API key.
Ask Gemini to finish "The best part of summer…" 5 ways.
Ask for a made-up book's page count → spot the hallucination.
✅ Test: you printed a real reply + you caught one made-up "fact"
2
Station 2 · The Models
Meet the AI models
The landscape
The models you'll build on
The big 3 (closed)
ChatGPT (OpenAI) · Claude (Anthropic) · Gemini (Google). Use them through an API.
Open-weight
Llama, Mistral & friends — you can download and run them yourself.
Closed vs open
Closed = convenient, powerful, rented. Open = more control & privacy, more setup. Neither is "better" — depends on the job.
How to choose
Three dials, not "which is best"
Smarts vs speed vs price — bigger = smarter & slower & pricier.
Context window — how much it can read at once (a page? a book?).
Small vs large — a "flash/mini" model is often plenty.
🚗 Analogy
Picking a model is picking a vehicle for the trip: a scooter (fast, cheap, short trips) vs a truck (powerful, pricey, heavy loads). You don't take a truck to grab milk.
🧪 Practical · Colab — Station 2
Same question, two models
List the Gemini models your key can see.
Ask one hard question to a flash model and a pro model.
Compare answer quality and how long each took.
✅ Test: you printed both answers + noticed a difference
3
Station 3 · Code + AI
Talk to AI with code
Concept · APIs
An API = apps talking to apps
🍽️ Analogy
Your app is a diner. The model is the kitchen. The API is the waiter: you hand over an order (your prompt), the waiter carries it back and forth, you get a dish (the reply).
resp = client.models.generate_content(
model="gemini-flash",
contents="Explain photosynthesis to a 10-year-old.",
)
print(resp.text)
Concept · Tokens
Tokens: why long chats cost more
Models read text in tokens — chunks ~¾ of a word.
You pay per token, in and out. Long prompt = more tokens = more cost + slower.
Context window = the max tokens it can hold at once.
🔑 Two dials to know
temperature = creativity (0 = safe, 1 = wild). max tokens = length cap on the reply.
🧪 Practical · Colab — Station 3
The request→reply loop, in code
Send a prompt from code, print the reply.
Count the tokens in your prompt.
Run the same prompt at temperature 0 and 1 — spot the difference.
✅ Test: same prompt, two temperatures, visibly different replies
Session 1 · Wrap-up
What you can now do
Explain an LLM as a next-word predictor (and why it hallucinates).
Pick a model by the job, not the hype.
Send a prompt from code, count tokens, turn the dials.
🎟️ Exit ticket
In one sentence each: What is an LLM? and Name one time it might lie to you.
Next session → Building: prompting, giving AI your own memory (RAG), and agents that take action.
LearnAI Workshop · Session 1 — Foundations · press S for coach notes