We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
AI Engineering · Agents In Production
Free preview: the first 2 parts of this 18-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI coursein Agents In Production
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
Let me start with a picture.
Two students sit the same maths test. The first gets a big blank sheet. They can write out their working, make a mistake, cross it out and try again. The second gets a printed form with one tiny box, and nothing else. They must put the final number straight into the box.
Which student gets more answers right? Most teachers would bet on the first. Working it out on paper is how people avoid mistakes.

AI apps give language models that second form all the time. They ask the model to reply in a fixed data format, usually one called JSON (the next slide explains it), so that a program can read the answer.
Why not let the model write freely, and look for a line like "Answer: 42"? For one number, that works. But real apps often need many things back at once: a name, a date, a yes or no, a list. If the model words them a little differently each time, the program breaks. A fixed format gives every piece its own place.
So it is a very good habit for programs. This lesson measures what it costs in right answers.
Please read this slide slowly if any word is new. Every slide after it uses these words.

Model. Here, a language model: an AI that reads text and writes text, like the one behind ChatGPT.
JSON. A simple, fixed way to write data so a program can read it. It looks like this: {"answer": 42}. The part in quotes, answer, is called a field. The value after the colon, 42, is what the field holds.
Schema. A rule that says exactly which fields a JSON reply must have, and what kind of value goes in each. For example: "one field called answer, and it must be a whole number".
Enforced. Some model tools can force a reply to follow a schema. A model writes one small piece at a time, and at each step the tool blocks any piece that would break the rule. So if the schema says the answer is a whole number, the model must start writing digits at once.
Working. The steps a model writes before its final answer, like a student's rough work. Engineers often call this chain of thought.
Token. A small piece of text a model reads or writes, roughly three quarters of a word. More tokens means more time and more cost.
Temperature. A setting for how much a model varies its words. At 0, it always picks its most likely next word.
Model size. Model names end with their size. In llama3.2:3b, the 3b means about 3 billion numbers inside the model, learned in training. Bigger usually means more capable. Both models in this lesson are small.