开源复现
基于 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
// Types mirror the TypeSafe /v1/systemone contract that kev.serve implements.链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 playground/src/lib/kev.ts:53
department选项Which team should handle this?
returns — Exchanges, refunds, wrong or damaged itemsshipping — Delivery status, delays, lost packagesbilling — Charges, invoices, payment problemsreturn_reason选项If the customer wants to return something, why?
wrong_size — The item doesn't fitwrong_item — A different product was delivereddamaged — The item arrived broken or faultychanged_mind — The item is fine, the customer no longer wants itother — A return reason that fits none of the aboverequested_resolution选项What does the customer want to happen?
exchange — Swap the item for a different onerefund — Money backreplacement — The same item sent againinformation — Just an answer, no action neededescalate是/否Does this message require urgent human attention?
frustration打分How frustrated is the customer?
0 — Calm1 — Frustrated2 — Very angryimport { 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
topic选项What is the topic of this article?
world — World news: politics, international affairssports — Sports: games, athletes, teamsbusiness — Business: companies, markets, economyscitech — Science and technologyis_sports是/否Is this article about sports?
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
rating打分How many stars did this reviewer give?
0 — 1 star: terrible experience1 — 2 stars: poor2 — 3 stars: average3 — 4 stars: good4 — 5 stars: excellentrecommend是/否Would this reviewer recommend the business?
sentiment打分What is the sentiment of this review?
0 — very negative1 — negative2 — neutral3 — positive4 — very positiveimport { 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
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?' },
},
});