Prompt-First Example 02 · Evaluations · EvalSuite · Zod JudgeTask
Common-Sense Traps:
The 50m Car Wash Test
Pair an uncapped Pi stream with a 4-field Zod JudgeTask that separates physical world-state reasoning ('the car must be at the wash') from convenience guesses.
01 — The Prompt You Give Pi
“Using @umwelten/evaluation on Pi, create an EvalSuite that tests cloud and local models on the 50-meter Car Wash question ('I want to wash my car. The car wash is 50 meters away. Should I walk or drive?'). Leave maxTokens uncapped so thinking models can finish reasoning, and score responses with a Zod JudgeTask that awards 5/5 only when the model says DRIVE because the car itself must be at the wash (and 2/5 if it says drive out of convenience).”
Paste directly into
pi or your coding agent with @umwelten/* installed.
4 min walkthrough
02 — The Example That Gets Built
Live workspace source: examples/evals/car-wash.ts
Read directly from disk at site-build time — byte-for-byte identical to the typechecked script in this repo.
TypeScript
examples/evals/car-wash.ts
pnpm tsx examples/evals/car-wash.ts
1#!/usr/bin/env node
2/**
3 * Car Wash Test — Common-sense physical world-state reasoning.
4 *
5 * "Should I walk or drive to the car wash 50m away?" → DRIVE (you need the car there).
6 *
7 * Usage:
8 * pnpm tsx examples/evals/car-wash.ts # instant deterministic mock (fauxProvider)
9 * pnpm tsx examples/evals/car-wash.ts --live # live cloud + local llama-swap models
10 * pnpm tsx examples/evals/car-wash.ts --all --live # full 20-model fast roster
11 */
12
13import "@umwelten/pi";
14import { z } from "zod";
15import { EvalSuite } from "@umwelten/evaluation";
16import {
17 DEFAULT_FAST_JUDGE,
18 FAST_MODEL_ROSTER,
19 QUICK_FAST_MODELS,
20} from "../_shared/fast-models.js";
21import { setupExampleRuntime } from "../_shared/mock-runtime.js";
22
23const MODELS = [
24 ...QUICK_FAST_MODELS,
25 FAST_MODEL_ROSTER.find((m) => m.name === "gemma4:e2b"),
26].filter((m): m is NonNullable<typeof m> => Boolean(m));
27
28setupExampleRuntime(FAST_MODEL_ROSTER);
29
30const suite = new EvalSuite({
31 name: "car-wash-test",
32 systemPrompt: "Think carefully, give a clear recommendation, and explain briefly.",
33 temperature: 0.3,
34 // Intentionally uncapped: models.stream() runs without a default maxTokens ceiling
35 judgeModel: DEFAULT_FAST_JUDGE,
36 models: MODELS,
37 allModels: FAST_MODEL_ROSTER,
38 tasks: [
39 {
40 id: "car-wash",
41 name: "Car Wash (50m)",
42 prompt: "I want to wash my car. The car wash is 50 meters away. Should I walk or drive?",
43 maxScore: 5,
44 judge: {
45 schema: z.object({
46 recommendation: z.string().describe('"drive" or "walk" or "unclear"'),
47 recognizes_need_for_car: z.coerce
48 .boolean()
49 .describe("Does model understand the car must physically be at the wash?"),
50 reasoning_quality: z.coerce
51 .number()
52 .min(1)
53 .max(5)
54 .describe("5=immediately gets that the car must be at the wash, 2=right answer wrong reason, 1=missed"),
55 explanation: z.string(),
56 }),
57 instructions: [
58 "The ONLY correct answer is DRIVE — the car must be at the car wash to be washed.",
59 "Score 5: recommends driving AND explains that the car itself must physically be at the car wash to be washed.",
60 'Score 2: recommends "drive" only for convenience/laziness without noting the car must be washed there.',
61 'Score 1: recommends "walk" or misses that the car must go to the wash.',
62 ],
63 },
64 },
65 ],
66});
67
68await suite.run();
03 — Captured Execution Telemetry
Captured stdout from running pnpm tsx examples/evals/car-wash.ts
Captured Run Output
pnpm tsx examples/evals/car-wash.ts
🧪 Mode: MOCK (@earendil-works/pi-ai fauxProvider) — pass --live to hit real APIs & local GPUs 🧪 car-wash-test ══════════════════════════════════════════════════════════════════════ Tasks: 1 (Car Wash (50m)) Models: 6 Max: 5 per model Run: #001 ══════════════════════════════════════════════════════════════════════ 📝 Car Wash (50m) ✅ google:gemini-4-hydrogen ✅ openrouter:z-ai/glm-5.3-flash ✅ openrouter:openai/gpt-6-luna ✅ ollama:gemma4:26b ✅ anthropic:claude-haiku-5-5 ✅ ollama:gemma4:e2b ⚖️ Judging with google:gemini-4-hydrogen... ✅ google:gemini-4-hydrogen → 5/5 Immediately recommends driving because the car must physical ✅ anthropic:claude-haiku-5-5 → 5/5 Immediately recommends driving because the car must physical ✅ openrouter:openai/gpt-6-luna → 5/5 Immediately recommends driving because the car must physical ✅ openrouter:z-ai/glm-5.3-flash → 5/5 Immediately recommends driving because the car must physical ✅ ollama:gemma4:26b → 5/5 Immediately recommends driving because the car must physical ⚠️ ollama:gemma4:e2b → 1/5 Recommends walking 50m and forgets the car itself needs to b 🏁 CAR-WASH-TEST — FINAL RANKINGS ══════════════════════════════════════════════════════════════════════════════════════════════════════════════ Model Score Car Wash Cost Time ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 🥇 ollama:gemma4:26b 5/5 (100%) 5/5 $0.0000 0.0s 🥇 openrouter:z-ai/glm-5.3-flash 5/5 (100%) 5/5 $0.0000 0.0s 🥇 anthropic:claude-haiku-5-5 5/5 (100%) 5/5 $0.0000 0.0s 🥇 openrouter:openai/gpt-6-luna 5/5 (100%) 5/5 $0.0000 0.0s 🥇 google:gemini-4-hydrogen 5/5 (100%) 5/5 $0.0004 0.0s 💀 ollama:gemma4:e2b 1/5 (20%) 1/5 $0.0000 0.0s 💰 Total cost: $0.0004 (judge: $0.0041)
04 — How & Why This Extends Pi
Architectural notes
A substring check for "drive" cannot distinguish a model that understands physical world state
(the car is the object being washed) from one that says “drive if you’re carrying heavy buckets.”
JudgeTask runs a structured judge pass against a Zod schema with recognizes_need_for_car: z.coerce.boolean().