One question through the whole LLM stack
Each function is labelled with the phase that teaches it properly. Only fake_model stands in for a real call.
An LLM engineer builds the system around the model: input checks, retrieval of the right data, the prompt, the model call, output validation, tools, evaluation, security and monitoring. This topic maps that stack to the phases of the course.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Add a step to the pipeline that refuses questions containing an email address (@ followed by a . later is enough for this exercise) with the message Please don't share personal details..
Change retrieve so it returns the matching document keys too, and print them as the sources.
Explain it without notes
Name the layers of a typical LLM feature, from the user's input to the answer.
Why is evaluation called the test suite of LLM applications?
Expected output
Q: How long does a refund take?
A: Within 5 working days. | source: refund
Q: Can I pay with gold coins?
A: Not in my documents. | source: none
log:
question=28 chars, docs=1, prompt=112 chars
question=26 chars, docs=0, prompt=91 chars