Your browser doesn't support speech here. You can still read everything, or try Chrome, Edge or Safari.
Course 8 of 10 · Intermediate
Generative AI & LLM Apps
Build apps with large language models. How LLMs work, prompt engineering, calling model APIs with structured output and tools, retrieval-augmented generation, agents, evaluation, guardrails and safety, and multimodal models.
How this course works
Welcome
- Level: Intermediate. You need: Python. Machine Learning helps; Deep Learning and NLP go deeper.
- Before you start: Python. The LLMs, Embeddings & RAG topic in Machine Learning is a short introduction; this course goes much further.
- The demos run in the page without an API key. Code that calls a real model shows where to put your own key.
- Pick a topic from the sidebar; they go in order. Press ▶ Play this topic to hear a lesson read aloud, or 🔊 Explain on one section.
- Topics climb from Beginner to Intermediate · Maths, Advanced and Code; use the Show chips to hide levels you don't need. Most have a Watch it animation, Try it demos and runnable code examples, and every topic ends with a quiz: answer it to mark the topic done ✓.
- Stuck? Press 💬 Ask the AI tutor: a small free AI model that runs on your own device and answers from the course.
- Progress is saved in this browser and shared across all the courses on this site.
Learning path: 🐍 Python → 🗄️ SQL & Databases → ∑ Maths for AI → 📈 Machine Learning → 🧠 Deep Learning → 👁️ Computer Vision → 💬 Natural Language Processing → ✨ Generative AI & LLM Apps → 🚀 Flask & Deployment → 🔬 Becoming an AI Researcher
How LLMs work
1. Generative AI Course: Start HereWhat 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.2. How LLMs Work: Tokens, Sampling & TrainingTokens and context windows, how a model picks the next token (temperature and top-p), the three stages of training (pretraining, instruction tuning and preference tuning), reasoning models, and why models hallucinate.3. Prompt EngineeringWrite prompts that work: system and user messages, clear instructions and context, examples (few-shot), structure with tags, asking the model to think first, output formats, prompt templates, and improving prompts with tests instead of guesswork.
Building LLM apps
4. Calling Model APIs from PythonSend messages to a hosted model or a local one, read the reply, stream long answers, count tokens and estimate cost, handle rate limits and errors with retries, and keep API keys safe.5. Structured Output & Tool UseGet JSON your code can trust with schemas and validation, then let the model call your own functions: describe tools, run the calls it asks for, send back results, and keep the loop safe.6. Embeddings & Vector SearchTurn text into vectors that capture meaning, compare them with cosine similarity, search thousands of documents by meaning instead of keywords, and choose an embedding model and a vector database.7. Retrieval-Augmented Generation (RAG)Make a model answer from your own documents: split them into chunks, embed and index them, retrieve the best chunks for each question, put them in the prompt, and make the answer cite its sources. Plus hybrid search, reranking, and how RAG fails.8. Agents & WorkflowsWhen an LLM should follow a fixed workflow and when it should act as an agent that plans and uses tools in a loop; common workflow patterns, memory, multi-agent systems, MCP, and keeping agents safe and affordable.
Making it reliable
9. Evaluating LLM AppsKnow whether your app works and whether a change helped: build a test set, choose checks from exact match to rubrics and LLM judges (and their biases), measure retrieval and grounding separately, and monitor quality, cost and speed in production.10. Guardrails, Security & Responsible UseThe main risks of LLM apps (prompt injection, data leaks, unsafe output handling, excessive agency, misinformation, runaway costs) mapped to the OWASP Top 10 for LLM Applications, the defences for each, and privacy and fairness obligations.11. Multimodal Models & Choosing an ApproachModels that read images and documents, transcribe and speak audio, and generate images and video; then the big design decision for any project: prompting, RAG, fine-tuning, or not using an LLM at all.12. Project: A "Chat With Your Notes" AssistantPut the whole course together: a small assistant that answers questions from your own study notes with citations, an evaluation set, guardrails and cost limits, ready to put online with Flask.13. ✅ Checkpoint: Generative AI & LLM AppsA mixed quiz on the whole Generative AI & LLM Apps course. Pass mark: 7 of 10 on the first try.
When you finish
Next course
🚀 Flask & DeploymentPut your models online. How the web works, Flask apps, templates and forms, databases, REST APIs, serving an ML model, testing, Docker and deploying to the cloud with monitoring.🔬 Becoming an AI ResearcherFrom first paper to funded PhD. How research works, experiments and statistics, writing and publishing, a capstone paper of your own, and a PhD application kit with funding guidance.