基础设施
基于 Vercel AI Gateway 的 Jev (TypeSafe) 模型路由器。
Jev (TypeSafe) model router on the Vercel AI Gateway
import { experimental_evaluate as evaluate } from "ai";链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 probe.mjs:8
tier选项Which model tier should answer this message?
nano — Greeting or trivial chatbalanced — Needs real reasoning or codeis_greeting是/否Is this only a greeting?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
tier: { type: 'choice', instructions: 'Which model tier should answer this message?',
criteria: { nano: 'Greeting or trivial chat', balanced: 'Needs real reasoning or code' } },
is_greeting: { type: 'boolean', instructions: 'Is this only a greeting?' },
},
});