
Learn what a decision model is, what comes back from a decision call, why this course is testing-led, and what you will build across its sections.
See how every section is organised (theory, coding in the IDE, tests and a quiz) and how to follow each coding lesson offline, without an API key.
Download everything you need for the course in one place: the full course code (start and final versions of every lesson and project) and all 12 PDFs: cheat sheets, worksheets, checklists, the glossary, the setup guide and the reading list.
Set up Python, a virtual environment, the course packages and optional Node in VS Code or IntelliJ, then write a checker script that prints Ready.
Install Python 3.11+, git, the course packages, an editor and optional Node on macOS and Windows, and confirm the setup with the same checker script.
Write your first decision: a script that asks one yes or no question about a support ticket, reads the probability and routes the ticket with a threshold.
Tour Decision Lab, the course practice app, from a Python script: the tickets, golden sets, market news, image shelf and the mock decision server.
Keep API keys in a .env file, never in code, and write a checker that reports each key as set or missing and confirms git ignores and never tracks them.
Make one decision call by hand with plain HTTP and JSON, read the status code and answer, see two common mistakes, then repeat the call with the course client.
Ask the same ticket question of a chat model and of a decision model, and see why code can act on a typed answer with a probability but not on free text.
Learn what System One means, how to treat published speed numbers, and a pattern where a fast decision model answers most cases and escalates the unsure ones.
See the five places decisions sit in a product (routing, triage, moderation, gating, ranking), which question type fits each, and build all five in one script.
Try a decision model by hand in Decision Lab before any code: ask yes or no and choice questions, read the probabilities, and see what rewording and reordering move.
Learn when not to use a decision model: for five questions about one ticket, choose between plain code, a decision model and a text model, with a rule of thumb.
Learn the choice question: write the options, build the request, read the chosen option, the probability of every option and how clear-cut the answer was.
Learn the yes or no question: its single probability of yes, how vendors spell it (noul, predicate, boolean), and how to define yes and no clearly.
Learn the score question on ordered levels, how its score number is worked out and why to read it carefully, then combine a rubric into a composite score.
Learn three honest ways to get a number when decision APIs have no number type, and see the box question that finds where something is in a picture.
Write a good decision request from state, question and options, using a checklist from vendor advice, and code a checker that warns about each mistake.
Batch several questions about one ticket into one request and compare it with three separate requests on time, tokens and answers.
Lab: send the ticket desk's three questions for real Decision Lab tickets, compare answers with labels, route with a threshold and print a first score card.
Learn what a probability of 0.8 promises across many answers by counting how often 0.8 answers were right, for an honest and an overconfident model.
See that the confidence field uses a different formula at each vendor: code each formula, feed them the same probabilities and check against vendor doc examples.
Learn, with numbers, why a threshold from one vendor cannot be reused on another: confidence definitions differ and models are calibrated differently.
Lab: send one request several times, measure how much the probability moves, see a near-the-bar decision flip, and add a margin that keeps the action stable.
Make your first Jev call: ask two typed questions about a damaged-item ticket and print the damage probability, the team and a receipt with model, tokens and cost.
Tour TypeSafe's API reference for Jev (System One endpoint, request rules and errors, List models, Models) to find the field names, error codes and model names tests use.
Call Jev two ways, direct through TypeSafe's API and through Vercel AI Gateway, building both requests side by side to see what is the same and what differs.
Tour Vercel AI Gateway's documentation on decision models: the overview, the Decision page, decision fallbacks, the FAQ and two changelog posts.
Ask Jev a yes or no, a choice and a score question about one ticket, sent as separate requests and as one batch, and compare the tokens used each way.
Make a Jev call fail five ways (no key, rejected request, overload, bad key, timeout), see what each looks like, and learn which to retry and which to fix.
Send photos to Jev: check image size, get a crack probability for two photos, ask where the crack is, and see the error when the opt-in header is missing.
Shuffle the options of one choice question four times and watch one model hold its answer while another changes its winner on order alone.
Lab: build a Jev ticket router that asks three questions per ticket and chooses auto, review or human, route sixty labelled tickets, score them and run the tests.
Let Jev read a customer's photo of a broken light: one picture in, three answers out in one request, and a short rule that turns them into a decision a person can check.
Meet Laya, an open decision model that runs locally with no key: build a Laya request beside a Jev request and get an answer without sending a key.
Tour Laya's model card on Hugging Face: its description, installation, quickstart, self-hosting and the card's own list of limits.
Tour Ollama's pages: the download page with install commands, the laya model page with its local API, and the list of laya tags.
Run Laya locally two ways, through the laya serve HTTP server and in process, and see the error you get when something is not installed or running.
Run Laya through Ollama: check the Ollama version, point the same Laya provider at it, ask two questions and estimate how much of Laya's token budget is used.
See two weak spots named on Laya's model card in code: overconfidence, fixed with one number, and option lists too long to fit (a simulation offline).
Lab: run the same ticket classifier on Jev and Laya and compare accuracy and calibration error per question in one table, read without fooling yourself.
Send the same ticket and typed questions to Perplexity's decider, print the request, answers and receipt, and trigger two documented errors.
Tour Perplexity's Decisions API docs: the decisions endpoint reference, the Decisions quickstart, and a cookbook recipe that catches visual bugs in CI.
Send four lamp photos in one Perplexity request, compare the crack probability with and without the cracked photo, and break the image count and URL rules.
Test whether questions asked together influence each other: ask alone and in a group, measure the shift for two models, and compare it with repeat-run noise.
Handle an oversized photo that makes Perplexity hang, count image tiles and fix it by resizing, and compare pinned model versions with moving aliases.
Lab: build a check_photo function that resizes a lamp photo, asks Perplexity's decider a yes or no question and returns pass, fail or review, tested on ten photos.
Make a first OpenAI Decisions API call: write the questions once, inspect the JSON built in OpenAI's dialect, and read the answers with probabilities.
Tour OpenAI's Decisions API reference: the API overview with auth and debugging headers, Create a decision, the Decisions resource and the models page.
Learn how an OpenAI predicate carries yes or no criteria, and handle a per-question refusal with a policy that sends the refused question to a person.
Parse OpenAI's array of answers by hand and match each to its question, then send structured data and images, asking about two lamp photos.
Lab: rebuild the ticket desk on OpenAI decisions with auto, review and human actions, a rule for refused questions, sixty tickets scored and answer rate measured.
Make a first Gemini Decisions API call with yes or no, choice and score questions, see how its dialect differs, and what confidence means in Gemini.
Tour Google's Gemini Decisions API docs in Google AI Studio: the Decisions API page, the models page and the pricing page, including Gemini's definition of confidence.
Send an image, an audio clip and a PDF in one Gemini request, ask two yes or no questions, and see what other providers do when given a PDF.
See how Gemini's input safety filter fails a whole request, catch it as its own error, decide how the product responds, and why tickets should not be combined.
Lab: build a check_document function where Gemini reads supplier PDFs and code compares the total with a limit to pay, approve, reject or review eight documents.
Send a supplier's product video and a tax form PDF to Gemini decisions once each, ask your questions about them, and turn the answers into decisions a person can check.
Design one decision client for five vendors (Jev, Laya, Perplexity, OpenAI, Gemini) by writing the same question in each dialect and lining up the differences.
Build a small adapter in plain Python: one decide function that encodes and decodes four vendors' dialects into a common answer, checked against the full client.
Build the same adapter in TypeScript with fetch: typed questions, a provider per vendor, decide, a fallback order, all tested against the fake decision server.
Make the client try providers in a fallback order with a top-probability bar, keep the best answer when none clears it, and fail open, or closed for safety checks.
Test the adapter offline with a fake decision server: check the contract for every dialect, inject timeouts, overloads and bad bodies, and handle a refusal.
Build an arena that runs one golden set through every vendor via the same client and prints a table of accuracy, calibration and speed, saved to a report.
This course contains the use of artificial intelligence.
A testing-led course on decision models. A decision model does not write text. You describe a case, ask a typed question (yes or no, pick one option, give a score) and get probabilities back. Your code decides what to do with them. Since September 2026 several vendors have released decision APIs, each with its own request shape and its own meaning of "confidence". This course teaches five of them side by side, and then shows, with tests, how to find out when their answers can be trusted on your own data.
What is in the course. 41 sections and 222 video lectures, about 20 hours of video: 212 lessons plus 10 documentation tours, where the real vendor and standards pages are opened on screen (Jev from TypeSafe, Vercel AI Gateway, the Laya model card on Hugging Face, Ollama, the Perplexity, OpenAI and Gemini Decisions APIs, promptfoo, the NIST AI Risk Management Framework and the EU AI Act). Every section ends with a quiz, five sections have a role play, and there are 12 downloadable PDFs: cheat sheets, worksheets, checklists, a glossary, a setup guide and a reading list.
What you will learn
Fourteen projects. Seven product projects: a support ticket queue, trading signal triage on invented market news (education only, not financial advice), content moderation with images, document intake, an agent tool gate, a model router, and a case study of how one real product uses decision models. Seven test engineering projects: flaky test triage in CI, bug report triage and duplicate detection, a visual regression judge, a requirement coverage checker, an API response oracle, a release go or no-go gate and a test data privacy check. The projects are checked with tests or labelled sets, and several are wired into a GitHub Actions workflow.
How the course is built. Each idea is explained first, then coded and run on screen in VS Code (you can follow along in VS Code or IntelliJ). Every coding lesson runs offline against a fake decision model and the Decision Lab practice app, with no key, no network and no cost; you switch to a real vendor when you are ready. You learn to record the source, the model version and the date with every vendor fact and result, because prices, limits and probabilities change from one version to the next.
What this course does not do. It does not rank vendors for you; the course measures no vendor against another (the five-vendor arena runs on simulated profiles offline). You learn to measure them on your own data, with your own golden set.