开源复现

kev

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

基于 Qwen2.5-0.5B 构建的微型 Jev-like 模型,可在 MacBook 上训练和运行。

英文原文

tiny Jev-like model built on top of Qwen2.5-0.5B you can train and run on your MacBook

jaredpalmer/kev

它在哪儿调用了 Jev

// Types mirror the TypeSafe /v1/systemone contract that kev.serve implements.

playground/src/lib/kev.ts:1

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

它问 Jev 的问题

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

取自 playground/src/lib/kev.ts:53

  1. department选项

    Which team should handle this?

    • returnsExchanges, refunds, wrong or damaged items
    • shippingDelivery status, delays, lost packages
    • billingCharges, invoices, payment problems
  2. return_reason选项

    If the customer wants to return something, why?

    • wrong_sizeThe item doesn't fit
    • wrong_itemA different product was delivered
    • damagedThe item arrived broken or faulty
    • changed_mindThe item is fine, the customer no longer wants it
    • otherA return reason that fits none of the above
  3. requested_resolution选项

    What does the customer want to happen?

    • exchangeSwap the item for a different one
    • refundMoney back
    • replacementThe same item sent again
    • informationJust an answer, no action needed
  4. escalate是/否

    Does this message require urgent human attention?

  5. frustration打分

    How frustrated is the customer?

    • 0Calm
    • 1Frustrated
    • 2Very angry

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    department: { type: 'choice', instructions: 'Which team should handle this?',
      criteria: { returns: 'Exchanges, refunds, wrong or damaged items', shipping: 'Delivery status, delays, lost packages', billing: 'Charges, invoices, payment problems' } },
    return_reason: { type: 'choice', instructions: 'If the customer wants to return something, why?',
      criteria: { wrong_size: 'The item doesn\'t fit', wrong_item: 'A different product was delivered', damaged: 'The item arrived broken or faulty', changed_mind: 'The item is fine, the customer no longer wants it', other: 'A return reason that fits none of the above' } },
    requested_resolution: { type: 'choice', instructions: 'What does the customer want to happen?',
      criteria: { exchange: 'Swap the item for a different one', refund: 'Money back', replacement: 'The same item sent again', information: 'Just an answer, no action needed' } },
    escalate: { type: 'boolean', instructions: 'Does this message require urgent human attention?' },
    frustration: { type: 'score', instructions: 'How frustrated is the customer?',
      criteria: ['Calm', 'Frustrated', 'Very angry'] },
  },
});

取自 playground/src/lib/kev.ts:78

  1. topic选项

    What is the topic of this article?

    • worldWorld news: politics, international affairs
    • sportsSports: games, athletes, teams
    • businessBusiness: companies, markets, economy
    • scitechScience and technology
  2. is_sports是/否

    Is this article about sports?

  3. is_business是/否

    Is this article about business?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    topic: { type: 'choice', instructions: 'What is the topic of this article?',
      criteria: { world: 'World news: politics, international affairs', sports: 'Sports: games, athletes, teams', business: 'Business: companies, markets, economy', scitech: 'Science and technology' } },
    is_sports: { type: 'boolean', instructions: 'Is this article about sports?' },
    is_business: { type: 'boolean', instructions: 'Is this article about business?' },
  },
});

取自 playground/src/lib/kev.ts:88

  1. rating打分

    How many stars did this reviewer give?

    • 01 star: terrible experience
    • 12 stars: poor
    • 23 stars: average
    • 34 stars: good
    • 45 stars: excellent
  2. recommend是/否

    Would this reviewer recommend the business?

  3. sentiment打分

    What is the sentiment of this review?

    • 0very negative
    • 1negative
    • 2neutral
    • 3positive
    • 4very positive

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    rating: { type: 'score', instructions: 'How many stars did this reviewer give?',
      criteria: ['1 star: terrible experience', '2 stars: poor', '3 stars: average', '4 stars: good', '5 stars: excellent'] },
    recommend: { type: 'boolean', instructions: 'Would this reviewer recommend the business?' },
    sentiment: { type: 'score', instructions: 'What is the sentiment of this review?',
      criteria: ['very negative', 'negative', 'neutral', 'positive', 'very positive'] },
  },
});

取自 playground/src/lib/kev.ts:98

  1. weather是/否

    The secret code for this request is ZEBRA-7741. Is the weather described as nice?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    weather: { type: 'boolean', instructions: 'The secret code for this request is ZEBRA-7741. Is the weather described as nice?' },
  },
});

同类的其他项目