@bendyline/gezel-service

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

The Gezel service (gezeld): a local daemon that runs your gezels, their chats, tasks, and models, with an HTTP API and the web UI.

原始使用文档
文档目录8 节
  1. What it contains
  2. Entry points
  3. Optional peers
  4. Native engines
  5. Shared speech models
  6. Environment
  7. Stability
  8. Documentation

@bendyline/gezel-service

gezeld, the Gezel service. A local HTTP service that owns chat sessions, routes to LLM providers, manages memories, tasks and projects, and reads and writes everything under ~/.gezel/.

This is what @bendyline/gezel-cli runs behind the scenes. Install it directly only if you are embedding Gezel or running the service standalone.

npm install @bendyline/gezel-service
npx -p @bendyline/gezel-service gezeld

gezeld runs in the foreground and is configured through environment variables (see Environment); npx -p @bendyline/gezel-service gezeld --help lists them. Always name the @bendyline/ package with npx: a bare npx gezeld outside the folder where you installed it asks npm for an unrelated package.

What it contains

  • Hono HTTP API on loopback, bearer-token authenticated
  • Store — the single read/write path for all on-disk state
  • ChatManager — session lifecycle, persistence, provider-state resume
  • Providers: Copilot, OpenAI, Anthropic, llama.cpp, MLX, ds4, and a deterministic mock for tests
  • A per-session MCP bridge over stdio and streamable HTTP
  • Memory (sqlite-vec), history, tasks, usage tracking, engine downloads
  • The bundled web UI at dist/ui/, so gezel start --web serves a full browser interface from a Node-only install with nothing else to fetch

Entry points

SubpathContents
@bendyline/gezel-servicestartService() and the service types
@bendyline/gezel-service/handboekHandboek rendering helpers
@bendyline/gezel-service/gezappAI App (.gezapp) validation, packing, and reading, without starting the service
@bendyline/gezel-service/native-releaseThe pinned native engine release and its archive digests, as data
@bendyline/gezel-service/mediaImage, audio, and video embedding for building knowledge catalogs
@bendyline/gezel-service/packagingBuild-time helpers that stage the pinned native engines for an Electron app
@bendyline/gezel-service/dist/bin/gezeld.jsThe service executable, also installed as the gezeld command. Tools that start Gezel for you, such as the CLI and the app SDK, launch this file
import { startService } from '@bendyline/gezel-service';

const { port, clientToken, stop } = await startService({ home: '/tmp/gezel-home' });
console.log({ port, clientToken });
await stop();

Optional peers

The base npm install leaves out a few large or native pieces. Cloud providers, native engines, the HTTP API, MCP, UI, tasks, and file features work without them. Install each only when this deployment needs it:

PackageNeeded for
@huggingface/transformers@^4.3.1In-process memory embeddings
kokoro-js@^1.2.1Kokoro text-to-speech
node-pty@^1.1.0The interactive terminal; without it, opening a terminal reports that node-pty is missing and everything else keeps working
npm install @huggingface/transformers@^4.3.1 kokoro-js@^1.2.1

npm consumers should also add two overrides to the application's root package.json (npm ignores overrides declared by dependencies). kokoro-js 1.2.1 still declares Transformers.js ^3.5.1; without the override npm installs a second, 3.x copy beside the service's 4.x one, and the service hands Kokoro tensors built from its own copy. adm-zip 0.6.1 is the first release that clears its advisory:

{
  "overrides": {
    "adm-zip": "0.6.1",
    "kokoro-js": { "@huggingface/transformers": "^4.3.1" }
  }
}

The desktop installers and the relocatable Node distribution already include this ML runtime with the reviewed overrides. Both paths use one Transformers 4.x / ONNX Runtime line rather than installing independent 3.x and 4.x stacks.

Native engines

On-device inference needs native engine binaries. They are not bundled — the service downloads them on first use from the native-v* releases in the Gezel repository, verifying the release's SHA256SUMS against a digest built into this package before trusting any individual archive hash. Set GEZEL_LLAMA_SERVER_BIN (and siblings) to point at your own builds instead, or GEZEL_NATIVE_BIN_DIR at a directory containing all of them.

Cloud providers need none of this.

Shared speech models

Speech-to-text (Whisper) and text-to-speech (Kokoro) weights come from a pinned catalog in @bendyline/gezel/speech-models, a Node-only module of the @bendyline/gezel package that other desktop apps can use too. Every file is pinned by revision, size, and SHA-256 and verified before use.

  • Verified files are kept once per user, in <GEZEL_HOME>/engines/speech-assets/<sha256>. Each app keeps its own installation that hard links to those files (or copies them, without another download, when they are on a different volume), so two apps never download the same model twice, and removing one app's installation never breaks another's.
  • Downloads and cleanup coordinate across processes; a cached file is deleted only when no installation still uses it.
  • Lookup also finds models already present in Gezel's older model folders, in read-only model homes (GEZEL_READONLY_MODEL_HOMES), and in the desktop app's machine-wide assets folder. It never reads the machine service's private state.
  • Nothing downloads on its own: a health check never fetches a model, and an older Kokoro export updates only when you pull the model again.
  • An app that must keep its files to itself can give SpeechAssetStore a root of null, which turns sharing off.

Environment

VariableEffect
GEZEL_HOMEState directory (default ~/.gezel)
GEZEL_PORTListen on this port. Default: 6228 when it is free, otherwise a free port
GEZEL_LOG_LEVELdebug | info | warn | error | silent
GEZEL_MOCK_PROVIDER=1Deterministic provider, no credentials needed
GEZEL_SKIP_SYSTEM_BOOTSTRAP=1Skip first-boot background downloads
GEZEL_DISABLE_FIRST_USE_GRACE=1Treat a fresh home as an established install: background indexing starts at once instead of waiting out the first half hour and a ready chat model, and quiet nights are reported from day one. Useful for tests and automated runs
GEZEL_EMBEDDED_INFERENCE_ONLY=1Start gezeld as the inference-only host an app runs for its own model calls: @bendyline/gezel-inference's surface (chat, Responses, embeddings, knowledge, model management) behind the service's loopback listener, with no product API, secret store, device identity, remote pairing or LAN serving. The app SDK sets it for an inferenceOnly child-hosted service
GEZEL_DAEMON_LOG_FILE=1Also write the service's output to <home>/logs/service-YYYY-MM-DD.log (10 MB rolls, 7 days kept). The CLI and app SDK set it when they start gezeld in the background
GEZEL_NATIVE_ENGINE_VERSIONOverride the pinned native release

Stability

Public API under semver. The HTTP API is versioned separately under /api; prefer @bendyline/gezel-client over calling it directly.

Documentation

MIT © Bendyline

版本与发布记录

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

版本发布日期距今
1.2.13latest2026/11/053 天前
1.2.122026/11/044 天前
1.2.112026/10/2811 天前
1.2.102026/10/2712 天前
1.2.92026/10/2712 天前
1.2.82026/10/2415 天前

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

@bendyline/gezel-service 是什么?

The Gezel service (gezeld): a local daemon that runs your gezels, their chats, tasks, and models, with an HTTP API and the web UI.

如何安装 @bendyline/gezel-service?

在项目目录运行 npm install @bendyline/gezel-service,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 gezeld,可以用 npx gezeld 直接运行。

@bendyline/gezel-service 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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