Skip to content

Releases: ken050210/vertex-streaming-anti-truncation

SillyTavern Vertex 抗截断插件 v0.6.1

Choose a tag to compare

@ken050210 ken050210 released this 20 Oct 10:10

精简 Vertex 面板中“Gemini 4 Argon 超长回复自动续写”开关下方的说明,功能不变。独立网关与 Docker 镜像仍为 0.11.0。

只有前端扩展有改动;服务端插件留在 0.6.0 也能正常使用,检查插件连接时面板会建议一并更新。安装包内含一键安装程序,保留原有 Git/手动安装方式的用户请按文档原位更新,避免重复安装。

下载 vertex-anti-truncation-sillytavern-0.6.1.zip,使用 SHA256.txt 校验。验证:237 项离线测试通过;安装包解压后与打包目录一致,在模拟酒馆中全新安装(含依赖)和更新安装均成功,安装后的插件代码通过 57 项插件测试(另 1 项需读取前端文件,服务端包不含)。

SillyTavern Vertex 抗截断插件 v0.6.0

Choose a tag to compare

@ken050210 ken050210 released this 20 Oct 09:53

Gemini 4 Argon 的最大回复长度超过单次上限时,插件不再拒绝发送(包括只发一句 Hi 的“测试消息”):按实际请求改为流式 65,536、非流式 32,768 token(含思考)发送,预设不改动,面板会显示本次实际额度。

Vertex 面板新增默认关闭的“Gemini 4 Argon 超长回复自动续写”(long decode)。开启后,回复写满单次上限时改用 v1beta1 接口自动续写,拼成一条回复,最多写到预设的长度。只有真写超单次上限才会追加请求;每续写一段都重发完整上下文并计费,整次请求最长 10 分钟。与抗截断传输的配合尚未用真实超长输出验证,可能中途失败。TauriTavern 下不提供该选项,额度按 65,536 发送。说明见 Gemini 4 输出上限与自动续写。

抗截断的合成工具名固定为 router_emit,开启抗截断后也能命中 Vertex 隐式缓存(隐式缓存不保证每次命中)。准备过的 0.5.3 没有单独发布,其改动包含在本版中。

请同步更新前端扩展和服务端插件并重启酒馆;安装包内含一键安装程序,保留原有 Git/手动安装方式的用户请按文档原位更新,避免重复安装。服务端插件较旧时,超限请求仍会被拒绝,面板会提示更新服务端插件。

下载 vertex-anti-truncation-sillytavern-0.6.0.zip,使用 SHA256.txt 校验。验证:237 项离线测试通过;安装包解压后与打包目录一致,在模拟酒馆中全新安装(含依赖)和更新安装均成功,安装后的插件代码通过 57 项插件测试(另 1 项需读取前端文件,服务端包不含)。Gemini 4 Argon 的真实短请求经独立网关验证;本插件自身没有发送真实请求,跨请求的续写也没有真实测试。

Standalone Gateway v0.11.0 — Gemini 4 Argon output limits and long decode

Choose a tag to compare

@ken050210 ken050210 released this 20 Oct 09:53

Gemini 4 Argon 的输出额度超过单次上限时,不再返回 gemini4_long_decode_required:按实际发给 Google 的请求改为流式 65,536、非流式 32,768 token(含思考)发送,自定义上游一律 32,768,客户端的预设不改动。响应头和请求日志会记录请求的额度与实际发送的额度。

控制台“SillyTavern 兼容与重试”中新增默认关闭的“Gemini 4 Argon 超长回复自动续写”(long decode;仅命令行模式用 GEMINI_LONG_DECODE)。开启后,超过单次上限的请求改走 v1beta1 原生接口,写满时带续写令牌自动续写,拼成一条回复。只有回复真的写超单次上限才会追加请求;每续写一段都重发完整上下文并计费,整次请求仍受上游超时限制。与抗截断传输及 Express、Flex、Priority 的配合尚未用真实超长输出验证,可能中途失败。规则与风险见 Gemini 4 输出上限与自动续写。

抗截断的合成工具名固定为 router_emit,开启抗截断后也能命中 Vertex 隐式缓存(隐式缓存不保证每次命中)。原生参数流也接受 Google 示例中只带 jsonPath 的字符串结束片段。准备过的 0.10.2 没有单独发布,其改动包含在本版中。

