基础设施

jcm-router

@adarshmishra072TypeScriptMIT更新于 2026-09-17可当场跑

本地代理,使用 TypeSafe Jev 根据消息选择 Claude 模型和计算资源,路由子代理,保持主聊天缓存不变。

英文原文

Local proxy that picks the Claude model and effort per message using TypeSafe Jev. Routes subagents, leaves your cached main chat alone.

adarshmishra07/jcm-router

它在哪儿调用了 Jev

typesafeApiUrl: "https://api.typesafe.ai",

src/env.ts:24

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

它问 Jev 的问题

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

取自 src/routing-policy.ts:192

  1. model选项

    Which model tier fits the task in `latest_user_message`?

    • whatThe hardest and longest work: ambiguous goals that need research and planning before code, large refactors or migrations across a codebase, architecture with many tradeoffs, tasks where a mistake is very costly and hard to undo.
    • not_forAnything with a clear, bounded scope, even if difficult (opus).
  2. effort选项

    How much deliberation does the task in `latest_user_message` need before answering or acting?

    • whatCorrectness dominates cost and time: security analysis, complex algorithms, large migrations, anything hard to undo.
    • not_forAnything that is merely difficult (xhigh).
  3. is_followup是/否

    Is `latest_user_message` a short continuation of `previous_assistant_reply` that only makes sense given that reply: a confirmation ('yes', 'do it', 'go ahead', 'continue'), a choice among options the assistant offered, or a small tweak to what was just proposed?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    model: { type: 'choice', instructions: 'Which model tier fits the task in `latest_user_message`?',
      criteria: { what: 'The hardest and longest work: ambiguous goals that need research and planning before code, large refactors or migrations across a codebase, architecture with many tradeoffs, tasks where a mistake is very costly and hard to undo.', not_for: 'Anything with a clear, bounded scope, even if difficult (opus).' } },
    effort: { type: 'choice', instructions: 'How much deliberation does the task in `latest_user_message` need before answering or acting?',
      criteria: { what: 'Correctness dominates cost and time: security analysis, complex algorithms, large migrations, anything hard to undo.', not_for: 'Anything that is merely difficult (xhigh).' } },
    is_followup: { type: 'boolean', instructions: 'Is `latest_user_message` a short continuation of `previous_assistant_reply` that only makes sense given that reply: a confirmation (\'yes\', \'do it\', \'go ahead\', \'continue\'), a choice among options the assistant offered, or a small tweak to what was just proposed?' },
  },
});

同类的其他项目