@bendyline/gezel-inference

中文文档
1.0.8发布于 2026/11/05MITTypeScriptESM + CJS构建来源已验证近 30 天下载 1885

Gezel's on-device inference runtime: native engines, local model management, embeddings, knowledge search, and OpenAI-compatible routes.

原始使用文档
文档目录5 节
  1. Install
  2. Use it through the app SDK
  3. Entry points
  4. Stability
  5. Documentation

@bendyline/gezel-inference

The on-device inference runtime shared by Gezel and by applications that embed it. It runs local AI models on the user's own computer and answers them through OpenAI-compatible routes:

  • Native engines — starting, sizing, and stopping llama.cpp, MLX, and the other on-device engines, with admission control so models fit in memory.
  • Model management — listing, downloading, verifying, and preparing local chat models.
  • Embeddings and knowledge — the on-device text embedder (model: "gezel:embeddings") and search over installed knowledge catalogs, each in its own worker.
  • OpenAI-compatible routes — /v1/chat, /v1/responses, /v1/embeddings, /v1/models, /v1/models/ensure, /v1/knowledge, and the engine routes.

It holds no product state: no gezels, projects, chats, tools, cloud providers, or UI. Those belong to the full Gezel service, @bendyline/gezel-service, which uses this same runtime.

Install

npm install @bendyline/gezel-app-sdk @bendyline/gezel-inference

Node 24 or newer. On-device text embeddings and the optional relevance model also need the @huggingface/transformers peer:

npm install @huggingface/transformers@^4.3.1

Use it through the app SDK

Most applications should not import this package directly. Install it beside @bendyline/gezel-app-sdk and ask the SDK for an inference-only host. The SDK loads this runtime inside your process, so there is no second process to supervise, no separate Node executable to ship, and no loopback network connection:

import { connectOrHost } from '@bendyline/gezel-app-sdk/host';

const gezel = await connectOrHost({
  appId: 'acme.editor',
  appName: 'Acme Editor',
  scopes: ['openai'],
  host: { mode: 'in-process', inferenceOnly: true },
});

const { chatModel } = await gezel.ensureModel({ model: 'qwen3.5-0.8b-q4' });

const reply = await gezel.openai.chat({
  model: chatModel, // 'mlx:qwen3.5-0.8b-q4' on Apple Silicon, 'llama-cpp:…' elsewhere
  messages: [{ role: 'user', content: 'Suggest a title for these notes: …' }],
});
console.log(reply.choices[0].message.content);

await gezel.close();

The runtime never downloads a model on its own: weights are fetched only when your app asks for them, for example with ensureModel. See the app SDK README for consent, hosting options, shipping engines and models with your app, and knowledge catalogs.

Entry points

ImportWhat it provides
@bendyline/gezel-inferencestartService(), the in-process host the app SDK calls, and verifyNativeBinaries()
@bendyline/gezel-inference/native-releaseThe pinned native engine release and its archive digests, as data. Importing it starts nothing
@bendyline/gezel-inference/packagingBuild-time helpers that stage the pinned native engines for an Electron app
@bendyline/gezel-inference/speechThe Kokoro text-to-speech frontend and its pronunciation-dictionary lookup

The package also includes chat-model and knowledge-catalog metadata generated from the pinned @bendyline/gilde catalog. The pronunciation dictionaries' license is at dist/kokoro-lexicon/LICENSE.

Stability

The entry points above are public API under semver. @bendyline/gezel-inference/internal/* is not: it is how the Gezel service reaches the runtime, always installed at exactly the same version, and it can change in any release. Do not import it.

Documentation

MIT © Bendyline

版本与发布记录

@bendyline/gezel-inference 共发布 11 个版本,首次发布于 2026/10/14;过去 12 个月发布了 11 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.8latest2026/11/053 天前
1.0.72026/11/044 天前
1.0.62026/10/2811 天前
1.0.52026/10/2712 天前
1.0.42026/10/2712 天前
1.0.32026/10/2415 天前

关于 @bendyline/gezel-inference 的常见问题

@bendyline/gezel-inference 是什么?

Gezel's on-device inference runtime: native engines, local model management, embeddings, knowledge search, and OpenAI-compatible routes.

如何安装 @bendyline/gezel-inference?

在项目目录运行 npm install @bendyline/gezel-inference,或使用 pnpm add / yarn add / bun add。

@bendyline/gezel-inference 支持 TypeScript 吗?

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

@bendyline/gezel-inference 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@bendyline/gezel-inference 需要什么版本的 Node.js?

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

@bendyline/gezel-inference 可以商用吗?

@bendyline/gezel-inference 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bendyline/gezel-inference 的下载量有多少?

根据 npm 官方下载统计,@bendyline/gezel-inference 在 2026/10/08 – 2026/11/06 这 30 天内被下载 1,885 次,日均约 63 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bendyline/gezel-inference 还在维护吗?

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