Docker 镜像:ghcr.io/ken050210/vertex-streaming-anti-truncation:0.11.0(同时更新 latest),支持 linux/amd64 与 linux/arm64。附件包含 Compose 文件及可选环境变量示例。

验证:237 项离线测试通过;发布的镜像通过 Docker 冒烟测试(登录、鉴权、保存、容器重建后恢复配置、健康检查,未调用模型)。Gemini 4 Argon 真实短请求(服务账号、Standard、global)合并前后各 3 条:v1beta1 的流式和非流式请求都接受 100,000 的额度并一次完成,关闭续写时按 32,768 发送也成功。没有真实测试跨请求的续写。

SillyTavern Vertex 抗截断插件 v0.5.2

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 23:02

快速模式调用 Gemini 4 Argon 时,需要填写 API Key 所属的项目 ID 或项目编号,以明确指定 global 地区。缺少项目时插件会在本地提示补填,不再直接发送会失败的请求。

服务端共用修复后的地址构造函数,项目路径只拼接一次。请同步更新前端扩展和服务端插件并重启酒馆;安装包内含一键安装程序,保留原有 Git/手动安装方式的用户请按文档原位更新,避免重复安装。

下载 vertex-anti-truncation-sillytavern-0.5.2.zip,使用 SHA256.txt 校验。验证:225 项离线测试通过,打包代码通过 30 项插件测试,涵盖两种抗截断模式与流式/非流式回复。本次没有真实推理调用。

SillyTavern Vertex 抗截断插件 v0.5.1

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 02:21

为 SillyTavern 1.19.x 的 Google Vertex AI 连接面板提供抗截断传输。本版是 0.5.0 的修复版,用到工具调用(函数调用)的请直接升级。独立网关同时发布 0.9.1。

本版修复

  • 工具执行后的下一次生成会失败(0.5.0 的问题)。 0.5.0 能把模型的工具调用正确交给酒馆,但酒馆执行工具、带着结果再次请求时,Vertex 返回 HTTP 400(“Requests ending with a model turn are not supported”)。原因是抗截断追加的格式说明和工具结果被放进了同一轮,Gemini 3.7 不接受。现在格式说明单独成一轮,工具结果那一轮保持原样。
  • 0.5.0 的其他改动不变:酒馆注册的工具和工具历史会经过抗截断,工具调用以 Gemini 原生格式(带思考签名,Gemini 4 Argon 另带调用 ID)交回酒馆。

升级须知

前后端版本号一起改为 0.5.1,请两半一起更新。服务端仍是 0.5.0 时,带工具结果的请求仍会失败;服务端更旧时,带工具的请求走酒馆原流程,面板提示“服务端插件较旧”。

安装

一键安装包(用于 SillyTavern,不需要 Git):先关闭酒馆,解压附件 vertex-anti-truncation-sillytavern-0.5.1.zip。

  • Windows:双击 install-windows.cmd,按提示把酒馆文件夹拖进窗口后回车。
  • macOS/Linux/安卓 Termux:运行 sh install.sh 酒馆文件夹路径。
  • 命令行或由 AI 助手代装:运行 node install.mjs "酒馆文件夹路径"。

装完启动酒馆、刷新网页,在“API 连接 → Google Vertex AI → 抗截断传输”中点“检查插件连接”。之前用安装包装的,直接运行本版的安装程序即可更新。

已经用 Git 或手动复制安装的:安装程序会列出路径并停止,不覆盖也不删除。前端用酒馆扩展管理器更新;服务端在插件目录运行 git pull --ff-only 和 npm ci --ignore-scripts;然后重启酒馆。

TauriTavern:不用安装包。在 TT 的“扩展程序 → 安装扩展”里填 https://github.com/ken050210/vertex-streaming-anti-truncation,分支留空。带工具的请求在 TT 中仍走它的原流程。

外部 SHA256.txt 用于校验 ZIP 本身,ZIP 内的 SHA256.json 列出每个文件的校验值。

完整安装、更新与迁移说明

