Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
LangChain, Vercel AI SDK, LlamaIndex, and Mastra emit token-usage events you subscribe to; raw OpenAI and DSPy expose usage on the response or compile loop but leave runtime aggregation to you.
Think of receipts at a diner. Some restaurants email you the receipt automatically when you leave (LangChain, Vercel AI SDK, LlamaIndex, Mastra). Others print it and leave it on the table. You can read it and file it, but if you forget, no record exists (raw OpenAI SDK). DSPy is a restaurant that tracks your bill carefully during a tasting menu (the compile loop) but leaves you to track everyday meals on your own. All of them know the price; only some hand it to you without asking.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 to 8 min: four auto-surfacing frameworks + two non-auto + streaming caveat + capture vs aggregation distinction + 2026 OTel-routed production pattern.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming the framework solves cost reporting end to end. It captures usage; you still own aggregation, attribution, and the dashboard.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.