Generative AI Course: Start Here
What generative AI is, what a large language model (LLM) can and cannot do, the kinds of apps you will build in this course, and the tools you need.
What is generative AI?
Generative AI means models that create new content (text, code, images, audio, video) instead of only predicting a label or a number. The most important kind today is the large language model (LLM): a neural network trained on a huge amount of text to predict the next piece of text. That one simple skill, done at enormous scale, turns out to cover answering questions, summarising, translating, writing code and following instructions.
Earlier courses on this site taught you models that classify or predict (is this email spam? how many patients tomorrow?). A generative model instead produces an open-ended answer. That makes it far more flexible, but also harder to control and to test: there is rarely one correct output.
What you will build
This course is about building applications on top of LLMs, not training them from scratch (the NLP course covers training). By the end you will be able to:
- write prompts that give reliable, well-formatted answers;
- call a model from Python, get structured output (JSON your code can use), and let the model call your own functions (tool use);
- build retrieval-augmented generation (RAG), so a model answers from your documents and cites them;
- design simple agents that plan, use tools and check their own work;
- evaluate an LLM app with test sets, and protect it against prompt injection, data leaks and runaway costs.
The course ends with a project: a "chat with your notes" assistant you can put online with the Flask & Deployment course.
What LLMs are good and bad at
| Usually good at | Often bad at |
|---|---|
| Drafting, rewriting and summarising text | Facts they were never shown, or that changed after training |
| Turning messy text into structured data | Exact arithmetic and counting (use code or a calculator tool) |
| Explaining and writing code | Knowing when they are wrong: they can be confidently incorrect |
| Following a clear format and examples | Keeping secrets put in the prompt; resisting hostile instructions |
A confident, fluent answer that is false is called a hallucination. Much of this course is about designing apps so that hallucinations are rare, visible and cheap.
Tools you need
- Python, at the level of the Python course.
- Either an API key from a model provider (for example Anthropic, OpenAI or Google; most offer some free or low-cost credit, and prices change often, so check their pricing pages), or a local model with Ollama β, which runs open-weight models such as Llama, Qwen or Gemma on your own computer for free.
- Nothing else for the demos: every interactive demo in this course runs in your browser. In fact, the AI tutor on this site is a small LLM running inside your browser with WebLLM, the same idea at a small scale.
Never paste an API key into code you share or into a web page. Keep it in an environment variable; the model APIs topic shows how.
Quiz
1. What does an LLM fundamentally learn to do during pretraining?
2. An LLM gives a fluent, confident answer that is false. This is calledβ¦
3. Where should an API key live?
π Further reading
Trusted, mostly free sources: official documentation, well-known textbooks and courses. When you want to confirm or go deeper on anything here, start with these.
- Hugging Face LLM Course β Free course on transformers and LLMs
- Anthropic: Prompt engineering overview β practical, well-organised prompting guide from a model provider