验证与范围

  • 本地 npm run verify:115 个发布文件检查和 217 项测试通过;GitHub Actions 测试通过。
  • 真实请求(每次最多 512 个输出 token,不重试):本版装进一个 SillyTavern 1.19.0 并重启后,经它的插件路由、用酒馆已保存的服务账号,Gemini 3.7 Flash 与 Gemini 4 Argon 各 4 个请求全部成功——非流式和流式下,模型调用工具、带结果再次请求后正常作答,正文由抗截断还原,正常结束,没有泄露内部工具名。0.5.0 在同样的回传请求上返回 400。
  • 安装包:在模拟酒馆目录中用本 ZIP 的安装程序完成新装和再次更新(跳过图片渲染组件的下载)。
  • 尚未验证:在酒馆网页里点开函数调用、由扩展实际执行工具的完整操作;TauriTavern 中的工具请求;长篇质量。插件不自动续写,也不自动重试失败的请求。

SillyTavern Vertex 抗截断插件 v0.5.0

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 01:56

已知问题,请改用 v0.5.1: 本版在工具执行后带结果再次请求时,Vertex 返回 HTTP 400。

为 SillyTavern 1.19.x 的 Google Vertex AI 连接面板提供抗截断传输。本版让酒馆的工具调用(函数调用)和抗截断一起工作。独立网关同时发布 0.9.0(Docker 镜像见 gateway-v0.9.0)。

本版改动

  • 工具调用与抗截断共用。 以前只要请求里带工具(酒馆开启函数调用后,扩展注册的工具每次都会带上,例如 WebSearch 扩展的搜索工具)或工具调用历史,这次请求就整个跳过抗截断。现在这些请求也经抗截断传输:模型可以在同一条回复里写正文并调用工具;工具调用以酒馆能识别的 Gemini 原生格式交回(带思考签名,Gemini 4 Argon 另带调用 ID),由酒馆照常执行,下一轮请求带上工具结果。
  • 仍走酒馆原流程的情况。 旧版 functions、要求必须调用某个工具的请求,以及参数定义无法转成 Vertex 原生格式的工具(如含 default、pattern)。酒馆每次都会带上全部已注册的工具,所以只要有一个工具无法转换,本次请求就整体走原流程,面板写明原因。
  • 流式模式的差别。 带工具时不逐段读取工具参数,正文在模型写完后一次显示,思考过程仍逐步显示。不带工具的请求不受影响。
  • TauriTavern(TT 酒馆)。 带工具的请求暂时走 TT 原流程,因为 TT 后台如何处理工具历史尚未核对。

升级须知

前后端版本号一起改为 0.5.0,请两半一起更新。服务端仍是旧版时,带工具的请求会走酒馆原流程,面板提示“服务端插件较旧”;其他请求照常。

安装

一键安装包(用于 SillyTavern,不需要 Git):先关闭酒馆,解压附件 vertex-anti-truncation-sillytavern-0.5.0.zip。

  • Windows:双击 install-windows.cmd,按提示把酒馆文件夹拖进窗口后回车。
  • macOS/Linux/安卓 Termux:运行 sh install.sh 酒馆文件夹路径。
  • 命令行或由 AI 助手代装:运行 node install.mjs "酒馆文件夹路径"。

装完启动酒馆、刷新网页,在“API 连接 → Google Vertex AI → 抗截断传输”中点“检查插件连接”。之前用 0.4.0 或 0.3.1 安装包装的,直接运行本版的安装程序即可更新。

已经用 Git 或手动复制安装的:安装程序会列出路径并停止,不覆盖也不删除。请继续用原来的方式把两半更新到同一版本:前端用酒馆扩展管理器更新;服务端在插件目录运行 git pull --ff-only 和 npm ci --ignore-scripts;然后重启酒馆。

TauriTavern:不用安装包。在 TT 的“扩展程序 → 安装扩展”里填 https://github.com/ken050210/vertex-streaming-anti-truncation,分支留空。

外部 SHA256.txt 用于校验 ZIP 本身,ZIP 内的 SHA256.json 列出每个文件的校验值。

完整安装、更新与迁移说明 · 给 AI 助手的安装指引

