P8:/portal/daemon/extract 萃取模型 scout → qwen3-30b(真筆記實測:品質不降、額度天花板翻倍)

免金鑰路短板=Workers AI 免費 10,000 neurons/日。leo 真實筆記 8 篇 × 5 模型實測
(arcrun-rag docs/benchmarks/p8-extractor-quality/,usage.neurons 為 CF 原生計量):
scout 84 n/檔(119 檔/日)→ qwen3-30b 43 n/檔(232 檔/日);格式合規 8/8、
三元組 7.6 條全可解析(scout 5.0)。granite 最便宜但 5/8 缺段=實測否決。
聊天 recipe(workers_ai_chat)不動;只 commit 本 hunk,工作區另有 P7 進行中改動未收。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
uncle6me-web
2026-08-09 00:40:52 +08:00
parent 466e56bc2d
commit aa6b899276
2 changed files with 22 additions and 3 deletions
+12 -3
View File
@@ -780,9 +780,18 @@ portalRouter.post('/portal/daemon/extract', (c) =>
`## 關聯\n- 實體A ${REL} 關係 ${REL} 實體B3-8 行,用上面實體名)\n\n原稿:\n${srcText}`;
try {
// 模型與 workers_ai_chat recipe 同一支(選型實測見 api-recipe-seeds.ts:140
// llama-4-scout 2373ms/答案最完整;對照 Gemini gemma-4-31b-it 16.87 秒且吐英文草稿)。
const out = (await c.env.AI.run('@cf/meta/llama-4-scout-17b-16e-instruct', {
// 🔴 模型選型(P8 短板齊平,2026-08-09 實測換的)
// 免金鑰路的短板=Workers AI 免費 10,000 neurons/日。用 leo 真實筆記 8 篇
// × 5 模型實測(arcrun-rag docs/benchmarks/p8-extractor-quality/
// usage.neurons 為 CF 回應原生計量):
// llama-4-scout84 n/檔 ⇒ 119 檔/日(t181 選的舊現役,當時只比延遲與完整度)
// qwen3-30b-a3b-fp843 n/檔 ⇒ 232 檔/日,格式合規 8/8、
// 三元組平均 7.6 條全可解析(scout 5.0),品質不降反升
// granite-4.0-h-micro11.7 n/檔(最便宜)但 5/8 缺段、三元組幾乎全滅 ⇒ 否決
// ⇒ 換 qwen3-30b:同額度天花板直接翻倍,品質有據(P8:要換模型就要實測並講清楚)。
// (聊天用的 workers_ai_chat recipe 仍是 scout,選型見 api-recipe-seeds.ts:140
// 萃取與聊天自此分開選型——萃取是額度大戶,聊天量小不動。)
const out = (await c.env.AI.run('@cf/qwen/qwen3-30b-a3b-fp8', {
messages: [{ role: 'user', content: prompt }],
max_tokens: 2048,
temperature: 0.2,
@@ -325,6 +325,16 @@
已登記庫帶 stats/auto 庫帶 stats/空庫 card_count=triplet_count=0)。
vitest + node --check 待 leo 驗收環境跑(本機無 Workers runtime)。
- [x] **P8-模型切換:/portal/daemon/extract 萃取模型 scout → qwen3-30b2026-08-09,任務層小改)**
來源=arcrun-rag `system-dev/docs/3-specs/pending-changes.md` P8「短板齊平」(leo 08-08 裁決通過)。
免金鑰路短板=Workers AI 免費 10,000 neurons/日;用 leo 真實筆記 8 篇 × 5 模型實測
arcrun-rag `docs/benchmarks/p8-extractor-quality/`usage.neurons 為 CF 原生計量):
scout 84 n/檔(119 檔/日)→ qwen3-30b-a3b-fp8 43 n/檔(232 檔/日),
格式合規 8/8、三元組平均 7.6 條全可解析(scout 5.0)——品質不降反升、天花板翻倍;
granite-4.0-h-micro 最便宜(11.7 n/檔)但 5/8 缺段、三元組近乎全滅 ⇒ 實測否決。
改動=portal.ts extract 端點一行模型字串+選型註解;聊天 recipeworkers_ai_chat)不動。
tsc --noEmit 驗證:7 個 pre-existing 錯誤(HEAD 同樣清單),零新增。
## 第二波(不在本 SDD 動工範圍,掛號)
- MCP token 綁庫集合(design §9PR#15 擴充,只動 `mcp/`