Loading video player…

Observing AI Features: Traces, Cost and Latency (Overview)

Your AI feature works on your laptop. This course shows what it would do for real users: each step it takes, what it costs, and how long people wait. You’ll build a trace, the record of every step one question to the assistant took.

Whatever feature you’ve built, this course uses a ready-made one to observe, the Ridgeline Huts assistant, which comes ready to run in the code download, so you can start right here. The assistant faces a simulated summer season, where a wrong answer can send a hiker up a closed path, and you’ll need to find that one request among hundreds. Every lesson ends with a number you produced.

What You’ll Learn

By the end of this course, you’ll be able to:

  • Log every request with an ID and a timer.
  • Trace every request through retrieval, model calls and tool calls.
  • Find the step that caused a bad answer from its trace.
  • Keep personal data out of what you record.
  • Report cost and latency per request with percentiles.

The Project: The Tripled Bill and the Full Hut

In the project, a simulated week brings two problems: the treasurer asks why the bill tripled, and a hiker was sent to a full hut. You’ll report the week’s cost and latency, trace the full-hut answer to the step that went wrong, and add an eval case. Then you’ll explain it to your AI mentor, a chat that plays the treasurer and the head warden.

Before You Start

You should have built an AI feature in JavaScript that streams answers from an Express route, answers from documents, calls tools, and has evals.

For the project, you’ll need Node.js 26 and an API key for one model provider. The project’s runs on that key cost a few dollars or more.

At December 2, 2026 prices, the whole project comes to about $2.50 to $4.50 with OpenAI (gpt-5.4-mini-2026-03-17) and about $7 to $15 with Anthropic (claude-sonnet-5-5, with claude-opus-4-6 judging). The low end is a week with the usual mix of questions, and the high end is a week showing the treasurer’s pattern. Here’s the estimate per step:

Step What runs With OpenAI With Anthropic
1 a few questions under a tenth of a cent each under a quarter of a cent each
2 1,400 questions about 94 cents about $2.20
3 no model calls, only your scripts nothing nothing
4 replays, ten case runs, five set reruns about $1.50 about $5 to $8, mostly the judge

If your simulated week shows the treasurer’s pattern, step 2 comes to around $2.80 with OpenAI and around $6.60 with Anthropic. These are estimates rather than caps. Longer answers, retries, and extra tool rounds can push them higher, so set a spending limit on the key with headroom above them.

How the Course Works

The lessons come as text and video, and the coding exercises run in your browser with no key. A project, a quiz, and a summary close the course.

Below this video are the slides and the code download. The code download holds the starting project. Its traffic simulator sends the assistant hiker questions, tidier than real ones. You’ll set it up in the first lesson, Add a Request ID and a Timer.

Download

Course Slides (.pdf)

829.1 KB
Download

Sample Code (.zip)

10.2 KB

00:00 Welcome to Observing AI Features: Traces, Cost and Latency. Your AI feature works on your laptop. This course shows what it would do for real users: each step, its cost, and how long they wait.

00:15 Here’s a first taste, a trace of every step one question took. You’ll build it. Whatever you’ve built, this course uses a ready-made feature, the Ridgeline Huts assistant, so you don’t need the previous course.

00:32 It faces a simulated season, where a wrong answer can send a hiker up a closed path. You’ll need to find one request among hundreds. Every lesson ends with a number you produced.

00:46 You’ll log every request, trace its steps, find the one behind a bad answer, keep personal data out of the record, and report cost and latency with percentiles.

00:58 In the project, the treasurer asks why a week’s bill tripled, and a hiker was sent to a full hut. You’ll report its cost and latency, trace the full-hut answer to its wrong step, add an eval case, and explain it to an AI mentor playing the treasurer and the head warden.

01:18 You should have built a JavaScript AI feature that streams from Express, answers from documents, calls tools, and has evals. The project needs Node 26 and one model provider’s API key.

01:30 Its runs cost a few dollars or more, estimated below.

01:35 Lessons are text and video, and exercises run in your browser with no key. A project, quiz and summary close the course.

01:45 Below are the slides and the code download. Its traffic simulator sends hiker questions, tidier than real ones. Set it up in the first lesson, Add a Request ID and a Timer.

Become a Member to join the conversation.