基础设施

jev-model-router

@az97131JavaScript更新于 2026-09-20可当场跑

基于 Vercel AI Gateway 的 Jev (TypeSafe) 模型路由器。

英文原文

Jev (TypeSafe) model router on the Vercel AI Gateway

az9713/jev-model-router

它在哪儿调用了 Jev

import { experimental_evaluate as evaluate } from "ai";

eval.mjs:3

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 probe.mjs:8

  1. tier选项

    Which model tier should answer this message?

    • nanoGreeting or trivial chat
    • balancedNeeds real reasoning or code
  2. is_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?' },
  },
});

同类的其他项目