验证与范围

  • 本地 npm run verify:115 个发布文件检查和 215 项测试通过;GitHub Actions 测试通过。
  • 离线用酒馆 1.19.0 自己的提示词转换器检查:带签名和不带签名的工具历史(Gemini 3.7 Flash、Gemini 4 Argon)都转成了预期的原生请求,传输说明排在工具结果之后。
  • 安装包:在模拟酒馆目录中用本 ZIP 的安装程序完成新装和再次更新(这次跳过了图片渲染组件的下载)。
  • 已装进一个 SillyTavern 1.19.0 并重启:服务端插件报告 0.5.0 与 client-tools 能力,酒馆加载了新版扩展文件。
  • 尚未验证:真实 Vertex 请求中的工具调用、在酒馆页面里实际执行工具的完整往返、长篇质量。插件不自动续写,也不自动重试失败的请求。

Standalone Gateway v0.9.1 — tool results on native routes

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 02:21

Standalone gateway 0.9.1 fixes tool-result requests on native routes. It replaces 0.9.0.

镜像:ghcr.io/ken050210/vertex-streaming-anti-truncation:0.9.1(也提供 latest),支持 linux/amd64 与 linux/arm64。

已在用 Docker 版的,在 compose.yaml 所在目录执行:

docker compose pull
docker compose up -d

新部署:下载本 Release 的 compose.yaml,按中文部署说明 / English deployment guide 操作。

修复 / Fix

  • 在原生接口路线上(Express、Flex),工具执行后带结果的下一次请求会以 HTTP 400 失败:抗截断说明和工具结果被放进了同一轮,Gemini 3.7 不接受(“Requests ending with a model turn are not supported”)。现在工具结果之后的用户文字另起一轮。Standard 与完整模式 Priority 走兼容接口,不受影响。
  • On native routes (Express, Flex), the request after a tool ran failed with HTTP 400 because the anti-truncation instruction shared a turn with the function responses. User text after function responses now starts its own turn. See the changelog.

验证 / Validation

