@fevex/deepseek

中文文档
0.1.0-alpha.14发布于 2026/11/11Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 2818

DeepSeek ModelGateway adapter for Fevex.

原始使用文档

@fevex/deepseek

Official DeepSeek ModelGateway adapter for Fevex. See the compatibility and release policy.

npm install @fevex/core @fevex/deepseek
import { createDeepSeek } from '@fevex/deepseek';

const model = createDeepSeek({
  apiKey: process.env.DEEPSEEK_API_KEY!,
  schemaPolicy: 'best-effort',
})('deepseek-v4-flash');

The adapter uses native fetch and implements only the Fevex model contract. Runtime behavior such as tool execution, validation, events and retries belongs to @fevex/core. Returned gateways include metadata: { provider: "deepseek", model: modelId } for traces, eval cost calculators and OpenTelemetry export.

Text, tools and continuation

Without outputSchema, DeepSeek content is returned as the exact provider string, even when it looks like JSON. With outputSchema, the adapter requires valid JSON before Fevex performs local schema validation. Truncated, filtered or malformed responses fail explicitly.

Thinking-mode tool calls require reasoning_content to be sent back on the next request. The adapter keeps it in opaque providerState, and Fevex carries that state automatically between model steps. Direct ModelGateway consumers must pass it unchanged; it is run-local and must not be inspected. The adapter's stateCodec lets Fevex persist it only inside a private durable checkpoint.

reasoning: "none" disables thinking. low, high and max map directly to DeepSeek's native reasoning_effort; neutral xhigh maps to high for deepseek-v4-flash and max for deepseek-v4-pro. minimal and medium are rejected before HTTP with PROVIDER_REASONING_UNSUPPORTED. Provider-only low, high and max remain available through modelOptions when core reasoning is provider-default.

The adapter always uses native Chat Completions SSE with usage enabled. Visible content is streamed immediately, while reasoning and partial tool calls are accumulated privately until the required [DONE] marker.

Tool names must match [A-Za-z0-9_-]{1,64}. Fevex-owned fields such as model, messages, tools, tool choice, schema format, parallel calls and output caps override conflicting modelOptions. Provider tools outside Fevex's function contract are not enabled by this gateway.

Schema policy

schemaPolicy defaults to "strict". DeepSeek strict tool schemas require a baseURL ending in /beta; the adapter validates their documented subset and sets strict: true on every function according to the Tool Calls guide. Unsupported keywords throw DeepSeekError with code: "PROVIDER_SCHEMA_UNSUPPORTED" before fetch runs.

DeepSeek JSON Output guarantees valid JSON but does not enforce a supplied JSON Schema, so final outputSchema is rejected in strict mode. Use schemaPolicy: "best-effort" to include the schema as a model instruction and let Fevex validate the response locally. This mode does not guarantee adherence and the caller may need to retry invalid output.

const strictTools = createDeepSeek({
  apiKey: process.env.DEEPSEEK_API_KEY!,
  baseURL: 'https://api.deepseek.com/beta',
})('deepseek-v4-flash');
PolicyTool inputFinal output
strictDeepSeek strict subset on /betaUnsupported
best-effortNon-strict function schemaJSON instruction plus local validation

版本与发布记录

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

版本发布日期距今
0.1.0-alpha.14latest2026/11/113 天前
0.1.0-alpha.132026/11/113 天前
0.1.0-alpha.122026/11/095 天前
0.1.0-alpha.112026/11/086 天前
0.1.0-alpha.102026/11/077 天前
0.1.0-alpha.92026/11/077 天前

其他发布通道:alpha → 0.1.0-alpha.1。

关于 @fevex/deepseek 的常见问题

@fevex/deepseek 是什么?

DeepSeek ModelGateway adapter for Fevex.

如何安装 @fevex/deepseek?

在项目目录运行 npm install @fevex/deepseek,或使用 pnpm add / yarn add / bun add。

@fevex/deepseek 支持 TypeScript 吗?

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

@fevex/deepseek 支持 ESM 还是 CommonJS?

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

@fevex/deepseek 需要什么版本的 Node.js?

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

@fevex/deepseek 可以商用吗?

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

@fevex/deepseek 的下载量有多少?

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

@fevex/deepseek 还在维护吗?

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