Skip to content

feat: trace judge calls in Braintrust - #369

Draft
mattrossman wants to merge 4 commits into
mainfrom
mattrossman/ai-1271-trace-judge-calls-in-braintrust
Draft

mattrossman wants to merge 4 commits into
mainfrom
mattrossman/ai-1271-trace-judge-calls-in-braintrust

Conversation

@mattrossman

@mattrossman mattrossman commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Diff note: 23 of the changed eval files only swap judge() for ctx.judge()

Scorers now ask for verdicts through ctx.judge(), which records each judge call's model, full prompt, output, tokens and timing in result.json. The uploader logs each call as an LLM span under the score span:

passed (score, purpose: scorer)
├─ gpt-6-sol (llm, purpose: scorer)
└─ gpt-6-sol (llm, purpose: scorer)

purpose: "scorer" is how Braintrust keeps judge cost out of preset cost charts. Core no longer exports judge() so folks are encouraged to use ctx.judge as the preferred way to access the judge in scorers similar ctx.query.

As an incidental fix, the root eval span no longer logs agent tokens, since its LLM spans carry them. Braintrust sums metrics across every span in a trace, so with the initial approach in #351 the experiment table double counts tokens (example). Note aiSdkAgent has no per-request usage so its rows now show no tokens, but it's unused and slated for removal anyway.

Ran the regression suite with codex-gpt-6-luna through the refresh workflow (snapshot, trace with 3 judge calls).

Closes AI-1271

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Oct 5, 2026 9:18pm UTC

Request Review

This branch was successfully deployed

1 active (outdated) deployment
Preview — 3571f2f5 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant