evaluate( )

Pattern
Jev Best-of-N Judge
Three prepared replies sit on the table. A Jev choice lifts the winner only when its probability clears 0.70.
BeginnerSep 2026View the full pattern on desktop


Problems solved
- Pick among prepared replies with a choice question
- Use the replies themselves as the choice criteria
- Leave every reply on the table when the selected probability is too close
Use cases
- Best-of-N answer selection
- Refusing a toss-up instead of auto-shipping
- Teaching a choice question over a closed reply set
AI SDK APIs
experimental_evaluate
Tags
jevevaluationtyped-decisionschoicebest-of-nai-sdk
Requirements
- Node.js
- 24+
- Memory
- 256MB
- Other
- Vercel AI Gateway API key
Environment variables
AI_GATEWAY_API_KEYGet key
External services
vercel-ai-gatewayupstash
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktop






