A tiny, zero-dependency router for System 1 decision models.
npm install judgyimport { context, createJudgy, question } from 'judgy';
const judgy = createJudgy().jev(process.env.TYPESAFE_AI_API_KEY ?? '', 'jev-latest');
const ticket = context().text('The mug arrived with a big crack. I need a replacement by Friday.');
const answers = await judgy.run(ticket, [
question('damaged').ask('Does the customer report a damaged item?').bool(),
question('action').ask('What should we do?').choice('approve', 'reject', 'escalate'),
question('urgency').ask('How urgent is this?').score(['This week.', 'Today.', 'Within the hour.'])
]);
if (answers.damaged.ok) answers.damaged.value; // boolean
if (answers.action.ok) answers.action.value; // 'approve' | 'reject' | 'escalate'
if (answers.urgency.ok) answers.urgency.value; // 0 to 2createJudgy().jev(key, 'jev-latest'); // Jev, by TypeSafe
createJudgy().luna(key, 'gpt-6-luna'); // GPT Luna decisions, by OpenAI
createJudgy().google(key, 'gemini-decision-1'); // Gemini decisions, by Google
createJudgy().clef(key, 'clef', accountId); // Clef, on Cloudflare Workers AIMIT.