dsh-vision-router 3.0.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -173
- package/README.zh.md +176 -171
- package/docs/architecture/model-catalog-ownership.md +41 -0
- package/docs/development/dsh-rc1-adaptation.md +29 -0
- package/docs/development/dsh-rc2-adaptation.md +24 -0
- package/docs/development/dsh-rc3-adaptation.md +29 -0
- package/docs/development/v305-real-scenario-acceptance.md +34 -0
- package/docs/doctor.md +12 -0
- package/docs/free-models.zh-CN.md +5 -162
- package/docs/http-provider-compatibility.md +5 -3
- package/docs/releases/v3.0.5.md +31 -0
- package/docs/releases/v3.1.0.md +34 -0
- package/index.js +21 -0
- package/lib/catalog-corrections.js +67 -8
- package/lib/client-presentation-boundary-main.js +15 -4
- package/lib/client.js +7 -4
- package/lib/core-primitives.js +2 -2
- package/lib/doctor-cli.js +66 -4
- package/lib/http-compat.js +70 -6
- package/lib/live-model-discovery.js +10 -7
- package/lib/session-message-source-compat.js +13 -4
- package/lib/settings-ia-client-prelude.js +89 -1
- package/lib/sharp-runtime.js +0 -2
- package/lib/trusted-vision-hints.js +5 -4
- package/lib/vision-evidence-guidance.js +7 -1
- package/package.json +5 -5
- package/presets/README.md +5 -32
- package/presets/dashscope.yaml +0 -18
- package/presets/openrouter.yaml +0 -17
- package/presets/ovh.yaml +0 -14
- package/presets/siliconflow.yaml +0 -18
- package/presets/zhipu.yaml +0 -18
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# v3.0.5 release-candidate acceptance record
|
|
2
|
+
|
|
3
|
+
Release candidate must be tested on the final PR head, then on the exact main SHA before publishing. Evidence below refers to the merged change PRs; it is not a claim that the future v3.0.5 package has already been installed by a user.
|
|
4
|
+
|
|
5
|
+
| Scenario | Evidence | Scope and verdict |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `vision_describe` succeeds and assistant visibly answers (#727) | #731 23/23, #733 22/22, trusted combined #732 23/23 | Actual Desktop automated PNG upload → vision tool execution → final visible assistant reply; canonical tool-result and Session V3/V4 notice attribution preserved. **NOT** a separately installed/published 3.0.5 artifact |
|
|
8
|
+
| Contributor attribution of #728 | Main merge `0fc51c3` / #733; original commit `14c67c7` | Git ancestor/merge-base verified; original GitHub #728 recognized as merged, no squashed/copied authorship |
|
|
9
|
+
| Latest DSH Alpha JSONL CI loader | #730 (Node 22/24 real published-alpha lifecycle) | Canary runner/export compatibility only; no production transport, minimum Host or settings change |
|
|
10
|
+
| Optional peers missing at activation | #722, CI run 39019198833 | Passed isolated actual Node ESM entry-load probe and negative control; not a manual end-user Desktop install |
|
|
11
|
+
| DSH 0.2.1-rc.1 real Host/Web+Chromium | #721, run 39017893115; #723, run 39020741495 | Pinned source, Vision cold toggle, image+text, Settings save/reload/readback, bundle recomposes |
|
|
12
|
+
| DSH 0.2.0-rc.2 compatibility | #723, run 39020741454 | Pinned original Host and Desktop/Chromium cross-platform gates |
|
|
13
|
+
| DSH alpha.5 and legacy 0.1.7 | #723, alpha Settings Host and 0.1.7 real Host smoke | Tested against published pinned source; older support window remains unchanged |
|
|
14
|
+
| Node 22 and 24, packed API | #723, CI run 39020741423 | Passed both Node versions, packed public API and Ubuntu/macOS/Windows Host-Sharp |
|
|
15
|
+
| Official OVH 10 MB JSON request boundary | #723, tests/http-compat.test.js | Passed mocked negative and positive wires; **not** an online request to OVH |
|
|
16
|
+
| billion-context coexistence | Issue #704 | **NOT VERIFIED** in a pinned dual-real-plugin runtime; reporter must identify which package/version |
|
|
17
|
+
| Windows native-disabled click suppression | #735 / Issue #684 closed | **MITIGATED:** bounded cached-pair actionability during catalog loading, with Host authority intact; not a blanket guarantee against all intermittent failures |
|
|
18
|
+
| Windows delivered-click Host RPC failure | Issue #738 / diagnostics #737 | **UNRESOLVED:** a real 0.1.7 Windows Node24 run recorded `gateway/internal` after both clicks arrived. #737 adds only safe error-origin telemetry, with independent exact real-Host CI 6/6 alpha, 5/5 legacy, 7/7 rc.2 |
|
|
19
|
+
| Multi-provider HTTP 400 | Issue #716 | **NOT REPRODUCED**, needs redacted response body; do not claim success |
|
|
20
|
+
|
|
21
|
+
## Acceptance matrix for a final install / upgrade
|
|
22
|
+
|
|
23
|
+
For the final v3.0.5 candidate, record exact OS, Node, DSH, DVR package and git SHA for every row. Protect API keys, image contents and personal profile paths in shared logs.
|
|
24
|
+
|
|
25
|
+
1. **Clean install (isolated profile):** install the actual packed v3.0.5 tarball through the supported DSH plugin mechanism. Ensure the two optional DSH peer modules can be absent; restart the Desktop, confirm Host Connection and Vision settings mount and that no ERR_MODULE_NOT_FOUND occurs.
|
|
26
|
+
2. **Upgrade from v3.0.4:** preserve profile Settings and Session data, change only the plugin package, restart and verify the displayed version and unchanged stored values. Do not delete a live package.json.lock.
|
|
27
|
+
3. **Cold Web + Desktop:** check Vision OFF by default, toggle OFF to ON to OFF once, paste a small PNG alongside text, run a vision tool, open Settings, save/reload/read back and test a second window. Capture button pointer traces if OFF fails; do not simulate retries.
|
|
28
|
+
4. **Payload boundary:** for the exact official OVH HTTPS model, a small PNG should reach the selected mocked or test endpoint unchanged. Oversized aggregate JSON should stop locally with INVALID_REQUEST, no outbound call, and no image content in diagnostics. A non-OVH provider must not inherit OVH's size limit.
|
|
29
|
+
5. **Privacy and ecosystem:** local-only mode must not call an external vision provider; verify remote text model caveat. Co-install with either billion-context package only when its exact package/version and user-reported failure are known; check both plugin load orders and first failure.
|
|
30
|
+
6. **Release supply chain:** pnpm frozen install, reproducible build, source-artifact map, Node 22/24 tests, packed public API, Host support contract and npm version uniqueness must all pass on exact final main commit. Release workflow verifies one tarball, provenance, registry hash and immutable GitHub assets.
|
|
31
|
+
|
|
32
|
+
## Release decision
|
|
33
|
+
|
|
34
|
+
Do not label any unexecuted row green. GitHub Actions real Host + Chromium gates are automated integration tests, **not** a manually observed installation on the user's computer. Release notes must explicitly state that #738 and #716 remain open, and must not turn #684's bounded mitigation or #704's closed disposition into a claim of fully reproduced root-cause repair. The manual trusted release workflow remains an independent action after this candidate PR is accepted.
|
package/docs/doctor.md
CHANGED
|
@@ -112,6 +112,18 @@ npx dsh-vision-router doctor --profile web --sessions --json
|
|
|
112
112
|
|
|
113
113
|
The JSON report is schema-versioned and includes the running Doctor/Vision Router version. It is intentionally minimized for issue reports: it does not contain the raw profile manifest, raw log lines, API keys, raw dependency specs, local dependency paths, URL credentials/query strings/fragments, session ids, or raw runtime error text. It keeps only structured diagnostic facts such as install mode, installed version, route status, failure counts, optional capability versions and known session-repair kinds.
|
|
114
114
|
|
|
115
|
+
### Paste-ready GitHub Issue template
|
|
116
|
+
|
|
117
|
+
For a short, **read-only** troubleshooting report you can paste into a GitHub Issue without exporting raw logs or your DSH profile, run:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
npx dsh-vision-router doctor --profile web --issue-template
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Add `--no-runtime` for offline checks and `--sessions` only if historical session corruption is relevant. The template contains a whitelist of structural facts (Doctor version, OS, Node, installation-mode counts, coarse runtime status and failure counts) and blank fields for the exact provider/model, HTTP status and reproduction steps. It **does not send anything** or include local paths, profile names, raw runtime URLs, settings values, credentials, raw logs or images. Always review your filled-in answers before sharing.
|
|
124
|
+
|
|
125
|
+
`--issue-template` is intentionally incompatible with `--fix` and `--json`; use normal `repair` separately if needed.
|
|
126
|
+
|
|
115
127
|
## Repair the UTF-8 BOM startup failure
|
|
116
128
|
|
|
117
129
|
If DSH fails before plugins can load with an error such as:
|
|
@@ -1,166 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
# dsh-vision-router 免费/内置视觉模型方案调研报告
|
|
1
|
+
# 免费视觉API调研(2026年8月)——历史资料
|
|
3
2
|
|
|
4
|
-
>
|
|
3
|
+
> 本文件仅为历史来源索引,**不再是当前厂商、模型、额度或价格推荐表**。原报告随[2026-08-13提交16e29d07](https://github.com/ysr666/dsh-vision-router/commit/16e29d07b943d2b2e1dfb615683ab07f24cc96af)产生,帮助当时需要手工配置多模态模型的用户;其模型ID、免费额度与地区可用性可能已过期。
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[查看原始报告的不可变历史版本](https://github.com/ysr666/dsh-vision-router/blob/16e29d07b943d2b2e1dfb615683ab07f24cc96af/docs/free-models.zh-CN.md)
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
2. **大陆直连最省事**:**阿里云百炼 DashScope**(新用户每个模型系列 100 万 token / 90 天,含 Qwen-VL 系列,OpenAI 兼容端点)> **智谱 Z.ai / bigmodel.cn**(`glm-4.6v-flash` 永久免费视觉)> **SiliconFlow**(¥14 赠金覆盖便宜 VL)。
|
|
10
|
-
3. **完全免 key 的视觉理解 API 目前不存在**:pollinations.ai 现在只有文本模型 `openai-fast`(`vision: false`),无 vision 模型。
|
|
11
|
-
4. **插件不可内置第三方密钥**(安全 + ToS),正确做法是仓库随附 **provider 预设 yaml**(baseURL + 免费 model id + `apiKeyEnv`),用户只填一个 key。
|
|
7
|
+
当前在DSH「设置 → 模型」配置供应商、模型和凭据,再在Vision Router中选择DSH模型目录里的视觉后端,使用「测试识图」核验实际图片投递。真实视觉模型若被Host错误标为纯文本,请优先在DSH模型选项中声明图片输入;旧Host可按[PR #89](https://github.com/ysr666/dsh-vision-router/pull/89)对已验证视觉模型使用`input: [text, image]`。匿名OVH默认兜底仍是插件运行时工具后端,并未删除。
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## 1. OpenRouter 免费视觉模型
|
|
16
|
-
|
|
17
|
-
**是否需要 key**:需要(用户已有 OpenRouter key 即可直接用)。
|
|
18
|
-
**免费额度/限速**:所有免费模型共享一个总配额 —— **20 请求/分钟**;免费账户 **50 请求/天**;账户历史累计充值 ≥ $10 后提升到 **最高 1,000 请求/天**(20 req/min 不变)。上游供应商可能施加更紧的限制。(来源:mintlify free-llm-api-resources / teamday.ai / OpenRouter 官方模型 API)
|
|
19
|
-
|
|
20
|
-
**当前支持 image 输入的免费模型**(来源:OpenRouter 实时 API + teamday.ai 2026-08-03 快照):
|
|
21
|
-
|
|
22
|
-
| 精确 model id | 模态(输入) | 上下文 | 最大输出 | 用途/备注 |
|
|
23
|
-
|---|---|---|---|---|
|
|
24
|
-
| `google/gemma-4-26b-a4b-it:free` | image + text + video | 262,144 | 32,768 | **通用视觉理解,首选免费 VLM** |
|
|
25
|
-
| `google/gemma-4-31b-it:free` | image + text + video | 262,144 | 32,768 | 通用视觉理解,质量更高 |
|
|
26
|
-
| `nvidia/nemotron-nano-12b-v2-vl:free` | image + text + video | 128,000 | 128,000 | 视觉语言模型,输出上限大 |
|
|
27
|
-
| `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free` | text + audio + image + video | 256,000 | 65,536 | 全模态,含推理 |
|
|
28
|
-
| `nvidia/nemotron-3.5-content-safety:free` | text + image | 128,000 | 8,192 | ⚠️ 内容安全分类器,非通用 VLM,勿用 |
|
|
29
|
-
| `google/lyria-3-pro-preview` / `google/lyria-3-clip-preview` | text + image | 1,048,576 | 65,536 | ⚠️ 音乐/音视频类,非通用图片理解(不确定) |
|
|
30
|
-
| `openrouter/free` | text + image | 200,000 | — | 免费模型路由(可过滤 image 能力),随机选模型 |
|
|
31
|
-
|
|
32
|
-
**关于用户点名的几个系列**(结论均为“免费变体已下架”或“不存在”):
|
|
33
|
-
- **qwen-vl 系列**:`qwen/qwen-vl-plus:free` 不存在了;付费的 `qwen/qwen2.5-vl-72b-instruct`、`qwen/qwen3-vl-8b/32b/235b-*` 仍在(付费)。
|
|
34
|
-
- **llama-4 系列**:`meta-llama/llama-4-scout:free` 不存在;`meta-llama/llama-4-scout`、`llama-4-maverick`(image 输入)为付费。
|
|
35
|
-
- **gemma-3 系列**:`google/gemma-3-27b-it:free` 不存在;付费 `gemma-3-4b/12b/27b-it` 仍在。免费档已升级为 **gemma-4**。
|
|
36
|
-
|
|
37
|
-
> ⚠️ 注意:OpenRouter 免费档近期频繁轮换(teamday 记录:一周内 15→14,前一周 20 个,数周内下架了 8 个)。不要把生产/长任务硬编码到某个 `:free` 端点。
|
|
38
|
-
|
|
39
|
-
**信息来源**:[OpenRouter models API](https://openrouter.ai/api/v1/models)、[teamday.ai: Best Free OpenRouter Models 2026](https://www.teamday.ai/blog/best-free-ai-models-openrouter-2026)、[mintlify: OpenRouter Free](https://mintlify.wiki/cheahjs/free-llm-api-resources/providers/free/openrouter)、[OpenRouter qwen-vl-plus:free 定价页](https://openrouter.ai/qwen/qwen-vl-plus:free/providers)
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## 2. 其他免费视觉 API(带 key 但免费额度)
|
|
44
|
-
|
|
45
|
-
### 2.1 SiliconFlow 硅基流动(api.siliconflow.cn)—— 大陆直连 ✅
|
|
46
|
-
|
|
47
|
-
| 项 | 内容 |
|
|
48
|
-
|---|---|
|
|
49
|
-
| OpenAI 兼容 baseURL | `https://api.siliconflow.cn/v1` |
|
|
50
|
-
| 免费额度 | 新用户 **¥14 赠金**(约 2000 万 token 量级,具体以控制台为准);另有少量 `$0` 模型(当前为文本 Qwen3-8B、DeepSeek-R1-Distill-Qwen-7B、**DeepSeek-OCR** 等) |
|
|
51
|
-
| 免费视觉模型 | **不确定**:当前免费列表里未见“通用 VL”永久免费项;`DeepSeek-OCR` 是图像输入(文档 OCR,非通用理解)。历史上 `Qwen/Qwen2.5-VL-7B-Instruct` 曾免费,现需在控制台核对 |
|
|
52
|
-
| 推荐视觉 model id(便宜,赠金可覆盖) | `Qwen/Qwen2.5-VL-7B-Instruct`、`Qwen/Qwen2.5-VL-32B-Instruct`、`Qwen/Qwen3-VL-8B-Instruct`、`Qwen/Qwen3-VL-32B-Instruct` |
|
|
53
|
-
| 直连性 | 中国大陆**直连**,无需代理 |
|
|
54
|
-
|
|
55
|
-
**信息来源**:[pricepertoken: SiliconFlow Free Tier](https://pricepertoken.com/endpoints/siliconflow/free)、[yangmao.ai: SiliconFlow Free API](https://yangmao.ai/en/providers/siliconflow/free-api/)、[SiliconFlow 限速文档](https://docs.siliconflow.cn/cn/userguide/rate-limits/rate-limit-and-upgradation)
|
|
56
|
-
|
|
57
|
-
### 2.2 Z.ai / 智谱 GLM —— 大陆直连(bigmodel.cn)✅
|
|
58
|
-
|
|
59
|
-
| 项 | 内容 |
|
|
60
|
-
|---|---|
|
|
61
|
-
| OpenAI 兼容 baseURL | 国际版 `https://api.z.ai/v1`(可能需代理);大陆版 `https://open.bigmodel.cn/api/paas/v4`(直连) |
|
|
62
|
-
| 免费视觉模型(永久免费) | **`glm-4.6v-flash`(GLM-4.6V-Flash,Free)** |
|
|
63
|
-
| 限时免费视觉模型 | `glm-4.5v`(GLM-4.5V)、`glm-4.6v`(GLM-4.6V)、`glm-5v-turbo`(GLM-5V-Turbo)标记为 “Limited-time Free / 限时免费”(非永久,可能过期) |
|
|
64
|
-
| 其它视觉 model id | `glm-ocr`(OCR,极便宜 $0.03/M) |
|
|
65
|
-
| 关于 GLM-4V | 用户提到的老 **GLM-4V 已停用/被替代**,现行为 GLM-4.5V / 4.6V / 5V-Turbo |
|
|
66
|
-
| 是否需要 key | 需要(Z.ai 或 bigmodel.cn 的 API key) |
|
|
67
|
-
|
|
68
|
-
**信息来源**:[Z.AI 官方定价页](https://docs.z.ai/guides/overview/pricing)、[models.dev: Z.ai](https://models.dev/providers/zai/)、[Z.AI 概览文档](https://docs.z.ai/guides/overview/overview)
|
|
69
|
-
|
|
70
|
-
### 2.3 阿里云百炼 DashScope —— 大陆直连 ✅(综合最优)
|
|
71
|
-
|
|
72
|
-
| 项 | 内容 |
|
|
73
|
-
|---|---|
|
|
74
|
-
| OpenAI 兼容 baseURL | `https://dashscope.aliyuncs.com/compatible-mode/v1`(国际版 `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`) |
|
|
75
|
-
| 免费额度 | 新用户开通后 **90 天**内,**每个模型系列 100 万 token**;覆盖「通义千问基础 / 垂直(OCR·Audio·Coder) / **多模态 Omni+VL 系列** / 第三方(DeepSeek·Kimi·GLM)」 |
|
|
76
|
-
| 视觉 model id | `qwen-vl-plus`、`qwen-vl-max`、`qwen2.5-vl-7b-instruct`、`qwen2.5-vl-72b-instruct`、`qwen3-vl-plus`、`qwen-vl-ocr`(OCR)、`qwen-omni-turbo`(全模态) |
|
|
77
|
-
| 是否需要 key | 需要(阿里云百炼 API key,控制台开通即得) |
|
|
78
|
-
| 直连性 | 中国大陆**直连** |
|
|
79
|
-
|
|
80
|
-
**信息来源**:[阿里云百炼新人免费额度(官方)](https://help.aliyun.com/zh/model-studio/new-free-quota)、[掘金:百炼新用户免费额度机制](https://juejin.cn/post/7594315259463516195)、[阿里云 Qwen-VL OpenAI 兼容(官方)](https://help.aliyun.com/zh/model-studio/qwen-vl-compatible-with-openai)
|
|
81
|
-
|
|
82
|
-
### 2.4 Groq —— 需代理,视觉可用性不确定
|
|
83
|
-
|
|
84
|
-
| 项 | 内容 |
|
|
85
|
-
|---|---|
|
|
86
|
-
| OpenAI 兼容 baseURL | `https://api.groq.com/openai/v1` |
|
|
87
|
-
| 免费额度 | **永久免费档**,限速约 **30 RPM / 6,000 TPM**(部分模型 15,000 TPM),无总量上限,免卡 |
|
|
88
|
-
| 免费模型 | Llama 3.3 70B、Llama 4 Scout 17B、Llama 4 Maverick 17B、Mixtral 8x7B、Gemma 2 9B、DeepSeek-R1-Distill-Llama-70B 等 |
|
|
89
|
-
| 视觉支持 | Groq 有 vision 支持(历史上 `llama-3.2-11b-vision-preview`、`llama-3.2-90b-vision-preview`;Llama 4 Scout/Maverick 原生多模态)。但**免费档哪个视觉模型当前可用 = 不确定**,需用 Groq 模型列表核对 |
|
|
90
|
-
| 直连性 | 中国大陆**通常需代理**,直连不稳定 |
|
|
91
|
-
|
|
92
|
-
**信息来源**:[yangmao.ai: Groq Free Tier](https://yangmao.ai/en/providers/groq/free-tier/)、[Groq 限速文档](https://console.groq.com/docs/rate-limits)、[langchain PR #34620(Groq vision 支持)](https://github.com/langchain-ai/langchain/pull/34620)
|
|
93
|
-
|
|
94
|
-
### 2.5 Cloudflare Workers AI —— 免费额度大,但接入较绕、大陆不友好
|
|
95
|
-
|
|
96
|
-
| 项 | 内容 |
|
|
97
|
-
|---|---|
|
|
98
|
-
| 免费额度 | 每个账户 **每天 10,000 免费 Neurons**(Workers Free 计划),每日 00:00 UTC 重置,免卡;超额按 $0.011/1K Neurons 计费 |
|
|
99
|
-
| 视觉模型 | `@cf/meta/llama-3.2-11b-vision-instruct`(首次使用需先向 Meta 同意 License)、Llama 4 Scout 17B 16E Instruct 等 |
|
|
100
|
-
| 认证 | 需要 **Cloudflare 账户 + Account ID + API Token(Bearer)** |
|
|
101
|
-
| OpenAI 兼容端点 | 原生 REST `https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/{MODEL}`;也有 OpenAI 兼容风格 `/ai/v1/chat/completions`(**不确定**是否与 pi-ai 完全兼容) |
|
|
102
|
-
| 直连性 | 中国大陆访问 Cloudflare API 不稳定,接入配置(Account ID + Token + License 同意)较绕 |
|
|
103
|
-
|
|
104
|
-
**信息来源**:[pricepertoken: Cloudflare Workers AI Free Tier](https://pricepertoken.com/endpoints/cloudflare/free)、[Cloudflare llama-vision 官方教程](https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/docs/workers-ai/guides/tutorials/llama-vision-tutorial.mdx)
|
|
105
|
-
|
|
106
|
-
### 2.6 GitHub Models —— 免费档已收窄,需 Copilot、大陆需代理
|
|
107
|
-
|
|
108
|
-
| 项 | 内容 |
|
|
109
|
-
|---|---|
|
|
110
|
-
| OpenAI 兼容 baseURL | `https://models.github.ai/inference`(旧 `https://models.inference.ai.azure.com` 已于 2025-07 弃用) |
|
|
111
|
-
| 免费额度 | **免费档请求数很有限**;限速按 GitHub **Copilot 订阅档位**(Free / Pro / Pro+ / Business / Enterprise)递增;单请求 token 上限**极严** |
|
|
112
|
-
| 视觉模型 | `gpt-4o`、`gpt-4o-mini`、`gpt-4.1`、`gpt-4.1-mini`(均支持 image);`Llama-3.2-11B-Vision-Instruct`、`Llama-3.2-90B-Vision-Instruct`、`Llama-4-Scout`、`Llama-4-Maverick` |
|
|
113
|
-
| token 获取 | GitHub **Personal Access Token(PAT)** 或 Copilot token |
|
|
114
|
-
| 直连性 | 中国大陆**需代理** |
|
|
115
|
-
|
|
116
|
-
> ⚠️ 注意:GitHub Models 的免费/开放 API 路线在 2025 年中已被 GitHub Copilot 体系吸收,`gpt-4o` 在 GitHub Models 上被弃用(转向 gpt-4.1 系)。它不是“开箱即用免费”的首选。
|
|
117
|
-
|
|
118
|
-
**信息来源**:[GitHub Changelog:Azure endpoint 弃用](https://github.blog/changelog/2025-07-17-deprecation-of-azure-endpoint-for-github-models/)、[mintlify: GitHub Models](https://mintlify.wiki/cheahjs/free-llm-api-resources/providers/free/github-models)、[GitHub Models 迁移说明](https://www.nocode.tech/article/github-models-dies-july-30-heres-where-to-migrate-your-no-code-ai-backend)
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## 3. 完全免 key 的视觉 API
|
|
123
|
-
|
|
124
|
-
**结论:目前不存在可稳定使用的“零注册/零密钥”视觉理解 API。**
|
|
125
|
-
|
|
126
|
-
- **pollinations.ai**:实测其 OpenAI 兼容模型列表(`https://text.pollinations.ai/openai/models`)目前**只有一个文本模型 `openai-fast`(GPT-OSS 20B,`vision: false`,`input_modalities: ["text"]`)**。它免费做的是**文生图**(`image.pollinations.ai`)和文本生成,**没有视觉理解(image input → 描述)模型**。
|
|
127
|
-
- 其余“免 key”聚合端点多为文本/生图,且**稳定性差、无 SLA、随时变更**,不适合做插件默认视觉后端。
|
|
128
|
-
|
|
129
|
-
**信息来源**:[pollinations models 端点实测](https://text.pollinations.ai/openai/models)、[pollinations README](https://github.com/learn05/pollinations-AI/blob/master/pollinator-agent/README-pollinations.md)
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## 4. “预先内置”的落地建议(provider 预设,不内置密钥)
|
|
134
|
-
## 4. “预先内置”的落地建议(provider 预设,不内置密钥)
|
|
135
|
-
|
|
136
|
-
**原则**:绝不把第三方 key 写进仓库(安全 + 违反 ToS)。本仓库随附 [`presets/`](../presets/) 目录:
|
|
137
|
-
每个供应商一份按 llm-pi-ai 实际 schema 校正过的 `settings.yaml` 片段(`api: openai-completions` +
|
|
138
|
-
`baseURL` + 免费/便宜 model id + `apiKeyEnv`,`input: [text, image]`),用户只填一个 Key 即用。
|
|
139
|
-
|
|
140
|
-
当前内置清单:
|
|
141
|
-
|
|
142
|
-
| 预设 | 平台 | 免费视觉模型 | 直连 | 说明 |
|
|
143
|
-
|---|---|---|---|---|
|
|
144
|
-
| `presets/dashscope.yaml` | 阿里云百炼 | `qwen-vl-plus`、`qwen2.5-vl-7b-instruct` | ✅ | 新用户每系列 100 万 token/90 天(综合最优) |
|
|
145
|
-
| `presets/zai.yaml` | 智谱 bigmodel.cn | `glm-4.6v-flash` | ✅ | **永久免费** |
|
|
146
|
-
| `presets/siliconflow.yaml` | 硅基流动 | `Qwen/Qwen2.5-VL-7B/32B-Instruct` | ✅ | ¥14 赠金覆盖 |
|
|
147
|
-
| `presets/openrouter.yaml` | OpenRouter | `google/gemma-4-31b-it:free` 等 | 需代理 | 50 次/天;免费名单轮换频繁 |
|
|
148
|
-
| `presets/ovh.yaml` | OVHcloud AI Endpoints | `Qwen2.5-VL-72B-Instruct` | ✅ | **免注册免 Key**(2 次/分钟/IP);已内置为插件默认 httpProviders |
|
|
149
|
-
|
|
150
|
-
## 5. 结论与推荐顺序
|
|
151
|
-
|
|
152
|
-
① 百炼 DashScope(额度最大 + 直连)> ② 智谱 bigmodel.cn `glm-4.6v-flash`(永久免费 + 直连)>
|
|
153
|
-
③ SiliconFlow(直连 + 赠金)> ④ OpenRouter(已有 key,`gemma-4:free`,需代理)>
|
|
154
|
-
⑤ Cloudflare(额度大但接入绕)> ⑥ GitHub Models(已收窄)> ⑦ Groq(需代理,视觉可用性不确定)>
|
|
155
|
-
⑧ pollinations(无视觉理解)。
|
|
156
|
-
|
|
157
|
-
## 6. 不确定项
|
|
158
|
-
|
|
159
|
-
- SiliconFlow 通用 VL 是否永久免费:官方未明示,赠金用完后以账单为准;
|
|
160
|
-
- Groq 免费档视觉模型可用性:官方免费层主要是文本模型;
|
|
161
|
-
- Cloudflare Workers AI 的 OpenAI 兼容端点兼容性:官方端点非 OpenAI 形状,需网关转换;
|
|
162
|
-
- Z.ai 除 `glm-4.6v-flash` 外各 VL 的限时免费截止时间;
|
|
163
|
-
- OpenRouter 免费名单轮换风险:数周内已下架 `qwen-vl-plus:free`、`llama-4-scout:free`、
|
|
164
|
-
`gemma-3-27b-it:free`、`llama-3.2-11b-vision:free` 等,本节数据以报告生成当日为准。
|
|
165
|
-
|
|
166
|
-
> 所有来源链接见上文各节;免费额度、模型名称、地区可用性均可能变化,使用前请以官方页面为准。
|
|
9
|
+
见[架构决策和历史回溯](architecture/model-catalog-ownership.md)。
|
|
@@ -12,9 +12,11 @@ This means a newly released Qwen/GLM/Gemini/OpenAI-compatible model normally nee
|
|
|
12
12
|
|
|
13
13
|
## Current preset
|
|
14
14
|
|
|
15
|
-
### `glm-4v-flash*`
|
|
15
|
+
### `glm-4v-flash*` on Zhipu's official endpoint
|
|
16
16
|
|
|
17
|
-
`glm-4v-flash`
|
|
17
|
+
[Issue #53](https://github.com/ysr666/dsh-vision-router/issues/53) reproduced error 1210 (output token limit `[1,1024]`) when calling `glm-4v-flash` on `https://open.bigmodel.cn/api/paas/v4/chat/completions`. For that **exact HTTPS origin and path**, the compatibility layer proactively caps requests at 1024, preserving stricter user values.
|
|
18
|
+
|
|
19
|
+
A self-hosted or third-party gateway may use the same model ID but a different output limit. Vision Router does **not** impose the official endpoint's 1024 cap on such a DSH-configured gateway. Instead, a clear HTTP 400/422 token-limit response can still trigger the existing bounded, error-driven correction. This narrows the earlier model-name-only rule; deployments that depended on automatic 1024 capping at a custom endpoint should specify `maxTokens: 1024` explicitly or return a parseable limit error.
|
|
18
20
|
|
|
19
21
|
A stricter user setting is preserved:
|
|
20
22
|
|
|
@@ -27,7 +29,7 @@ httpProviders:
|
|
|
27
29
|
maxTokens: 768
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
On the official endpoint, the request remains at 768. If `maxTokens` is 4096 (including the generic default), the GLM preset sends 1024; it does not rewrite an unrelated endpoint.
|
|
31
33
|
|
|
32
34
|
## Image prompt compatibility
|
|
33
35
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# v3.0.5 release candidate
|
|
2
|
+
|
|
3
|
+
This is a corrective patch for the existing 3.0.x line, not an announcement that npm has already published it.
|
|
4
|
+
|
|
5
|
+
## Included
|
|
6
|
+
- #727: successful `vision_describe` guidance now uses a source-attributed `notice`, so a synthetic injected context does not terminate the assistant's visible answer. Original contribution from @kevindawn11-hash in #728 (authored commit `14c67c7`, preserved in history by merge #733), paired with Session V3/V4 source-boundary fix #731. The final merged source is `main@0fc51c3` and no npm publication is implied.
|
|
7
|
+
- #730: updated latest-alpha CI to accept DSH JSONL namespace plugin exports in addition to older defaults; the exact published alpha lifecycle passed on Node 22/24. This is CI-only.
|
|
8
|
+
- #721 qualifies DSH 0.2.1-rc.1 at upstream 1600d8a1e140dcde43a1a0941940a0480712c011 with exact source and real Host/Chromium/Settings/attachment CI.
|
|
9
|
+
- #722 fixes #719 by removing two unused imports of optional DSH dependencies, originally contributed by @m4ku1337 in #720. Missing optional peers must not prevent Desktop activation.
|
|
10
|
+
- #723 checks the actual OVHcloud VLM JSON body against its documented 10 MB limit before egress. Only the official OVH endpoint is affected; image content is not silently changed.
|
|
11
|
+
|
|
12
|
+
- #735: keep the Vision toggle clickable across a transient Host model-catalog refresh only when a valid complete source/wrapper pair remains; Host selection authority and all cold/unavailable/selecting gates remain unchanged. This mitigates the independently evidenced native-disabled click-loss case, but does not resolve the separate Host RPC fault tracked in #738.
|
|
13
|
+
- #737: add a privacy-bounded, test-only `gateway/internal` origin classifier for real Desktop evidence. It does not change runtime behavior or repair the intermittent Host failure.
|
|
14
|
+
- #736: improve English/Chinese onboarding and preserve visible cloud-data disclosure; no runtime or dependency changes.
|
|
15
|
+
|
|
16
|
+
## Compatibility
|
|
17
|
+
Node ^22.19.0 or 24+. DSH >=0.1.5-rc.1 <0.2.0-0 or >=0.2.0-rc.2 <0.3.0-0. No settings or session migration, new Host privileges, or API breaking changes.
|
|
18
|
+
|
|
19
|
+
## Qualification
|
|
20
|
+
Each fixing PR passed its final-head CI. #735 passed 98 checks (one conditional skip); #737 passed 33 checks (one conditional skip) plus manually dispatched DSH Alpha / 0.1.7 / 0.2.0-rc.2 exact Host gates (6/6, 5/5, 7/7). These were source and Host qualification tests, **not a clean install or an npm release of the final v3.0.5 tarball**. The candidate version still requires its own Node, packed artifact, real Host and browser verification. For detailed acceptance evidence see docs/development/v305-real-scenario-acceptance.md.
|
|
21
|
+
|
|
22
|
+
## Still open
|
|
23
|
+
- #738 (open): intermittent Windows Node24 Host `gateway/internal` on an **already delivered** Vision OFF selection; #737 adds only diagnostic classification, not a fix.
|
|
24
|
+
- #716 (open): user-reported backend HTTP 400; four small synthetic OVH requests have since returned 200 from the maintainer's machine, but this does not explain the reporter's failures.
|
|
25
|
+
- #726 (open, low priority): TUI-only overlay not-found diagnostic noise; no speculative profile-composition change is included.
|
|
26
|
+
- #684 (closed): catalog-refreshed native click suppression received the bounded #735 mitigation. Its separate Host error class is tracked as #738.
|
|
27
|
+
- #704 (closed / awaiting reproducible evidence): historical billion-context coexistence report; no verified co-installation failure is claimed repaired here.
|
|
28
|
+
- #729 (still a PR): Atlas Cloud preset remains outside this release until the specific models' image-content behavior is verified.
|
|
29
|
+
- #703 (closed): upstream installer writer-lock contention was out of scope, not repaired by DVR.
|
|
30
|
+
|
|
31
|
+
Publication is a separate release gate and is not performed by this preparation PR.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# v3.1.0 — release notes / 更新说明
|
|
2
|
+
|
|
3
|
+
These notes describe the v3.1.0 source changes. The published package and its provenance must be verified separately through the protected release workflow, GitHub Releases and npm.
|
|
4
|
+
|
|
5
|
+
本文描述 v3.1.0 源码改动。实际已发布的包体及来源证明需通过受保护流程、GitHub Releases 和 npm 另行核实。
|
|
6
|
+
|
|
7
|
+
## Simpler setup / 更容易使用
|
|
8
|
+
|
|
9
|
+
- **#754**: The Vision Router General page no longer treats merely choosing a model as proof that images can reach it. When DSH declares a model text-only, a concise bilingual explanation points to DSH Settings → Models → Image input, with a Recheck action and optional collapsed legacy Host help. The plugin never silently changes Host model metadata, and enabling a flag does not grant multimodal capabilities to a text-only model.
|
|
10
|
+
- **#754**:不再把“选中了模型”误报成“肯定能看图”。DSH 明确声明纯文本时,默认界面用简短中文/英文提示用户在 DSH「设置 → 模型」开启图片输入,并提供「重新检测」;旧版 YAML 字段折叠在可选帮助中。插件不会擅自修改 Host 模型配置,也不会把纯文本模型变为多模态模型。
|
|
11
|
+
- **#756**: Cloud-image privacy guidance now tells the user exactly how to stop **Vision Router image uploads**: on the DSH machine, enable Local-only vision in Vision Router → General and **Save**. A browser-local “Do not remind again” preference minimizes repeated explanation, while retaining a short egress status and a “How to stop uploads” control. Dismissing the notice **does not consent to uploads or change settings**. Unsaved changes never claim that the local-only policy has taken effect. A cloud chat model can still receive **derived vision-result text**; fully local use also requires selecting a local chat model.
|
|
12
|
+
- **#756**:清楚告诉用户在运行 DSH 的电脑上打开 Vision Router「常规」,开启「仅本地视觉」并**保存**,即可阻止**本插件向云端视觉服务上传图片**。可勾选「不再提醒」,该浏览器仍保留一行提醒和「查看如何关闭出网」入口;收起提醒**不等于授权上传,也不会修改配置**。未保存的草稿不会误报为已生效。如果聊天模型在云端,**识图结果文字仍可能出网**;完全本地使用还需在聊天页选择本地聊天模型。
|
|
13
|
+
|
|
14
|
+
## Compatibility, fixes and maintenance / 兼容与修复
|
|
15
|
+
|
|
16
|
+
- **#751**: Qualified DSH `0.2.1-rc.3` against exact upstream source and real Host/Chromium checks, without raising the supported DSH/Node floor. / 固定上游精确源码与真实 Host/Chromium 验收 `0.2.1-rc.3`,不抬高 DSH/Node 最低支持要求。
|
|
17
|
+
- **#745, #747, #748, #750**: Scoped HTTP 400 token-limit parsing, official route matching and trusted model-capability hints; do not infer that every vendor-specific HTTP error is fixed. / 收敛 HTTP 400 token 限额解析、官方路由匹配和模型能力提示的信任边界;不代表所有供应商 HTTP 错误均已解决。
|
|
18
|
+
- **#746**: Restored vendor catalog ownership to DSH while retaining the packaged Web sidecar. / 将供应商目录归属交还 DSH,保留随包发布的 Web sidecar。
|
|
19
|
+
- **#740**: Improved `doctor`'s safe, paste-ready GitHub issue template. / 优化 `doctor` 生成可安全粘贴的 GitHub Issue 模板。
|
|
20
|
+
- **#752 and #753**: Updated the lockfile to patched `follow-redirects@1.16.1` and `zod@4.6.6`, respectively. Existing GitHub advisory states may take time to reconcile; changes do not claim an independent full security audit. / 锁文件纳入修复后的 `follow-redirects@1.16.1` 与 `zod@4.6.6`。GitHub 告警状态可能延迟同步;本次升级不代表完成额外全面安全审计。
|
|
21
|
+
- **#758**: Patch `undici` to >=7.30.1 (staying in major 7), and `puppeteer-core` to >=25.16.0 (staying in major 25). The latter removes the vulnerable `chromium-bidi -> zod@3.24.1` production dependency; the direct Zod minimum is raised to `^4.6.6`. The **combined v3.1.0 source candidate** passed `pnpm audit --prod --audit-level high --registry https://registry.npmjs.org` with **no known vulnerabilities**. This is not a guarantee that future advisories cannot appear. / 修复 `undici` 与 `puppeteer-core` 的生产依赖漏洞,消除 Chromium BiDi 引入的旧 Zod 3,并将直接 Zod 最低版本提高至 `4.6.6`。合并预演候选在官方 npm 注册表执行生产依赖审计显示“未发现已知漏洞”;这不等于保证未来不会出现新漏洞。
|
|
22
|
+
- CI and dependency Action pins were refreshed where validated. / 更新已验收的 CI 与依赖 Action 固定版本。
|
|
23
|
+
|
|
24
|
+
## Compatibility and known boundaries / 支持窗口与边界
|
|
25
|
+
|
|
26
|
+
- Node `^22.19.0` or `>=24.0.0` (as stated in package metadata). DSH `>=0.1.5-rc.1 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0`. No new Host privileges, automatic Host configuration rewrite, Session schema migration, or public API breaking change is intended.
|
|
27
|
+
- 继续支持上述 Node 和 DSH 版本范围;不新增 Host 权限、不擅自改写 Host 设置、不迁移 Session 格式、不故意引入公共 API 破坏性变更。
|
|
28
|
+
- #756 only affects **notice presentation**; it does not introduce a new consent system or alter network enforcement. A browser-only localStorage preference is not synchronized across browsers or devices. / #756 只改变**提示展示**,不新增隐私授权机制,不改变网络拦截逻辑。浏览器提示偏好不会跨设备同步。
|
|
29
|
+
- Historical intermittent Desktop selection/RPC issues (e.g. #738), vendor-specific HTTP reports and upstream installer behavior are not claimed resolved solely by this minor release. / 历史偶发 Desktop 选择/RPC、特定供应商 HTTP 以及上游安装器问题,不能仅因本版本发布就宣称已全部根修。
|
|
30
|
+
|
|
31
|
+
## Release evidence / 发布验收
|
|
32
|
+
|
|
33
|
+
- #754 and #756 completed their exact PR-head cross-platform CI with no failures (#754: 105 successes, 1 conditional skip; #756: 105 successes, 1 conditional skip), including Node 22/24 and real Host gates. / #754 与 #756 的精确 PR-head 跨平台 CI 均零失败,Node 22/24 与真实 Host 门禁通过。
|
|
34
|
+
- The final combined release-preparation commit, npm tarball, OIDC provenance and published artifact are separate gates and **must be checked before calling v3.1.0 released**. / 最终合并后的候选提交、npm 包体、OIDC 来源证明及发布结果仍需受保护流程核验,未完成前不得称正式发布。
|
package/index.js
CHANGED
|
@@ -58,9 +58,11 @@ import {
|
|
|
58
58
|
import { streamWithVisionSessionAffinity } from './lib/session-affinity-runtime.js'
|
|
59
59
|
import {
|
|
60
60
|
routingCorrectionFor,
|
|
61
|
+
correctionPreservesRuntimeTransport,
|
|
61
62
|
toAnthropicMessages,
|
|
62
63
|
callAnthropicCompatible,
|
|
63
64
|
} from './lib/catalog-corrections.js'
|
|
65
|
+
import { providerTransportFor } from './lib/live-model-discovery.js'
|
|
64
66
|
import { getOfficialDeepSeekCatalog } from './lib/official-deepseek-catalog.js'
|
|
65
67
|
import {
|
|
66
68
|
classifyVisionFailure,
|
|
@@ -1644,6 +1646,25 @@ export function apply(ctx, config = {}, runtime = {}) {
|
|
|
1644
1646
|
if (correction === undefined) return undefined
|
|
1645
1647
|
const rawProfile = rawChannelProfileOf(pair.provider)
|
|
1646
1648
|
const resolvedProfile = resolvedPiAiProfileOf(pair.provider)
|
|
1649
|
+
// A built-in pi-ai catalog fact is not proof that the user's actual
|
|
1650
|
+
// DSH provider config still uses the official gateway. Refuse to reroute
|
|
1651
|
+
// another gateway's credentials into the hard-coded official endpoint.
|
|
1652
|
+
let activeHostTransport
|
|
1653
|
+
let strictHostTransport
|
|
1654
|
+
try {
|
|
1655
|
+
activeHostTransport = providerTransportFor(ctx, pair.provider)
|
|
1656
|
+
strictHostTransport = providerTransportFor(ctx, pair.provider, { strictBaseURL: true })
|
|
1657
|
+
} catch { return undefined }
|
|
1658
|
+
if (!correctionPreservesRuntimeTransport(
|
|
1659
|
+
correction,
|
|
1660
|
+
activeHostTransport,
|
|
1661
|
+
strictHostTransport,
|
|
1662
|
+
rawProfile,
|
|
1663
|
+
resolvedProfile,
|
|
1664
|
+
// piProvider.api is a registry of wire handlers, not a resolved
|
|
1665
|
+
// protocol string. Only use its baseUrl as optional transport evidence.
|
|
1666
|
+
{ baseUrl: resolvedProfile?.piProvider?.baseUrl },
|
|
1667
|
+
)) return undefined
|
|
1647
1668
|
const apiKeyEnv = [rawProfile, resolvedProfile]
|
|
1648
1669
|
.map((profile) => (profile && typeof profile.apiKeyEnv === 'string' ? profile.apiKeyEnv : ''))
|
|
1649
1670
|
.find((ref) => ref !== '')
|
|
@@ -33,7 +33,7 @@ export const CATALOG_ROUTING_CORRECTIONS = [
|
|
|
33
33
|
// The exact broken configuration this correction recognizes. A route the
|
|
34
34
|
// user pointed elsewhere (or a catalog fixed upstream) never engages it.
|
|
35
35
|
wrongApi: 'openai-completions',
|
|
36
|
-
|
|
36
|
+
wrongBaseURLRoot: 'https://opencode.ai/zen/go',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
provider: 'opencode-go',
|
|
@@ -44,10 +44,69 @@ export const CATALOG_ROUTING_CORRECTIONS = [
|
|
|
44
44
|
api: 'anthropic-messages',
|
|
45
45
|
baseURL: 'https://opencode.ai/zen/go',
|
|
46
46
|
wrongApi: 'openai-completions',
|
|
47
|
-
|
|
47
|
+
wrongBaseURLRoot: 'https://opencode.ai/zen/go',
|
|
48
48
|
},
|
|
49
49
|
]
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Reject lookalike/cross-origin or altered path catalog URLs. The correction
|
|
53
|
+
* owns only the official OpenCode Go gateway and its two documented *base*
|
|
54
|
+
* shapes (/zen/go and /zen/go/v1), never arbitrary custom provider gateways.
|
|
55
|
+
* A substring check would incorrectly match e.g. notopencode.ai/zen/go.
|
|
56
|
+
*/
|
|
57
|
+
function matchesDocumentedCatalogBaseURL(actual, expectedRoot) {
|
|
58
|
+
try {
|
|
59
|
+
const url = new URL(String(actual))
|
|
60
|
+
const expected = new URL(String(expectedRoot))
|
|
61
|
+
if (url.protocol !== 'https:' || url.origin !== expected.origin) return false
|
|
62
|
+
if (url.username !== '' || url.password !== '' || url.search !== '' || url.hash !== '') {
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
const actualPath = url.pathname.replace(/\/+$/, '')
|
|
66
|
+
const basePath = expected.pathname.replace(/\/+$/, '')
|
|
67
|
+
return actualPath === basePath || actualPath === `${basePath}/v1`
|
|
68
|
+
} catch {
|
|
69
|
+
return false
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The pi-ai *catalog entry* may still be official even if a Host profile
|
|
75
|
+
* overrides its actual transport. Do not send that profile's credential to
|
|
76
|
+
* a hard-coded corrected endpoint unless every explicit Host transport fact
|
|
77
|
+
* we can observe agrees with the documented original route.
|
|
78
|
+
*
|
|
79
|
+
* Undefined/unconfigured profiles are not positive evidence; the caller must
|
|
80
|
+
* first have proven the precise broken catalog entry via routingCorrectionFor.
|
|
81
|
+
*/
|
|
82
|
+
export function correctionPreservesConfiguredTransport(correction, ...profiles) {
|
|
83
|
+
if (!correction?.wrongBaseURLRoot || !correction?.wrongApi) return false
|
|
84
|
+
for (const profile of profiles) {
|
|
85
|
+
if (!profile || typeof profile !== 'object') continue
|
|
86
|
+
for (const actual of [profile.baseURL, profile.baseUrl]) {
|
|
87
|
+
if (actual === undefined || actual === null || actual === '') continue
|
|
88
|
+
if (typeof actual !== 'string' || !matchesDocumentedCatalogBaseURL(actual, correction.wrongBaseURLRoot)) {
|
|
89
|
+
return false
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (profile.api !== undefined && profile.api !== null && profile.api !== '') {
|
|
93
|
+
if (profile.api !== correction.wrongApi) return false
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A Host-configured URL with query, fragment or userinfo is allowed to remain
|
|
101
|
+
* a normal DSH route, but must not inherit a catalog correction that hardcodes
|
|
102
|
+
* a different destination. Generic model discovery historically strips those
|
|
103
|
+
* modifiers, so require a second, strict reading of the *same* configuration.
|
|
104
|
+
*/
|
|
105
|
+
export function correctionPreservesRuntimeTransport(correction, loose, strict, ...profiles) {
|
|
106
|
+
if (loose !== undefined && strict === undefined) return false
|
|
107
|
+
return correctionPreservesConfiguredTransport(correction, ...profiles, strict)
|
|
108
|
+
}
|
|
109
|
+
|
|
51
110
|
/**
|
|
52
111
|
* Decide whether a routing correction engages for one resolved backend.
|
|
53
112
|
*
|
|
@@ -72,12 +131,12 @@ export function routingCorrectionFor(facts, provider, model, enabled = true) {
|
|
|
72
131
|
// The resolved route is broken in some OTHER way (or speaks yet another
|
|
73
132
|
// protocol); not the configuration this correction was written for.
|
|
74
133
|
if (entry.wrongApi !== undefined && entry.wrongApi !== facts.api) return undefined
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
134
|
+
// Never override a custom DSH gateway merely because its URL happens to
|
|
135
|
+
// *contain* the official domain and path as text.
|
|
136
|
+
if (
|
|
137
|
+
entry.wrongBaseURLRoot !== undefined &&
|
|
138
|
+
!matchesDocumentedCatalogBaseURL(facts.baseUrl, entry.wrongBaseURLRoot)
|
|
139
|
+
) return undefined
|
|
81
140
|
return entry
|
|
82
141
|
}
|
|
83
142
|
|
|
@@ -1203,12 +1203,23 @@ export const CLIENT_PRESENTATION_PRELUDE = String.raw`(function(){
|
|
|
1203
1203
|
var setToast = toastState[1];
|
|
1204
1204
|
var busy = state.status === 'selecting' || selectionInFlight;
|
|
1205
1205
|
var loading = settling;
|
|
1206
|
+
// Host's model-catalog refresh retains the last good current/groups,
|
|
1207
|
+
// but briefly reports 'loading'. When that *complete* pair is still
|
|
1208
|
+
// present, its selection may be sent to Host for fresh validation;
|
|
1209
|
+
// don't flip the native HTML disabled bit in the middle of a user's
|
|
1210
|
+
// pointer gesture (Chromium drops the click even after re-enabling).
|
|
1211
|
+
// A cold load, reconnect, unavailable pair, or selection in flight
|
|
1212
|
+
// remains blocked. We never infer a new mode or optimistically commit.
|
|
1213
|
+
var refreshWithPair = state.status === 'loading' && complete &&
|
|
1214
|
+
!!livePair.target && state.pending == null && state.error == null &&
|
|
1215
|
+
state.routable !== false;
|
|
1216
|
+
var blockingLoad = loading && !refreshWithPair;
|
|
1206
1217
|
var removed = props.session && props.session.removed === true;
|
|
1207
|
-
var disabled = props.available !== true || removed || busy ||
|
|
1218
|
+
var disabled = props.available !== true || removed || busy || blockingLoad || livePair.mode === 'unavailable';
|
|
1208
1219
|
var t = typeof props.t === 'function' ? props.t : fallbackTranslate(active);
|
|
1209
1220
|
var title = busy || ownSettling
|
|
1210
1221
|
? t('switching')
|
|
1211
|
-
:
|
|
1222
|
+
: blockingLoad
|
|
1212
1223
|
? t('loading')
|
|
1213
1224
|
: livePair.mode === 'unavailable'
|
|
1214
1225
|
? t('unavailable')
|
|
@@ -1236,12 +1247,12 @@ export const CLIENT_PRESENTATION_PRELUDE = String.raw`(function(){
|
|
|
1236
1247
|
'data-vision-router-mode-toggle': 'true',
|
|
1237
1248
|
'aria-pressed': active,
|
|
1238
1249
|
'aria-label': title,
|
|
1239
|
-
'aria-busy': busy ||
|
|
1250
|
+
'aria-busy': busy || blockingLoad,
|
|
1240
1251
|
title: title,
|
|
1241
1252
|
disabled: disabled,
|
|
1242
1253
|
className: 'vr-vision-toggle',
|
|
1243
1254
|
'data-active': active ? 'true' : 'false',
|
|
1244
|
-
'data-dimmed': disabled && !ownSettling && (livePair.mode === 'unavailable' ||
|
|
1255
|
+
'data-dimmed': disabled && !ownSettling && (livePair.mode === 'unavailable' || blockingLoad) ? 'true' : 'false',
|
|
1245
1256
|
onClick: function() {
|
|
1246
1257
|
if (disabled || !pair.target || typeof props.select !== 'function' ||
|
|
1247
1258
|
(selectionTransaction.current && selectionTransaction.current.directory === directory)) return;
|
package/lib/client.js
CHANGED
|
@@ -249,7 +249,7 @@ openLogFolder,
|
|
|
249
249
|
builtinFallbackLabel: '内置免费兜底(自动)',
|
|
250
250
|
builtinFallbackEnabled: '已启用',
|
|
251
251
|
builtinFallbackDisabled: '已关闭',
|
|
252
|
-
builtinFallbackBody: 'OVHcloud 匿名视觉链共 {count} 个模型,首选 {primary}。匿名限额为每 IP、每模型
|
|
252
|
+
builtinFallbackBody: 'OVHcloud 匿名视觉链共 {count} 个模型,首选 {primary}。匿名限额为每 IP、每模型 {perModelRpm} 次/分钟;{count} 个模型独立限额,理论合计约 {totalRpm} 次/分钟,实际以 OVH 限流为准。它固定在上面用户模型之后尝试,免注册、免 Key。',
|
|
253
253
|
chainLabel: '识图模型',
|
|
254
254
|
chainHint: '选择 Vision Router 用来读取图片的模型。将按从上到下的顺序尝试,失败时自动切换到下一个。',
|
|
255
255
|
addFallback: '+ 添加备用识图模型',
|
|
@@ -535,7 +535,7 @@ openLogFolder,
|
|
|
535
535
|
builtinFallbackLabel: 'Built-in free fallback (automatic)',
|
|
536
536
|
builtinFallbackEnabled: 'Enabled',
|
|
537
537
|
builtinFallbackDisabled: 'Disabled',
|
|
538
|
-
builtinFallbackBody: 'The anonymous OVHcloud vision chain contains {count} models, starting with {primary}. Anonymous limits are
|
|
538
|
+
builtinFallbackBody: 'The anonymous OVHcloud vision chain contains {count} models, starting with {primary}. Anonymous limits are {perModelRpm} requests/minute per IP per model; {count} independent model buckets are about {totalRpm} RPM in theory, subject to OVH rate limiting. It always runs after your user models and needs no signup or API key.',
|
|
539
539
|
chainLabel: 'Vision model',
|
|
540
540
|
chainHint: 'Choose the models Vision Router uses to read images. They are tried from top to bottom, with automatic failover.',
|
|
541
541
|
addFallback: '+ Add fallback vision model',
|
|
@@ -3932,13 +3932,16 @@ openLogFolder,
|
|
|
3932
3932
|
const list = Array.isArray(visionCaps.builtinFallback) ? visionCaps.builtinFallback : []
|
|
3933
3933
|
const enabled = format('freeFallback') !== false
|
|
3934
3934
|
const primary = list[0] && list[0].model ? list[0].model : 'Qwen3.5-397B-A17B'
|
|
3935
|
-
const count = list.length > 0 ? list.length :
|
|
3935
|
+
const count = list.length > 0 ? list.length : 4
|
|
3936
|
+
const perModelRpm = Number.isFinite(visionCaps.anonymousRpmPerModel)
|
|
3937
|
+
? Math.max(0, visionCaps.anonymousRpmPerModel)
|
|
3938
|
+
: 2
|
|
3936
3939
|
return h('div', { className: 'vr-field' },
|
|
3937
3940
|
h('div', { className: 'vr-field-head' },
|
|
3938
3941
|
h('span', { className: 'vr-label' }, t('builtinFallbackLabel')),
|
|
3939
3942
|
h('span', { className: 'vr-badge' }, enabled ? t('builtinFallbackEnabled') : t('builtinFallbackDisabled')),
|
|
3940
3943
|
),
|
|
3941
|
-
h('p', { className: 'vr-hint' }, t('builtinFallbackBody', { count, primary })),
|
|
3944
|
+
h('p', { className: 'vr-hint' }, t('builtinFallbackBody', { count, primary, perModelRpm, totalRpm: count * perModelRpm })),
|
|
3942
3945
|
)
|
|
3943
3946
|
}
|
|
3944
3947
|
const textProviderEditor = () => {
|
package/lib/core-primitives.js
CHANGED
|
@@ -1778,12 +1778,12 @@ export async function downscaleImage(bytes, maxPixels, options = {}) {
|
|
|
1778
1778
|
*/
|
|
1779
1779
|
export const DEFAULT_HTTP_PROVIDERS = [
|
|
1780
1780
|
// OVHcloud anonymous quota is per IP AND per model. Keep the free chain
|
|
1781
|
-
// ordered
|
|
1781
|
+
// ordered by preferred quality so quality wins first. Retired models are
|
|
1782
|
+
// removed from this implicit chain; explicit user rows are never rewritten. A 429 on one model can
|
|
1782
1783
|
// immediately fall through to the next model's independent anonymous bucket.
|
|
1783
1784
|
{ name: 'ovh', baseURL: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1', model: 'Qwen3.5-397B-A17B', apiKeyEnv: '', maxTokens: 4096 },
|
|
1784
1785
|
{ name: 'ovh', baseURL: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1', model: 'Qwen2.5-VL-72B-Instruct', apiKeyEnv: '', maxTokens: 4096 },
|
|
1785
1786
|
{ name: 'ovh', baseURL: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1', model: 'Qwen3.6-27B', apiKeyEnv: '', maxTokens: 4096 },
|
|
1786
|
-
{ name: 'ovh', baseURL: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1', model: 'Mistral-Small-3.2-24B-Instruct-2506', apiKeyEnv: '', maxTokens: 4096 },
|
|
1787
1787
|
{ name: 'ovh', baseURL: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1', model: 'Qwen3.5-9B', apiKeyEnv: '', maxTokens: 4096 },
|
|
1788
1788
|
]
|
|
1789
1789
|
|