C.W.K.
Stream
Lesson 06 of 10 · published

Cost-Quality-Latency Triangles

~14 min · evaluation, tradeoffs

Level 0Apprentice
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

Three numbers, one decision

For any prompt change you can move along three axes: cost (tokens, $), quality (golden-set score), and latency (p95 ms). Improving all three at once is rare; usually you trade one against another. Make the trade explicit.

Useful comparisons

  • v_new improves quality by 4% but increases p95 latency by 800ms — worth it for batch jobs, not for chat.
  • v_new reduces cost by 40% but loses 1% on the golden set — usually worth it; verify the lost cases are not the high-stakes ones.
  • v_new is faster (smaller model) and ties on quality on routine inputs but degrades on hard ones — route hard inputs to the bigger model.

The dashboard

Eval runs should produce one chart per prompt: cost vs quality, latency vs quality. Decisions become visible. Stakeholders can see why you chose what you chose.

Code

Eval result schema·json
{
  "prompt_version": "support@8",
  "model": "claude-haiku-4-5",
  "golden_set": "goldens/v3.jsonl",
  "pass_rate": 0.94,
  "cost_per_1k_calls_usd": 1.20,
  "p50_latency_ms": 450,
  "p95_latency_ms": 1850,
  "date": "2026-05-04"
}

External links

Exercise

For your top three prompts, log cost, quality, and latency over a week. Plot the three-number scatter. Identify the dominated points (worse on all three than another version).

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.