@ai-ecoverse/gpu-ask.js

中文文档
0.1.0发布于 2026/09/27Apache-2.0TypeScriptES Module零依赖近 30 天下载 3013

Agent questions in the browser: ONNX tagger + CRF + ask-tool compiler

原始使用文档
文档目录4 节
  1. Schema
  2. Numbers
  3. How it works
  4. License

@ai-ecoverse/gpu-ask.js

Agent questions in the browser. Prose in, structured ask-tool choices out — on-device, nothing sent anywhere.

A ~570k-parameter token tagger (gpu-time lineage) marks the question and options; a deterministic compiler builds an ask-tool payload your UI can render. Emissions run as ONNX; features, CRF, and compile stay in TypeScript. The two-member ensemble is about 10 MB and ships inside the npm package.

Live demo · Weights · npm install @ai-ecoverse/gpu-ask.js onnxruntime-web

import * as ort from "onnxruntime-web/wasm";
import { bundledModelUrl, loadAsk, parse } from "@ai-ecoverse/gpu-ask.js";

// Configure ORT wasmPaths for your bundler (see demo/ort-wasm.ts).
const ask = await loadAsk(bundledModelUrl(), { ort });
// or from Hugging Face:
// const ask = await loadAsk("https://huggingface.co/ai-ecoverse/gpu-ask.js/resolve/main/v13", { ort });

const { questions } = await parse(ask, agentMessage);
// questions[0].kind      → "either_or" | "yes_no" | "multi_choice" | "open"
// questions[0].options   → ["merge it now", "wait for CI"]
// questions[0].propose   → true

The loader verifies each ONNX member's SHA-256 against manifest.json.

Schema

FieldTypeMeaning
kindyes_no | either_or | multi_choice | openHow the UI should ask
proposebooleanAssistant offers to act
promptstringQuestion span text
optionsstring[]Tagged choices
defaultnumber | nullRecommended option index
multiSelectbooleanAllow several options
span[start, end]Character range in cleaned text

Numbers

Pooled out-of-fold on 4,930 hand-labeled public agent turns (v13 recipe, compiler kind):

ModelParamsFalse qKindoptions_ok
v13 ensemble (shipped)571k × 23.7%85.4%*67.5%*
Ettin-150m teacher150M2.4%87.8%74.5%

*CV with constrained kind rerank. The browser path uses compiler kind (Python-only rerank is not in ONNX).

How it works

Sparse hashed features feed a bidirectional affine-scan tagger. A linear-chain CRF picks token roles (O, Q_*, OPT_*, REC). Deterministic compile recovers missing either/or sides, splits inline lists, and decides kind. Only the emission network is ONNX (WASM via onnxruntime-web); everything else is TypeScript.

Training lives in ai-ecoverse/gpu-questions. Architecture follows gpu-time.

License

Apache-2.0. Part of AI Ecoverse.

版本与发布记录

@ai-ecoverse/gpu-ask.js 共发布 1 个版本,首次发布于 2026/09/27;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/09/271 个月前

关于 @ai-ecoverse/gpu-ask.js 的常见问题

@ai-ecoverse/gpu-ask.js 是什么?

Agent questions in the browser: ONNX tagger + CRF + ask-tool compiler

如何安装 @ai-ecoverse/gpu-ask.js?

在项目目录运行 npm install @ai-ecoverse/gpu-ask.js,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:onnxruntime-common(>=1.30.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ai-ecoverse/gpu-ask.js 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ai-ecoverse/gpu-ask.js 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ai-ecoverse/gpu-ask.js 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.9。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ai-ecoverse/gpu-ask.js 可以商用吗?

@ai-ecoverse/gpu-ask.js 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/gpu-ask.js 的下载量有多少?

根据 npm 官方下载统计,@ai-ecoverse/gpu-ask.js 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,013 次,日均约 100 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-ecoverse/gpu-ask.js 还在维护吗?

最新版本 0.1.0 发布于 2026/09/27(1 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/09/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。