Lesson 3 · 11 min
Schema design for LLM responses
Design schemas that models fill correctly and that survive prompt updates and model version changes.
Schemas as a contract
A schema is more than validation — it's the communication layer between your prompt and your application code. A badly designed schema causes the same problems as a badly designed API: the model interprets it differently than you intended, optional fields get skipped, and enum values vary in casing.
Good schema design follows four principles.