Learn generative AI by building with Gemini
Go from 'what is an LLM?' to building a working AI agent — writing real code against the Gemini API in your browser. Concepts first, then a playground that checks your work.
- Lessons
- 19
- Total time
- ~200 min
- XP on offer
- 565
- Level
- Beginner to advanced
- Price
- Free
Syllabus
Work top to bottom, or jump straight to the gap you came here to fill.
- 01
Setup
Get a free API key and understand exactly where it lives.
- 02
How models actually work
Next-token prediction, tokens, context windows and the sampling knobs — the mental model everything else rests on.
- What an LLM actually isA large language model predicts the next token, over and over. Understand training vs inference, why models hallucinate, and what 'knowing' really means for an LLM.Quiz8 minQuiz8 min
- Your first Gemini API callSend a prompt to Gemini, read the response envelope, and pull the text out of it. The one call every other lesson builds on.Playground10 minPlayground10 min
- Tokens and the context windowTokens are the unit models read, bill, and limit you by. Learn how text becomes tokens, what a context window really holds, and how to count before you send.Playground9 minPlayground9 min
- Temperature, top-p and getting repeatable outputTemperature, topP and topK decide how the next token is picked. Learn what each knob does, which to touch, and how to make model output as repeatable as it gets.Playground9 minPlayground9 min
- 03
Prompting that holds up
System instructions, few-shot examples, and why a prompt is never a security boundary.
- System instructions vs the user promptSeparate the rules that always apply from the request that changes each turn. How Gemini's systemInstruction works and why mixing the two causes bugs.Playground8 minPlayground8 min
- Zero-shot, few-shot and showing your workExamples in a prompt beat adjectives. Learn when to switch from describing a task to demonstrating it, and how many examples actually help.Playground9 minPlayground9 min
- Prompt injection and why prompts aren't securityModels can't reliably tell your instructions from text they were asked to process. Understand prompt injection, indirect injection, and the mitigations that actually work.Quiz8 minQuiz8 min
- 04
Structure and tools
Make output parseable, then let the model call your own functions.
- Structured output: JSON you can actually parseStop regex-ing prose. Use responseMimeType and responseSchema to make Gemini return JSON that matches a shape your code can rely on.Playground10 minPlayground10 min
- Function calling: letting the model use your codeDeclare tools, let Gemini decide when to call them, and understand why the model never executes anything itself. The building block every agent is made of.Playground11 minPlayground11 min
- 05
From LLM to agent
What agency actually means, built by hand — plus retrieval so your agent can work from real sources.
- LLMs vs AI agents: what actually changesAn agent is not a bigger model. It's a loop around one, with tools, memory and the authority to act. Learn where the line is and why it matters for reliability.Quiz9 minQuiz9 min
- Close the loop: build a working agentSend a tool result back to the model and let it finish the job. Build the plan-act-observe loop by hand and see exactly what every agent framework is doing.Playground14 minPlayground14 min
- Embeddings and RAG from scratchTurn text into vectors, find the closest one with cosine similarity, and build retrieval-augmented generation with no vector database at all.Playground13 minPlayground13 min
- 06
Multimodal and streaming
Images as input, and streaming tokens to a UI as they arrive instead of making people wait.
- Multimodal: sending images to the modelGemini reads images, not just text. Learn how parts carry inline data, how images are billed as tokens, and how to ask questions about a picture.Playground10 minPlayground10 min
- Streaming responses as they generateTokens arrive one at a time — streaming shows them as they land instead of making users wait. Learn server-sent events, chunk shape, and when streaming is the wrong choice.Playground10 minPlayground10 min
- 07
Safety and evaluation
Safety settings, LLM-as-judge scoring, and how to test a feature whose output changes every run.
- Safety settings and responses that never arriveGemini can decline to answer, and blocked responses have no text at all. Learn the safety categories, how thresholds work, and how to handle a blocked reply without crashing.Playground9 minPlayground9 min
- LLM-as-judge: scoring output with a modelWhen output varies every run, you need graded criteria rather than exact matches. Build an LLM judge that scores answers against a rubric and returns structured verdicts.Playground12 minPlayground12 min
- Testing a feature whose output changes every runAssertions on exact model text are guaranteed to flake. Learn what to assert instead, where to put the seam, and how to keep an LLM feature in CI without a nightly false alarm.Quiz10 minQuiz10 min
- 08
Boss challenge: build an assistant
Tools, an agent loop and structured output combined into one working assistant.
Questions
- Does this course cost anything?
- The course is free. You bring your own Gemini API key, and every exercise is sized to run comfortably inside Google's free tier.
- Where is my API key stored?
- On your Purrx account, encrypted before it is written to the database, so it is there on every device you sign in on. It is only used for your own requests — playground code runs in a sandboxed Web Worker that calls Google directly, and the PPTX Lab calls Google from our server on your behalf.
- Do I need to know machine learning?
- No. This is an engineering course. You need to be able to read JavaScript; everything about how models work is taught from first principles.
- Is this useful if I've already used the ChatGPT or Gemini apps?
- Yes — using a chat product teaches you very little about tokens, sampling, structured output, function calling or agent loops. Those are the things that matter when you build with a model rather than talk to one.
- What is the difference between an LLM and an AI agent?
- An LLM call is a single function: text in, text out. An agent is a loop around that call which can use tools, observe the results and decide its next step until a goal is met. The course covers both, and you build an agent by hand.