217 offline tests and 115 release-file checks passed locally and in GitHub Actions; the release workflow built, smoke-tested and published amd64 and arm64 images. Live Gemini 3.7 Flash requests (max 512 output tokens, no retries) through the gateway source: with this fix, the Flex route (native, ON_DEMAND_FLEX) completed a tool call and the tool-result round trip in non-streaming and streaming modes, with restored text and a normal stop; the Standard route (compatible endpoint, unchanged in this release) did the same on 0.9.0. Express was not live-tested (the test key's project has billing disabled). The published image itself did not receive a live request.

The SillyTavern integration is released at the same commit as sillytavern-v0.5.1. Credentials are not included in images or release assets.

Standalone Gateway v0.9.0 — client tools under anti-truncation

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 01:56

Known issue — use v0.9.1: on Express and Flex, the request after a tool ran fails with HTTP 400.

Standalone gateway 0.9.0 keeps client tools callable under anti-truncation.

镜像:ghcr.io/ken050210/vertex-streaming-anti-truncation:0.9.0(也提供 latest),支持 linux/amd64 与 linux/arm64。

已在用 Docker 版的,在 compose.yaml 所在目录执行:

docker compose pull
docker compose up -d

新部署:下载本 Release 的 compose.yaml,按中文部署说明 / English deployment guide 操作。

本版改动 / Changes

  • 带客户端工具(tool_choice 省略或为 auto)或工具调用历史的请求不再跳过抗截断:随机命名的合成工具排在客户端工具之后,tool_choice 改为 required,客户端的 parallel_tool_calls 保留。真实工具调用与还原后的正文一起交给客户端,结束原因保持 tool_calls;流式中真实调用的 index 从 0 连续编号。tool_choice: "none" 时客户端工具仍声明但强制合成工具。
  • 仍跳过包装:强制的 tool_choice(required 或指定函数)、旧版 functions/function_call/role: function、结构化输出和多候选。
  • 原生参数流只承载合成工具,所以带客户端工具或工具历史的流式请求改走缓冲回退(tool-transport-buffered-fields),正文在模型写完后一次到达。
  • Requests with client tools or tool history are now wrapped instead of skipped; real tool calls reach the client next to the restored text. See the changelog.

验证 / Validation

115 release-file checks and 215 offline tests passed locally and in GitHub Actions. The image built locally passed the isolated Compose smoke test (setup, auth, mapped ports, persistence, health and shutdown; no inference), and the release workflow published amd64 and arm64 images. No live Vertex request was made for this release.

The SillyTavern integration is released at the same commit as sillytavern-v0.5.0. Credentials are not included in images or release assets.

Standalone Gateway v0.10.1 — Express global routing

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 23:02

Express 填写项目 ID 或项目编号后,现在明确请求 projects/{项目}/locations/global,修复界面显示 global 但无项目端点将 Argon 解析到其他地区的问题。使用 Gemini 4 Argon 时若未填项目,请求会在本地提示 express_project_required;旧配置仍可读取和修改。

Docker 镜像:ghcr.io/ken050210/vertex-streaming-anti-truncation:0.10.1(同时更新 latest),支持 linux/amd64 与 linux/arm64。更新镜像后,在快速模式中填写 API Key 所属的项目 ID 或项目编号并保存。

附件包含 Compose 文件及可选环境变量示例。验证:225 项离线测试、镜像内 6 项路由测试和隔离 Compose 验收通过。未进行真实 Google 推理验证。

Standalone Gateway v0.10.0 — custom upstream and cost estimates

Choose a tag to compare

@ken050210 ken050210 released this 17 Oct 11:19

Standalone gateway 0.10.0 adds a custom OpenAI-compatible upstream and per-request cost estimates. It replaces 0.9.1.

镜像:ghcr.io/ken050210/vertex-streaming-anti-truncation:0.10.0(也提供 latest),支持 linux/amd64 与 linux/arm64。

已在用 Docker 版的,在 compose.yaml 所在目录执行:

docker compose pull
docker compose up -d

新部署:下载本 Release 的 compose.yaml,按中文部署说明 / English deployment guide 操作。源码用户停止网关后执行 git pull --ff-only 和 npm ci --ignore-scripts 再启动,已保存的配置不受影响。

新功能 / New

  • 自定义上游:“连接配置”新增第四种方式,填写提供 Gemini 模型的 OpenAI 兼容服务(中转站、new-api / one-api 一类服务等)的地址(填到 /v1)和 API Key 即可接入。模型名按页面上的样子原样发送;“拉取 Model List”读取上游的 /models,保存后会核对模型名是否在上游列表里并提示。这条路线没有 Vertex 原生参数流,流式抗截断走兼容接口,正文能否逐段到达取决于上游。说明见 README。
  • 费用估算:请求日志新增“用量 / 估算费用”一列,按网关内置的 Google 官方 Vertex 价目(2026-10-17 核对)估算每次回复的美元费用,按请求日期区分推广价,按实际档位、地区和长上下文折算。自定义上游只记 token 数,不估算。估算以 Google Cloud 账单为准,见 README。
  • Custom upstream: a fourth connection option for an OpenAI-compatible service that serves Gemini models (base URL up to /v1 plus an API key). Model names are sent exactly as saved; discovery reads the upstream's /models, and a post-save check warns about names missing from that list. There is no native argument stream on this route, so streaming anti-truncation uses the compatible fallback and arrives piece by piece only if the upstream forwards tool arguments in pieces. See the README.
  • Cost estimates: the request log shows token usage and an estimated USD cost from Google's Vertex list prices built into the gateway (checked 2026-10-17), by model, request date (promotional periods), reported tier, region and long-context rates. Custom upstreams show token counts only. Your bill is authoritative; see Usage and cost estimates and the changelog.

行为变化 / Behavior changes

  • 网关向 Vertex 兼容接口请求流式回复时会附带 stream_options.include_usage 以拿到用量;客户端自己没要用量时,这一段不会转发给客户端。
  • 命令行缺少或重复设置鉴权方式时的提示改为 Configure one upstream authentication method: … / Configure exactly one upstream authentication method: …,并列出 CUSTOM_UPSTREAM_URL。
  • Streams requested from Vertex's compatible endpoint now ask for usage; the usage chunk is withheld from clients that did not ask for it. The CLI's authentication messages now mention CUSTOM_UPSTREAM_URL.

验证 / Validation

224 offline tests and 117 release-file checks passed locally and in GitHub Actions; the release workflow built, smoke-tested and published amd64 and arm64 images. The console flow was checked against a local mock OpenAI-compatible service: saving, discovery with mixed naming styles, the model name arriving unchanged, the post-save warning, a streaming anti-truncation test and usage in the log. No real third-party relay and no live Vertex request were tested for this release, so the cost estimates have not been compared with a real bill. The published image itself did not receive a live request.

The SillyTavern integration stays at sillytavern-v0.5.1; its code is unchanged. Credentials are not included in images or release assets.