@alisio/plugin-openai-compatible

中文文档
0.10.0发布于 2026/11/08MITTypeScriptES Module近 30 天下载 5263

Built-in OpenAI-compatible model provider for Alisio.

原始使用文档
文档目录7 节
  1. What it is
  2. Installation
  3. Using it: /connect
  4. Features
  5. Docs
  6. Requirements
  7. License

@alisio/plugin-openai-compatible

The built-in OpenAI-compatible model provider for Alisio. Point it at any Chat Completions or Responses endpoint — OpenAI, a gateway, or a local server such as llama.cpp — and use it from /connect.

What it is

A model-provider plugin that registers the openai-compatible provider with the Alisio host. It ships as a built-in of the alisio CLI and is enabled by default. Configuration and credentials are supplied by the Alisio provider registry; the plugin does not persist secrets itself.

Installation

Preinstalled in the alisio CLI. For an embedded host, register it through createApplication's builtins list.

Using it: /connect

  1. Run alisio, then /connect and choose OpenAI compatible.
  2. Fields: Base URL (default https://api.openai.com/v1), API key (secret, optional), API key environment variable (default OPENAI_API_KEY), API mode (chat or responses), Authentication (bearer or none), Token parameter (max_tokens, max_completion_tokens or omit), Stream usage (boolean).
  3. Pick a model from the discovered catalog — or enter one manually when the endpoint exposes no GET /models catalog (/connect then asks for an optional context window in tokens).

The key is read from the stored credential first, then from process.env[apiKeyEnv]:

export OPENAI_API_KEY=...   # never put the key in config files, profiles or READMEs

Features

  • Model discovery via GET /models; per-model context windows (overridable per profile).
  • Chat Completions and Responses modes; bearer or no authentication; configurable token parameter.
  • Tool calls, usage metadata, reasoning deltas and image attachments.
  • Provider-native web search available when the API mode is responses.
  • Legacy provider configuration (baseURL, apiKeyEnv, model, apiMode, auth, tokenParameter, streamUsage) keeps working for startup and headless runs.

While registered, the provider also appears in /model and alisio doctor.

Docs

Configuration · Plugins.

Requirements

Node.js >= 22.16 or Bun >= 1.4.2.

License

MIT. Maintained by Gustavo Gutiérrez Mercado. Source: https://github.com/GustavoGutierrez/alisio · npm: https://www.npmjs.com/settings/alisio/packages.

版本与发布记录

@alisio/plugin-openai-compatible 共发布 28 个版本,首次发布于 2026/09/27;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.10.0latest2026/11/08今天
0.9.02026/11/08今天
0.8.02026/10/1523 天前
0.7.02026/10/1424 天前
0.6.02026/10/1325 天前
0.5.22026/10/0929 天前

关于 @alisio/plugin-openai-compatible 的常见问题

@alisio/plugin-openai-compatible 是什么?

Built-in OpenAI-compatible model provider for Alisio.

如何安装 @alisio/plugin-openai-compatible?

在项目目录运行 npm install @alisio/plugin-openai-compatible,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@alisio/sdk(^0.10.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@alisio/plugin-openai-compatible 支持 TypeScript 吗?

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

@alisio/plugin-openai-compatible 支持 ESM 还是 CommonJS?

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

@alisio/plugin-openai-compatible 需要什么版本的 Node.js?

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

@alisio/plugin-openai-compatible 可以商用吗?

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

@alisio/plugin-openai-compatible 的下载量有多少?

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

@alisio/plugin-openai-compatible 还在维护吗?

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