Prompting fundamentals for open-weight models
Notebook· 01.03· 90–120 min· Lesson 12 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- Write a system prompt with the five building blocks (role, instructions, context, input, expected output) and explain why order matters.
- Use delimiters to separate untrusted input from instructions, and explain why that helps but is not a security boundary.
- Add few-shot examples as message pairs, and measure whether they help.
- Build reusable prompts with
ChatPromptTemplate(variables,partial,MessagesPlaceholder, few-shot templates, escaping braces), and decide when a plain f-string is better. - Compare prompt variants with a small, honest experiment: same data, same model, one change at a time.
Before you start
Lessons 01.01–01.02.
