The canonical index for guided AI notebooks and project-based AI engineering exercises.
AI exercise index
This is the only index for the AI exercise collection. It explains the sequence, prerequisites, setup, evidence requirements, and links to every lesson. Individual pages contain the detailed instructions; return here to choose the next exercise.
Choose a track
Start with the guided notebook track if you are new to model APIs. Continue with the engineering track when you can write a small Python program, save structured results, and explain how you will test failures.
- Prompt structure exercise — roles, instructions, and message structure.
- Chatbot with GitHub Models — a hosted model request with environment-based authentication.
- RAG document chunking — character, sentence, and section chunking without an API key.
- API fundamentals: requests — the first API lesson.
- Complete the remaining API fundamentals sequence.
Notebook lessons
| Exercise | Lesson | Notebook | API key |
|---|---|---|---|
| Prompt structure | Read lesson | Open notebook | Anthropic-compatible key and model name |
| Chatbot | Read lesson | Open notebook | GitHub Models token |
| RAG chunking | Read lesson | Open notebook | None |
| API fundamentals | Read lesson | Open notebook | Provider key |
API fundamentals sequence
- Sending API requests
- API requests exercise
- System prompts
- System prompts exercise
- Temperature and sampling
- Streaming responses
- Structured data responses
Engineering exercises
These are not alternate indexes. Each module is a detailed lesson linked from this table; use the exercise numbers below to choose a project and return here for the sequence.
| Exercises | Detailed lesson | What you will build or measure |
|---|---|---|
| 1–5, 9–11, 14, 18 | Evaluation and comparison | Controlled tests for quality, evidence, cost, latency, multimodal behavior, embeddings, tokens, and model choice |
| 6, 13, 16–17 | Reliability and security | Robustness tests, threat modeling, defensive red-team cases, poisoning checks, and failure investigation |
| 7–8 | Tools and agents | Validated tools and a fixed workflow versus an agent workflow |
| 12, 15, 19 | Data and product systems | Prompting decisions, prompt versioning, memory, privacy, and rollback design |
| 20 | Reproducibility challenge | A partner-readable reproduction report and environment record |
Prerequisites
- Python functions, lists, dictionaries, files, exceptions, and virtual environments.
- Basic pandas and plotting knowledge for the evaluation labs.
- A text editor and either VS Code with the Python and Jupyter extensions or JupyterLab.
- The setup and credentials guide and Jupyter notebook workflow.
Setup and evidence
- Create and select a project virtual environment; verify the notebook kernel with
import sys; print(sys.executable). - Install only the packages named by the lesson or notebook. Keep a
requirements-lock.txtfor engineering labs. - Store provider keys in environment variables or a local secret manager. Never paste, print, commit, or upload them.
- Read the lesson, run the smallest sample, then change one variable at a time.
- Save structured results such as JSON or CSV, the prompt/model version, date, and failure notes.
- Submit the notebook or script, test data, results, rubric, five inspected failures where requested, and a short conclusion.
References and next steps
- Anthropic Messages API documentation
- GitHub Models documentation
- Jupyter documentation
- Python
venvdocumentation - After these exercises, continue to Generative AI and language systems, then build the citation-based study assistant project.