Basic LLMs and AI Agent
This course introduces how a large language model works and how the same model is turned into an agent that can act on a computer. Students first trace a prompt through tokenization, embedding, attention and next-word prediction, then practise the five elements of a good prompt in Google Gemini and use one conversation to produce key points, an AI-generated comic and a working app built with the Canvas tool. Alongside the practical work they examine hallucination, training data cutoff and the memory ceiling, apply a trust-but-verify routine, and review what counts as sensitive information online. The second half of the course moves off the cloud: students install Ollama, run open models locally while recording CPU usage, memory and token throughput, and compare model sizes. They then run supplied Python agents in Thonny to rename, create, read and delete files inside a restricted sandbox folder, observe the Think-Act-Observe loop, and add a new tool to the agent. The course finishes with a skill-based personal assistant, where students write their own Python skill from a template and load it into the assistant's skillset.
Learning objectives
- Explain how a large language model produces text, covering tokenization, embedding, attention and next-word prediction.
- Write structured prompts and evaluate LLM output against hallucination, knowledge cutoff, memory limits and online privacy risks.
- Run open models locally with Ollama and build a sandboxed file agent and a skill-based assistant in Python.
Lesson plan
Prerequisites
- Basic Python experience
Hardware
- Notebook/Desktop with updated browser
- Windows notebook/desktop able to run local models with Ollama
Software
- Google Gemini
- Ollama
- Thonny
- Python with the ollama package