Acknowledgments

This book exists because the companion package came first. hands-on-ai began as a teaching lab: eight small modules, each wrapping one call to a model in plain Python, with documentation pages and project guides for readers to build against. The book is the narrative the package leaves out, the why and the progression and the misconceptions each module is designed to kill. Every listing here was checked against the package source, and the package is better for the checking; several sharp edges found while drafting these chapters, including a tool description that its own function could not accept, were worth finding in a manuscript rather than in a classroom.

The listings were tested the way the book asks readers to test them: offline first, with scripted stand-ins where a live model would only add weather, and against local models where the call itself was the lesson. Students and classes who worked through early versions of these builds, in applied AI teaching at Curtin University and in the workshops around it, showed exactly where the explanations ran ahead of the code. Where a chapter now slows down to print a payload or read a trace against the grain, it is usually because a room full of capable people skimmed past that step and then could not say what had happened.

The intellectual debts are named where they are incurred: the ReAct paper for the reason-act-observe loop, the original retrieval-augmented generation paper for search-then-prompt, Jake Van Clief and David McDermott’s Interpretable Context Methodology for the folder-as-agent architecture, Andrej Karpathy’s teaching for the go-deeper exits, and Conversation, Not Delegation for the argument that judging model output is the new literacy. The optional final part draws on the local fine-tuning community’s tooling and notebooks, credited in place.

The open-source community behind Quarto, Pandoc, Python and GitHub made it possible to write, build and publish this book from text files the reader can inspect, alongside the package it narrates. The local-model ecosystem, Ollama in particular, is what makes a book like this runnable offline in a classroom at all.

This book was written using the machinery it describes. AI drafted, summarised, checked listings and proposed structures at every stage, and produced fluent errors on schedule, which is why every printed output that claims to be program output was verified by running the program. The machine made the work faster. The judgement, and the responsibility for every claim that remains, are the author’s.