npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-deepseek-next

v1.0.15

Published

n8n community node — DeepSeek Chat Model (OpenAI-compatible API, thinking mode, ChatDeepSeek).

Readme

n8n-nodes-deepseek-next

面向 n8n 的社区节点包:DeepSeek Chat Model (Next)。基于 DeepSeek OpenAI 兼容 Chat Completions 接口,通过 @langchain/deepseek 接入 LangChain,并与官方 AI Agent / Tools Agent 流式执行链路对齐。


支持的模型(含 DeepSeek V4)

节点会通过凭证调用 GET /models 动态加载可选模型列表;若接口不可用,则回退到下列静态 ID:

| 模型 ID | 说明 | |--------|------| | deepseek-v4-flash | V4 系列,默认推荐(节点默认选中) | | deepseek-v4-pro | V4 系列 | | deepseek-chat | 经典对话模型(官方日程中有下线计划,请以 DeepSeek 控制台 / 文档为准) | | deepseek-reasoner | 推理向模型(同上) |

自定义 Base URL 时(私有化代理等),仍以远端返回的 /models 为准;静态列表仅作兜底。


思考模式(Thinking Mode)与 reasoning_content

DeepSeek 在开启思考能力后,会在响应中携带 reasoning_content(思维链);在多轮对话、尤其是 工具调用(function calling) 后再次请求时,官方要求把上一轮助手消息里的 reasoning_content 原样带回,否则会报错(例如 400 The reasoning_content in the thinking mode must be passed back to the API)。

本节点在该场景下的处理要点:

  1. 请求侧补齐
    LangChain 在把历史 AIMessage 转成 API 的 messages 时,可能不把 additional_kwargs.reasoning_content 写回请求体。本节点在调用底层 API 前会对 assistant 消息注入对应的 reasoning_content,并与 tool_calls id 尽量对齐,满足 DeepSeek 思考模式协议。

  2. 跨 n8n Engine 周期缓存(Tools Agent 关键)
    n8n 在每轮工具执行后的 Engine Response 上会再次调用模型的 supplyData(),往往会 新建模型客户端实例。仅靠实例内缓存会在第二轮丢失 reasoning_content。本节点使用 进程级(模块级)LRU + TTL(默认 15 分钟) 缓存,按工具调用签名关联上一轮聚合到的推理文本,供下一轮注入兜底。

  3. 流式聚合
    在流式响应中按增量拼接 reasoning_content,并在出现 finish_reason / 流结束 时写入缓存(兼容「最后一帧 tool_calls 为空」等情况)。

  4. 节点默认值与官方默认的差异
    DeepSeek API 文档侧思考能力可能默认开启;本节点将 Thinking Mode 默认设为 Disabled,便于成本与延迟可控。需要推理时再在 Options → Thinking Mode 中选 Enabled

必读官方文档:

开启思考模式后,温度、Top P、频率/存在惩罚等对「思考阶段」无效,以官方说明为准;节点内亦有对应 Notice 提示。


与 n8n AI Agent(流式)的配合

  • Thinking Mode = Enabled
    模型可能主要把增量写在 reasoning_content 里,而 content 为空;官方 n8n Agent 流式管线通常只汇总 content。若需在 Agent 流里「看得到输出」,请查阅节点界面说明并结合业务选择模式。

  • Thinking Mode = Disabled(节点默认)
    本节点可将 DeepSeek 流里的 reasoning_content 增量镜像到普通 assistant 文本,便于 processEventStream 只认 content 时的可视化与聚合(仍以 DeepSeek 与 LangChain 实际行为为准)。


其他工程向能力

  • 工具 Schema 规范化
    DeepSeek 对工具 JSON Schema 较严格;若上游传入的根 parameters 缺少 type: "object",节点会在发往 API 前尽量规范化,减少调用被拒。

  • Parallel Tool Calls
    默认 关闭parallel_tool_calls: false),降低单次响应触发大量并行工具、迅速耗尽 Tools Agent Max iterations 的概率;可按需打开。

  • 代理
    凭证支持配置 HTTP(S) 代理(实现依赖 undici ProxyAgent,与节点内请求逻辑一致)。

  • JSON 响应格式
    选择 JSON Object 时,请遵循各模型提供方要求在 prompt 中出现 json 等约束(节点内有简短 Notice)。

  • Additional Model Arguments
    支持 JSON 合并到模型请求参数(在 thinking / reasoning_effort / response_format 之后浅层合并),便于跟进 DeepSeek 新字段。


Reasoning Effort(思考强度)

Thinking Mode = Enabled 下可选 Reasoning Effort(映射到 API 的 reasoning_effort)。节点当前 UI 提供 High / Max;文档若列出更多档位,可通过 Additional Model Arguments 覆盖或扩展(与 LangChain / DeepSeek 版本保持一致)。


安装

  1. 在自有部署中启用 Community nodes(权限允许时)。

  2. 在 n8n 使用的环境中安装:

    npm install n8n-nodes-deepseek-next
  3. 或在本仓库执行 npm pack,将生成的 .tgz 上传到实例的 Community nodes 安装流程(与贵司运维方式一致即可)。

安装后在工作流中添加 「DeepSeek Chat Model (Next)」,并创建凭证 DeepSeek Next API(API Key;可选 Base URL、代理)。


凭证与环境

  • API Key:DeepSeek 控制台发放的密钥。
  • Base URL:默认为 https://api.deepseek.com(按需改为代理或兼容网关地址,不要多余末尾斜杠带来的路径歧义;节点内会做规范化)。
  • Node.jspackage.jsonengines.node 要求 ≥ 22.16(与当前依赖与构建约定一致)。

明确不包含的范围(后续可考虑)

当前包仅覆盖 Chat Completions 路径相关的对话模型接入,不包含:FIM 补全、前缀续写 Beta、Anthropic 兼容 /anthropic 端点等(若 DeepSeek 文档变更,请以官方为准)。


许可证

MIT,见仓库内 LICENSE


相关链接

| 资源 | URL | |------|-----| | DeepSeek API 文档(中文) | https://api-docs.deepseek.com/zh-cn/ | | 思考模式指南 | https://api-docs.deepseek.com/zh-cn/guides/thinking_mode | | n8n 社区节点说明 | https://docs.n8n.io/integrations/community-nodes/installation/ |