@mengruo/dsh-vision-toolkit 0.0.1

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.
Files changed (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +356 -0
  4. package/README.zh.md +354 -0
  5. package/assets/community-group-qr.png +0 -0
  6. package/assets/dsh-conversation-artifact.png +0 -0
  7. package/assets/dsh-conversation-image-qa-top.png +0 -0
  8. package/assets/dsh-conversation-image-qa.png +0 -0
  9. package/assets/dsh-conversation-pixel-diff.png +0 -0
  10. package/assets/dsh-conversation-screenshot-debugging-top.png +0 -0
  11. package/assets/dsh-conversation-screenshot-debugging.png +0 -0
  12. package/assets/dsh-conversation-tool-call.png +0 -0
  13. package/assets/dsh-conversation-vision-trace.png +0 -0
  14. package/assets/dsh-view-example.png +0 -0
  15. package/assets/hero-v2.png +0 -0
  16. package/assets/logo_aihubmix.png +0 -0
  17. package/assets/python-bootstrap.json +48 -0
  18. package/assets/skill/SKILL.md +329 -0
  19. package/assets/skill/UPSTREAM.json +71 -0
  20. package/assets/skill/references/gui.md +88 -0
  21. package/assets/skill/references/long-screenshot-ocr.md +77 -0
  22. package/assets/skill/references/restore-graphic.md +84 -0
  23. package/assets/skill/references/restore-structure.md +45 -0
  24. package/assets/skill/references/restore-ui.md +202 -0
  25. package/assets/social-preview.png +0 -0
  26. package/assets/upstream/README.md +18 -0
  27. package/assets/upstream/focus-hint-comparison-1.webp +0 -0
  28. package/assets/upstream/focus-hint-comparison-2.webp +0 -0
  29. package/assets/upstream/infographic-reference.webp +0 -0
  30. package/assets/upstream/infographic-result.webp +0 -0
  31. package/assets/upstream/ui-fast-restore-reference.webp +0 -0
  32. package/assets/upstream/ui-fast-restore-result.webp +0 -0
  33. package/assets/upstream/ui-result.webp +0 -0
  34. package/assets/upstream/ui-sketch.webp +0 -0
  35. package/assets/vision-model-test.png +0 -0
  36. package/assets/vision-settings.png +0 -0
  37. package/assets/wechat-reward.png +0 -0
  38. package/cordis.patch.yml +6 -0
  39. package/docs/aihubmix-gemini-vision.i18n.yaml +6 -0
  40. package/docs/aihubmix-gemini-vision.md +138 -0
  41. package/docs/aihubmix-gemini-vision.zh.md +138 -0
  42. package/docs/assets/aihubmix-api-keys.png +0 -0
  43. package/docs/assets/aihubmix-create-key.png +0 -0
  44. package/docs/assets/aihubmix-free-vision-model.png +0 -0
  45. package/docs/assets/aihubmix-home.png +0 -0
  46. package/docs/assets/aihubmix-sign-up.png +0 -0
  47. package/docs/assets/groq-console-home.png +0 -0
  48. package/docs/assets/groq-console-keys-login.png +0 -0
  49. package/docs/assets/groq-docs-quickstart.png +0 -0
  50. package/docs/assets/groq-docs-qwen3.6.png +0 -0
  51. package/docs/assets/groq-docs-vision.png +0 -0
  52. package/docs/assets/vision-settings.png +0 -0
  53. package/docs/dsh-desktop-install.md +67 -0
  54. package/docs/dsh-desktop-install.zh.md +67 -0
  55. package/docs/groq-qwen3.6-vision.i18n.yaml +6 -0
  56. package/docs/groq-qwen3.6-vision.md +236 -0
  57. package/docs/groq-qwen3.6-vision.zh.md +236 -0
  58. package/docs/python-runtime.i18n.yaml +6 -0
  59. package/docs/python-runtime.md +89 -0
  60. package/docs/python-runtime.zh.md +89 -0
  61. package/docs/requirements-traceability/README.i18n.yaml +6 -0
  62. package/docs/requirements-traceability/README.md +75 -0
  63. package/docs/requirements-traceability/README.zh.md +75 -0
  64. package/examples/ui-restoration/README.i18n.yaml +6 -0
  65. package/examples/ui-restoration/README.md +70 -0
  66. package/examples/ui-restoration/README.zh.md +70 -0
  67. package/examples/ui-restoration/assets/final-heatmap.png +0 -0
  68. package/examples/ui-restoration/assets/final-report.json +83 -0
  69. package/examples/ui-restoration/assets/implementation.png +0 -0
  70. package/examples/ui-restoration/assets/initial-heatmap.png +0 -0
  71. package/examples/ui-restoration/assets/initial-report.json +83 -0
  72. package/examples/ui-restoration/assets/initial.png +0 -0
  73. package/examples/ui-restoration/assets/metrics.json +12 -0
  74. package/examples/ui-restoration/assets/reference.png +0 -0
  75. package/examples/ui-restoration/implementation.html +94 -0
  76. package/examples/ui-restoration/initial.html +57 -0
  77. package/lib/artifact-access.js +369 -0
  78. package/lib/artifact-access.js.map +1 -0
  79. package/lib/artifacts.js +56 -0
  80. package/lib/artifacts.js.map +1 -0
  81. package/lib/client.js +2099 -0
  82. package/lib/client.js.map +1 -0
  83. package/lib/config.js +172 -0
  84. package/lib/config.js.map +1 -0
  85. package/lib/defaults.js +6 -0
  86. package/lib/defaults.js.map +1 -0
  87. package/lib/errors.js +56 -0
  88. package/lib/errors.js.map +1 -0
  89. package/lib/evidence-cache.js +350 -0
  90. package/lib/evidence-cache.js.map +1 -0
  91. package/lib/exposure.js +247 -0
  92. package/lib/exposure.js.map +1 -0
  93. package/lib/image-input-variants.js +882 -0
  94. package/lib/image-input-variants.js.map +1 -0
  95. package/lib/index.js +105 -0
  96. package/lib/index.js.map +1 -0
  97. package/lib/paste-images.js +217 -0
  98. package/lib/paste-images.js.map +1 -0
  99. package/lib/paths.js +354 -0
  100. package/lib/paths.js.map +1 -0
  101. package/lib/plugin-update.js +1003 -0
  102. package/lib/plugin-update.js.map +1 -0
  103. package/lib/runtime-install.js +964 -0
  104. package/lib/runtime-install.js.map +1 -0
  105. package/lib/runtime-manager.js +133 -0
  106. package/lib/runtime-manager.js.map +1 -0
  107. package/lib/runtime.js +1678 -0
  108. package/lib/runtime.js.map +1 -0
  109. package/lib/skill.js +25 -0
  110. package/lib/skill.js.map +1 -0
  111. package/lib/tools.js +549 -0
  112. package/lib/tools.js.map +1 -0
  113. package/lib/types/artifact-access.d.ts +61 -0
  114. package/lib/types/artifact-access.d.ts.map +1 -0
  115. package/lib/types/artifacts.d.ts +42 -0
  116. package/lib/types/artifacts.d.ts.map +1 -0
  117. package/lib/types/client/display-config.d.ts +24 -0
  118. package/lib/types/client/display-config.d.ts.map +1 -0
  119. package/lib/types/client/index.d.ts +350 -0
  120. package/lib/types/client/index.d.ts.map +1 -0
  121. package/lib/types/client/model-variants-hider.d.ts +40 -0
  122. package/lib/types/client/model-variants-hider.d.ts.map +1 -0
  123. package/lib/types/client/paste-images.d.ts +126 -0
  124. package/lib/types/client/paste-images.d.ts.map +1 -0
  125. package/lib/types/config.d.ts +123 -0
  126. package/lib/types/config.d.ts.map +1 -0
  127. package/lib/types/defaults.d.ts +6 -0
  128. package/lib/types/defaults.d.ts.map +1 -0
  129. package/lib/types/errors.d.ts +35 -0
  130. package/lib/types/errors.d.ts.map +1 -0
  131. package/lib/types/evidence-cache.d.ts +91 -0
  132. package/lib/types/evidence-cache.d.ts.map +1 -0
  133. package/lib/types/exposure.d.ts +50 -0
  134. package/lib/types/exposure.d.ts.map +1 -0
  135. package/lib/types/image-input-variants.d.ts +144 -0
  136. package/lib/types/image-input-variants.d.ts.map +1 -0
  137. package/lib/types/index.d.ts +19 -0
  138. package/lib/types/index.d.ts.map +1 -0
  139. package/lib/types/paste-images.d.ts +73 -0
  140. package/lib/types/paste-images.d.ts.map +1 -0
  141. package/lib/types/paths.d.ts +117 -0
  142. package/lib/types/paths.d.ts.map +1 -0
  143. package/lib/types/plugin-update.d.ts +119 -0
  144. package/lib/types/plugin-update.d.ts.map +1 -0
  145. package/lib/types/runtime-install.d.ts +92 -0
  146. package/lib/types/runtime-install.d.ts.map +1 -0
  147. package/lib/types/runtime-manager.d.ts +60 -0
  148. package/lib/types/runtime-manager.d.ts.map +1 -0
  149. package/lib/types/runtime.d.ts +412 -0
  150. package/lib/types/runtime.d.ts.map +1 -0
  151. package/lib/types/skill.d.ts +14 -0
  152. package/lib/types/skill.d.ts.map +1 -0
  153. package/lib/types/tools.d.ts +35 -0
  154. package/lib/types/tools.d.ts.map +1 -0
  155. package/lib/types/upstream.d.ts +233 -0
  156. package/lib/types/upstream.d.ts.map +1 -0
  157. package/lib/types/version.d.ts +15 -0
  158. package/lib/types/version.d.ts.map +1 -0
  159. package/lib/types/web-request.d.ts +11 -0
  160. package/lib/types/web-request.d.ts.map +1 -0
  161. package/lib/types/web.d.ts +118 -0
  162. package/lib/types/web.d.ts.map +1 -0
  163. package/lib/upstream.js +860 -0
  164. package/lib/upstream.js.map +1 -0
  165. package/lib/version.js +18 -0
  166. package/lib/version.js.map +1 -0
  167. package/lib/web-request.js +29 -0
  168. package/lib/web-request.js.map +1 -0
  169. package/lib/web.js +462 -0
  170. package/lib/web.js.map +1 -0
  171. package/package.json +149 -0
  172. package/patches/vision-tools-dsh.patch +970 -0
  173. package/runtime/requirements.lock +3 -0
  174. package/src/artifact-access.ts +386 -0
  175. package/src/artifacts.ts +85 -0
  176. package/src/client/display-config.ts +62 -0
  177. package/src/client/index.tsx +1580 -0
  178. package/src/client/model-variants-hider.ts +159 -0
  179. package/src/client/paste-images.tsx +747 -0
  180. package/src/config.ts +290 -0
  181. package/src/defaults.ts +5 -0
  182. package/src/errors.ts +62 -0
  183. package/src/evidence-cache.ts +418 -0
  184. package/src/exposure.ts +265 -0
  185. package/src/image-input-variants.ts +996 -0
  186. package/src/index.ts +141 -0
  187. package/src/paste-images.ts +286 -0
  188. package/src/paths.ts +383 -0
  189. package/src/plugin-update.ts +1143 -0
  190. package/src/runtime-install.ts +1161 -0
  191. package/src/runtime-manager.ts +174 -0
  192. package/src/runtime.ts +2189 -0
  193. package/src/skill.ts +35 -0
  194. package/src/tools.ts +691 -0
  195. package/src/upstream.ts +1078 -0
  196. package/src/version.ts +37 -0
  197. package/src/web-request.ts +27 -0
  198. package/src/web.ts +594 -0
  199. package/vendor/agent-vision-toolkit/CHANGELOG.md +30 -0
  200. package/vendor/agent-vision-toolkit/LICENSE +21 -0
  201. package/vendor/agent-vision-toolkit/README.md +405 -0
  202. package/vendor/agent-vision-toolkit/UPSTREAM_MANIFEST.json +94 -0
  203. package/vendor/agent-vision-toolkit/bin/crop +90 -0
  204. package/vendor/agent-vision-toolkit/bin/detect +13 -0
  205. package/vendor/agent-vision-toolkit/bin/glance +93 -0
  206. package/vendor/agent-vision-toolkit/bin/ground +13 -0
  207. package/vendor/agent-vision-toolkit/bin/trace +129 -0
  208. package/vendor/agent-vision-toolkit/detect.py +60 -0
  209. package/vendor/agent-vision-toolkit/ground.py +267 -0
  210. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/dominant_colors.py +224 -0
  211. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/extract_fg.py +278 -0
  212. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/html_shot.py +420 -0
  213. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/long_screenshot_ocr.py +1245 -0
  214. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/pixel_diff.py +88 -0
  215. package/vendor/agent-vision-toolkit/tests/test_vision_client.py +450 -0
  216. package/vendor/agent-vision-toolkit/vision_client.py +310 -0
@@ -0,0 +1,67 @@
1
+ # Installing and Updating dsh-vision-toolkit in DSH Desktop
2
+
3
+ This guide explains how to install, verify, and update `dsh-vision-toolkit` in **DSH Desktop**.
4
+
5
+ > Why a separate guide? DSH Desktop bundles its own `dsh` CLI but intentionally does **not** add it to the system PATH. Running `dsh` in a system shell (PowerShell, cmd, or the macOS Terminal) reports "command not found" by design — this is not a plugin issue. Always use the **DSH Terminal** opened from the desktop tray.
6
+
7
+ ## 1. Open the DSH Terminal
8
+
9
+ 1. Find the **DSH Desktop** icon in the system tray (bottom-right on Windows, top-right menu bar on macOS).
10
+ 2. **Right-click** the icon and choose **Open DSH Terminal**.
11
+ 3. Verify the environment in the opened terminal:
12
+
13
+ ```sh
14
+ dsh --version
15
+ ```
16
+
17
+ If the version prints, the terminal environment is ready. If the command is not found, make sure the app is v2.0+ and try fully quitting and relaunching DSH Desktop first.
18
+
19
+ ## 2. Install the plugin
20
+
21
+ Run the following command in the **DSH Terminal**:
22
+
23
+ ```sh
24
+ dsh plugin --profile desktop add @mengruo/dsh-vision-toolkit@0.1.34
25
+ ```
26
+
27
+ Notes:
28
+
29
+ - `--profile desktop` targets the default `desktop` profile; replace `desktop` with `web` to install into a `web` profile.
30
+ - **Pin an exact version** (currently `0.1.34`). The DSH 1024Store marketplace catalog lags behind npm, so a one-click marketplace install can land on an older version; an explicit version guarantees the latest release.
31
+ - If the active profile is already the target profile, you can omit `--profile desktop` and run `dsh plugin add @mengruo/dsh-vision-toolkit@0.1.34` directly.
32
+
33
+ ## 3. Restart and verify
34
+
35
+ 1. **Fully quit DSH Desktop**: right-click the tray icon → **Quit** (closing the window only hides it).
36
+ 2. Reopen DSH Desktop.
37
+ 3. Open **Settings → Vision Toolkit** and click **Test vision model** to confirm the built-in free vision service works.
38
+ 4. Paste an image into the conversation and ask directly, or invoke `/vision-skills` for the full vision workflow.
39
+
40
+ ## 4. Update to a new version
41
+
42
+ 1. Check the latest version on the [npm page](https://www.npmjs.com/package/@mengruo/dsh-vision-toolkit).
43
+ 2. In the **DSH Terminal**, rerun the install command with the new version:
44
+
45
+ ```sh
46
+ dsh plugin --profile desktop add @mengruo/dsh-vision-toolkit@<new-version>
47
+ ```
48
+
49
+ 3. **Fully quit and reopen DSH Desktop** so the new version takes effect.
50
+
51
+ If you installed without pinning an exact version, the official `dsh plugin update` command also works; with a pinned version such as `@0.1.34`, use the explicit-version command above.
52
+
53
+ ## Troubleshooting
54
+
55
+ | Problem | What to do |
56
+ | --- | --- |
57
+ | `dsh` is not recognized in a system shell | Expected. Open **DSH Terminal** from the tray instead of using system PowerShell/cmd/Terminal |
58
+ | No Open DSH Terminal in the tray menu | Make sure the app is v2.0+; this entry exists only in v2 and later |
59
+ | The built-in marketplace fails with "cannot confirm the operation result" | DSH Desktop 2.0.1 has known marketplace install issues; use the DSH Terminal command in this guide instead |
60
+ | Plugin does not show up after install | Confirm the command targeted the right profile and **fully quit and restart** DSH Desktop |
61
+ | Want to install into the web profile | Replace `desktop` with `web` in the command, then restart DSH Desktop and switch to the web profile |
62
+
63
+ ## Links
64
+
65
+ - [Project website](https://agent-vision.anionex.me)
66
+ - [npm package](https://www.npmjs.com/package/@mengruo/dsh-vision-toolkit)
67
+ - [DSH Desktop user guide](https://github.com/anywhere-labs/deepseek-harness-desktop/blob/master/docs/user-guide.en.md)
@@ -0,0 +1,67 @@
1
+ # DSH Desktop 安装与更新指南
2
+
3
+ 本指南说明如何在 **DSH Desktop(桌面版)** 中安装、验证和更新 `dsh-vision-toolkit`。
4
+
5
+ > 为什么需要单独一份指南?DSH Desktop 自带 `dsh` 命令行,但**不会写入系统 PATH**。在系统终端(PowerShell、cmd、macOS 终端)里运行 `dsh` 会提示找不到命令,这是桌面版的设计行为,不是插件问题。请始终使用桌面版托盘提供的 **DSH 终端**。
6
+
7
+ ## 1. 打开 DSH 终端
8
+
9
+ 1. 找到系统托盘中的 **DSH Desktop** 图标(Windows 在右下角,macOS 在右上角菜单栏)。
10
+ 2. **右键**图标,选择 **Open DSH Terminal**(或 **打开 DSH 终端**)。
11
+ 3. 打开的终端里先确认环境可用:
12
+
13
+ ```sh
14
+ dsh --version
15
+ ```
16
+
17
+ 能看到版本号就说明终端环境正常。如果提示找不到命令,请确认应用版本是 v2.0+,并完全退出桌面版后重新打开再试。
18
+
19
+ ## 2. 安装插件
20
+
21
+ 在 **DSH 终端** 中运行以下命令:
22
+
23
+ ```sh
24
+ dsh plugin --profile desktop add @mengruo/dsh-vision-toolkit@0.1.34
25
+ ```
26
+
27
+ 几点说明:
28
+
29
+ - `--profile desktop` 表示安装到桌面版默认的 `desktop` Profile;想装到 `web` Profile 时把 `desktop` 换成 `web`。
30
+ - **建议带精确版本号**(当前为 `0.1.34`)。DSH 1024Store 插件市场的目录数据有滞后,市场里一键安装可能装到旧版本;显式写版本号能确保装到最新版。
31
+ - 如果当前激活的 Profile 就是要装的 Profile,也可以省略 `--profile desktop`,直接运行 `dsh plugin add @mengruo/dsh-vision-toolkit@0.1.34`。
32
+
33
+ ## 3. 重启并验证
34
+
35
+ 1. **完全退出 DSH Desktop**:托盘右键 → **退出**(关闭窗口只是隐藏,不算退出)。
36
+ 2. 重新打开 DSH Desktop。
37
+ 3. 进入 **设置 → 视觉工具**,点击 **测试视觉模型**,确认默认免费视觉服务可用。
38
+ 4. 在会话中**粘贴一张图片直接提问**,或调用 `/vision-skills` 使用完整视觉工作流。
39
+
40
+ ## 4. 更新到新版本
41
+
42
+ 1. 在 [npm 页面](https://www.npmjs.com/package/@mengruo/dsh-vision-toolkit) 查看最新版本号。
43
+ 2. 在 **DSH 终端** 中,把安装命令里的版本号换成新版本后重新执行:
44
+
45
+ ```sh
46
+ dsh plugin --profile desktop add @mengruo/dsh-vision-toolkit@<新版本号>
47
+ ```
48
+
49
+ 3. 再次**完全退出并重启 DSH Desktop**,新版本才会生效。
50
+
51
+ 如果当初安装时没有锁定精确版本,也可以使用官方更新命令 `dsh plugin update`,但精确版本安装(`@0.1.34` 这种写法)下请使用上面的显式版本号方式升级。
52
+
53
+ ## 常见问题
54
+
55
+ | 问题 | 处理方式 |
56
+ | --- | --- |
57
+ | 系统终端里找不到 `dsh` 命令 | 正常。请从托盘打开 **DSH 终端**,不要用系统 PowerShell/cmd/终端 |
58
+ | 托盘菜单里没有 Open DSH Terminal | 确认应用是 v2.0+ 版本;v2 才开始提供该入口 |
59
+ | 内置插件市场安装失败,提示“无法确认操作结果” | DSH Desktop 2.0.1 的市场安装链路有已知问题,请改用本文的 DSH 终端命令安装 |
60
+ | 装完插件没生效 | 确认命令装到了正确的 Profile,并**完全退出后重启**桌面版 |
61
+ | 想装到 web Profile | 把命令中的 `desktop` 换成 `web`,重启桌面版后到 web Profile 使用 |
62
+
63
+ ## 相关链接
64
+
65
+ - [项目主页](https://agent-vision.anionex.me)
66
+ - [npm 包](https://www.npmjs.com/package/@mengruo/dsh-vision-toolkit)
67
+ - [DSH Desktop 用户指南](https://github.com/anywhere-labs/deepseek-harness-desktop/blob/master/docs/user-guide.md)
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write dsh-vision-toolkit/docs/groq-qwen3.6-vision.md
5
+ groq-qwen3.6-vision.md: 04907539da37edae3d9866007221403e8239516c
6
+ groq-qwen3.6-vision.zh.md: 6fe5a22695efc3d90b937510b293c2e717cc6fd7
@@ -0,0 +1,236 @@
1
+ # Get a free Groq API key and use Qwen3.6-27B for vision
2
+
3
+ **English** | [中文](groq-qwen3.6-vision.zh.md)
4
+
5
+ This guide covers two tasks:
6
+
7
+ 1. Sign up for the GroqCloud Free Plan and create a Groq API key.
8
+ 2. Use `qwen/qwen3.6-27b` to analyze images through DSH Vision Toolkit or ordinary code.
9
+
10
+ > As of August 17, 2026, Groq lists Qwen3.6-27B as a Preview model with text and image input. Free Plan traffic is rate-limited and the limits can change; use the current [Groq Rate Limits](https://console.groq.com/docs/rate-limits) and [Qwen3.6-27B model page](https://console.groq.com/docs/model/qwen/qwen3.6-27b) as the source of truth.
11
+
12
+ ## 1. Create a free GroqCloud account
13
+
14
+ Open the [GroqCloud Console](https://console.groq.com/). You can sign up or log in with Google, GitHub, SSO, or email.
15
+
16
+ <p align="center">
17
+ <img src="assets/groq-console-home.png" width="92%" alt="GroqCloud Console sign-up and login page" />
18
+ </p>
19
+
20
+ The Free Plan is enough to complete this tutorial without purchasing paid capacity. It is not unlimited; the API returns `429 Too Many Requests` when the current quota is exhausted.
21
+
22
+ As of August 17, 2026, the official Free Plan table lists Qwen3.6-27B at `30 RPM` (requests per minute), `1K RPD` (requests per day), `8K TPM` (tokens per minute), and `200K TPD` (tokens per day). Your organization's effective limits are shown on the Limits page in Groq Console.
23
+
24
+ ## 2. Create and save an API key
25
+
26
+ After logging in, open **API Keys** in the top navigation or go directly to [Groq API Keys](https://console.groq.com/keys). When logged out, the page first shows this login prompt:
27
+
28
+ <p align="center">
29
+ <img src="assets/groq-console-keys-login.png" width="92%" alt="Groq API Keys page asking the user to log in" />
30
+ </p>
31
+
32
+ On the API Keys page:
33
+
34
+ 1. Click **Create API Key**.
35
+ 2. Enter a recognizable name such as `dsh-vision-toolkit`.
36
+ 3. Confirm the creation.
37
+ 4. Copy the key beginning with `gsk_` immediately, then save it in a password manager or a DSH Credential.
38
+
39
+ Groq's official Quickstart likewise starts with creating an API key and placing it in an environment variable:
40
+
41
+ <p align="center">
42
+ <img src="assets/groq-docs-quickstart.png" width="88%" alt="Groq Quickstart instructions for creating and setting an API key" />
43
+ </p>
44
+
45
+ The complete API key is normally shown only once. Do not put it in a README, chat transcript, screenshot, Git commit, or frontend code.
46
+
47
+ ### Set the key in a terminal
48
+
49
+ macOS / Linux:
50
+
51
+ ```sh
52
+ export GROQ_API_KEY="gsk_your_key_here"
53
+ ```
54
+
55
+ Windows PowerShell, for the current window:
56
+
57
+ ```powershell
58
+ $env:GROQ_API_KEY = "gsk_your_key_here"
59
+ ```
60
+
61
+ Confirm that the variable exists without printing the secret:
62
+
63
+ ```sh
64
+ test -n "$GROQ_API_KEY" && echo "GROQ_API_KEY is set"
65
+ ```
66
+
67
+ ## 3. Confirm the model ID and vision support
68
+
69
+ Use this exact model ID in Groq API requests:
70
+
71
+ ```text
72
+ qwen/qwen3.6-27b
73
+ ```
74
+
75
+ Do not shorten it to `qwen3.6-27b`, `Qwen3.6-27B`, or `27b`. The model page shows both image input and the Vision capability:
76
+
77
+ <p align="center">
78
+ <img src="assets/groq-docs-qwen3.6.png" width="92%" alt="Groq Qwen3.6-27B model page showing image input and Vision capability" />
79
+ </p>
80
+
81
+ The Groq model page lists these main image limits:
82
+
83
+ | Item | Limit |
84
+ |---|---:|
85
+ | Individual image file | 20 MB |
86
+ | Images in one request | Up to 3 |
87
+
88
+ Groq's general vision guide currently says that up to five images can be processed, while the Qwen3.6-27B model page says three. This guide follows the stricter model-specific limit to avoid rejected requests.
89
+
90
+ <p align="center">
91
+ <img src="assets/groq-docs-vision.png" width="88%" alt="Groq Images and Vision documentation showing model limits and an image request example" />
92
+ </p>
93
+
94
+ ## 4. Use it in DSH Vision Toolkit
95
+
96
+ If this plugin is already installed, this is the shortest path.
97
+
98
+ 1. Open **Settings → Vision Toolkit** in DSH Web.
99
+ 2. Enter these values under Vision service:
100
+
101
+ | Field | Value |
102
+ |---|---|
103
+ | API protocol | `OpenAI Chat Completions` |
104
+ | Base URL | `https://api.groq.com/openai/v1` |
105
+ | Model | `qwen/qwen3.6-27b` |
106
+ | API key | Paste the newly created `gsk_...` key |
107
+
108
+ 3. Click **Save and apply**. The key is stored in DSH Credentials and its full value is not displayed again in Settings.
109
+ 4. Click **Test vision model**. This sends the plugin's bundled diagnostic image and verifies a real multimodal request rather than only checking `/models` connectivity.
110
+ 5. After the test succeeds, paste an image into a new or existing session and ask a focused question, for example:
111
+
112
+ ```text
113
+ Inspect this screenshot. Transcribe the complete error first, then explain the most likely cause.
114
+ ```
115
+
116
+ The same provider can be configured in a Profile patch. Keep the key in a DSH Credential or environment variable rather than writing it into YAML:
117
+
118
+ ```yaml
119
+ - id: vision-toolkit
120
+ config:
121
+ provider:
122
+ protocol: openai
123
+ baseUrl: https://api.groq.com/openai/v1
124
+ model: qwen/qwen3.6-27b
125
+ credential: GROQ_API_KEY
126
+ ```
127
+
128
+ ## 5. Analyze a remote image with cURL
129
+
130
+ The following request uses Groq's OpenAI Chat Completions-compatible endpoint. Replace the example URL with your own publicly accessible image URL:
131
+
132
+ ```sh
133
+ curl https://api.groq.com/openai/v1/chat/completions \
134
+ -H "Authorization: Bearer $GROQ_API_KEY" \
135
+ -H "Content-Type: application/json" \
136
+ -d '{
137
+ "model": "qwen/qwen3.6-27b",
138
+ "messages": [{
139
+ "role": "user",
140
+ "content": [
141
+ {"type": "text", "text": "Describe the main content of this image and transcribe all visible text."},
142
+ {"type": "image_url", "image_url": {
143
+ "url": "https://upload.wikimedia.org/wikipedia/commons/f/f2/LPU-v1-die.jpg"
144
+ }}
145
+ ]
146
+ }],
147
+ "temperature": 0.2,
148
+ "max_completion_tokens": 1024
149
+ }'
150
+ ```
151
+
152
+ The model's answer is returned at `choices[0].message.content`.
153
+
154
+ ## 6. Analyze a local image with Python
155
+
156
+ This example reads a local image and converts it to a Base64 Data URL. Use `uv` to install the Groq SDK temporarily without modifying system Python:
157
+
158
+ ```python
159
+ # recognize.py
160
+ import base64
161
+ import mimetypes
162
+ from pathlib import Path
163
+
164
+ from groq import Groq
165
+
166
+ image_path = Path("screenshot.png")
167
+ mime_type = mimetypes.guess_type(image_path.name)[0] or "image/png"
168
+ image_base64 = base64.b64encode(image_path.read_bytes()).decode("ascii")
169
+ data_url = f"data:{mime_type};base64,{image_base64}"
170
+
171
+ client = Groq() # Reads GROQ_API_KEY automatically.
172
+ response = client.chat.completions.create(
173
+ model="qwen/qwen3.6-27b",
174
+ messages=[{
175
+ "role": "user",
176
+ "content": [
177
+ {"type": "text", "text": "Analyze this screenshot: run OCR first, then identify the most important anomaly."},
178
+ {"type": "image_url", "image_url": {"url": data_url}},
179
+ ],
180
+ }],
181
+ temperature=0.2,
182
+ max_completion_tokens=1024,
183
+ )
184
+
185
+ print(response.choices[0].message.content)
186
+ ```
187
+
188
+ Run it with:
189
+
190
+ ```sh
191
+ uv run --with groq python recognize.py
192
+ ```
193
+
194
+ Base64 makes the request larger than the original file. If the request approaches the 20 MB limit, resize or compress the image first, or use an HTTPS image URL that the model can access.
195
+
196
+ ## 7. Troubleshooting
197
+
198
+ ### `401 Invalid API Key`
199
+
200
+ - Confirm that the entire `gsk_...` key was copied.
201
+ - Do not include extra spaces, literal quote characters, or line breaks in the environment variable.
202
+ - If the key was exposed publicly, delete it and create a replacement.
203
+
204
+ ### `404` or `model not found`
205
+
206
+ - The model ID must be `qwen/qwen3.6-27b`.
207
+ - The model is currently in Preview. If Groq changes its availability, check the official model page and the models currently shown in Groq Console.
208
+
209
+ ### `413` or an oversized image error
210
+
211
+ - Base64 input has a lower size limit than URL input; resize or compress the image.
212
+ - Do not place too many images in one request; the Qwen3.6-27B model page currently limits a request to three images.
213
+
214
+ ### `429 Too Many Requests`
215
+
216
+ - The Free Plan has reached a per-minute, token, or daily limit.
217
+ - Inspect the rate-limit response headers and retry after capacity resets.
218
+
219
+ ### The model describes the image but misses the task
220
+
221
+ Make the request specific, for example:
222
+
223
+ ```text
224
+ Do not give a generic description. Complete only these three tasks:
225
+ 1. Transcribe the text inside the red error box exactly;
226
+ 2. Report the error box's approximate location in the original image;
227
+ 3. Infer the most likely cause from the surrounding interface.
228
+ ```
229
+
230
+ ## Official references
231
+
232
+ - [Groq Quickstart](https://console.groq.com/docs/quickstart)
233
+ - [Groq API Keys](https://console.groq.com/keys)
234
+ - [Qwen3.6-27B model page](https://console.groq.com/docs/model/qwen/qwen3.6-27b)
235
+ - [Groq Images and Vision](https://console.groq.com/docs/vision)
236
+ - [Groq Rate Limits](https://console.groq.com/docs/rate-limits)
@@ -0,0 +1,236 @@
1
+ # 免费获取 Groq API Key,并用 Qwen3.6-27B 识图
2
+
3
+ [English](groq-qwen3.6-vision.md) | **中文**
4
+
5
+ 这篇教程完成两件事:
6
+
7
+ 1. 注册 GroqCloud 的 Free Plan,并创建一个 Groq API Key。
8
+ 2. 在 DSH Vision Toolkit 或普通代码中调用 `qwen/qwen3.6-27b` 分析图片。
9
+
10
+ > 截至 2026-08-17,Groq 官方模型页将 Qwen3.6-27B 标记为 Preview,支持文本和图片输入。Free Plan 有速率和每日额度限制,具体数值可能调整,请以 [Groq Rate Limits](https://console.groq.com/docs/rate-limits) 和 [Qwen3.6-27B 模型页](https://console.groq.com/docs/model/qwen/qwen3.6-27b) 为准。
11
+
12
+ ## 1. 注册免费的 GroqCloud 账号
13
+
14
+ 打开 [GroqCloud Console](https://console.groq.com/)。可以使用 Google、GitHub、SSO 或邮箱注册/登录。
15
+
16
+ <p align="center">
17
+ <img src="assets/groq-console-home.png" width="92%" alt="GroqCloud Console 登录和注册页面" />
18
+ </p>
19
+
20
+ 完成注册后即可先使用 Free Plan,不需要为本教程购买付费额度。免费额度不是无限量服务;超出当前限制时,接口会返回 `429 Too Many Requests`。
21
+
22
+ 截至 2026-08-17,官方 Free Plan 表中 Qwen3.6-27B 的基础限制为 `30 RPM`(每分钟请求数)、`1K RPD`(每日请求数)、`8K TPM`(每分钟 Token 数)和 `200K TPD`(每日 Token 数)。账号的实际限制以 Groq Console 的 Limits 页面为准。
23
+
24
+ ## 2. 创建并保存 API Key
25
+
26
+ 登录后打开顶部的 **API Keys**,或直接访问 [Groq API Keys](https://console.groq.com/keys)。未登录时会先看到下面的登录页面:
27
+
28
+ <p align="center">
29
+ <img src="assets/groq-console-keys-login.png" width="92%" alt="Groq API Keys 页面要求登录" />
30
+ </p>
31
+
32
+ 在 API Keys 页面中:
33
+
34
+ 1. 点击 **Create API Key**。
35
+ 2. 给密钥填写一个容易辨认的名称,例如 `dsh-vision-toolkit`。
36
+ 3. 确认创建。
37
+ 4. 立即复制以 `gsk_` 开头的密钥,并保存到密码管理器或 DSH Credential 中。
38
+
39
+ Groq 官方 Quickstart 也把“创建 API Key”和“通过环境变量保存密钥”放在最前面:
40
+
41
+ <p align="center">
42
+ <img src="assets/groq-docs-quickstart.png" width="88%" alt="Groq Quickstart 中创建和设置 API Key 的说明" />
43
+ </p>
44
+
45
+ API Key 通常只在创建后完整显示一次。不要把它粘贴到 README、聊天记录、截图、Git 提交或前端代码中。
46
+
47
+ ### 在终端中设置密钥
48
+
49
+ macOS / Linux:
50
+
51
+ ```sh
52
+ export GROQ_API_KEY="gsk_your_key_here"
53
+ ```
54
+
55
+ Windows PowerShell(只对当前窗口生效):
56
+
57
+ ```powershell
58
+ $env:GROQ_API_KEY = "gsk_your_key_here"
59
+ ```
60
+
61
+ 确认变量已经存在,但不要打印完整密钥:
62
+
63
+ ```sh
64
+ test -n "$GROQ_API_KEY" && echo "GROQ_API_KEY is set"
65
+ ```
66
+
67
+ ## 3. 确认模型名和视觉能力
68
+
69
+ Groq API 中必须使用完整模型 ID:
70
+
71
+ ```text
72
+ qwen/qwen3.6-27b
73
+ ```
74
+
75
+ 不要写成 `qwen3.6-27b`、`Qwen3.6-27B` 或只写 `27b`。模型页会同时显示图片输入和 Vision 能力:
76
+
77
+ <p align="center">
78
+ <img src="assets/groq-docs-qwen3.6.png" width="92%" alt="Groq Qwen3.6-27B 模型页显示文本和图片输入及 Vision 能力" />
79
+ </p>
80
+
81
+ Groq 模型页列出的主要图片限制是:
82
+
83
+ | 项目 | 限制 |
84
+ |---|---:|
85
+ | 单个图片文件 | 最大 20 MB |
86
+ | 单次请求图片数 | 最多 3 张 |
87
+
88
+ Groq 的通用视觉文档当前写的是最多 5 张图片,但 Qwen3.6-27B 的模型专页写的是最多 3 张。这里按模型专页的更严格限制执行,避免请求被拒绝。
89
+
90
+ <p align="center">
91
+ <img src="assets/groq-docs-vision.png" width="88%" alt="Groq Images and Vision 文档中的模型、限制和图片调用示例" />
92
+ </p>
93
+
94
+ ## 4. 在 DSH Vision Toolkit 中使用
95
+
96
+ 如果已经安装本插件,这是最短路径。
97
+
98
+ 1. 打开 DSH Web 的 **设置 → 视觉工具**。
99
+ 2. 在“视觉服务”中填写:
100
+
101
+ | 字段 | 值 |
102
+ |---|---|
103
+ | API 协议 | `OpenAI Chat Completions` |
104
+ | 服务地址 | `https://api.groq.com/openai/v1` |
105
+ | 模型名称 | `qwen/qwen3.6-27b` |
106
+ | API 密钥 | 粘贴刚创建的 `gsk_...` 密钥 |
107
+
108
+ 3. 点击 **保存并应用**。密钥会保存到 DSH Credentials,设置页面以后不会回显完整内容。
109
+ 4. 点击 **测试视觉模型**。这个按钮会发送插件自带的诊断图片,验证的是真实多模态请求,而不只是 `/models` 连通性。
110
+ 5. 测试成功后,新建或继续一个会话,粘贴图片并直接提问,例如:
111
+
112
+ ```text
113
+ 看一下这张截图,先完整抄出报错信息,再解释最可能的原因。
114
+ ```
115
+
116
+ 也可以在 Profile patch 中配置相同的提供方。密钥本身仍应由 DSH Credential 或环境变量提供,不要写进 YAML:
117
+
118
+ ```yaml
119
+ - id: vision-toolkit
120
+ config:
121
+ provider:
122
+ protocol: openai
123
+ baseUrl: https://api.groq.com/openai/v1
124
+ model: qwen/qwen3.6-27b
125
+ credential: GROQ_API_KEY
126
+ ```
127
+
128
+ ## 5. 用 cURL 直接识别网络图片
129
+
130
+ 下面的请求使用 Groq 的 OpenAI Chat Completions 兼容接口。把示例图片 URL 换成你自己的公开图片地址:
131
+
132
+ ```sh
133
+ curl https://api.groq.com/openai/v1/chat/completions \
134
+ -H "Authorization: Bearer $GROQ_API_KEY" \
135
+ -H "Content-Type: application/json" \
136
+ -d '{
137
+ "model": "qwen/qwen3.6-27b",
138
+ "messages": [{
139
+ "role": "user",
140
+ "content": [
141
+ {"type": "text", "text": "请描述图片中的主要内容,并逐字抄出可见文字。"},
142
+ {"type": "image_url", "image_url": {
143
+ "url": "https://upload.wikimedia.org/wikipedia/commons/f/f2/LPU-v1-die.jpg"
144
+ }}
145
+ ]
146
+ }],
147
+ "temperature": 0.2,
148
+ "max_completion_tokens": 1024
149
+ }'
150
+ ```
151
+
152
+ 成功后,模型回答位于 `choices[0].message.content`。
153
+
154
+ ## 6. 用 Python 识别本地图片
155
+
156
+ 下面的例子读取本地图片并转换成 Base64 Data URL。推荐使用 `uv` 临时安装 Groq SDK,不污染系统 Python:
157
+
158
+ ```python
159
+ # recognize.py
160
+ import base64
161
+ import mimetypes
162
+ from pathlib import Path
163
+
164
+ from groq import Groq
165
+
166
+ image_path = Path("screenshot.png")
167
+ mime_type = mimetypes.guess_type(image_path.name)[0] or "image/png"
168
+ image_base64 = base64.b64encode(image_path.read_bytes()).decode("ascii")
169
+ data_url = f"data:{mime_type};base64,{image_base64}"
170
+
171
+ client = Groq() # 自动读取 GROQ_API_KEY
172
+ response = client.chat.completions.create(
173
+ model="qwen/qwen3.6-27b",
174
+ messages=[{
175
+ "role": "user",
176
+ "content": [
177
+ {"type": "text", "text": "分析这张截图:先做 OCR,再指出最重要的异常。"},
178
+ {"type": "image_url", "image_url": {"url": data_url}},
179
+ ],
180
+ }],
181
+ temperature=0.2,
182
+ max_completion_tokens=1024,
183
+ )
184
+
185
+ print(response.choices[0].message.content)
186
+ ```
187
+
188
+ 运行:
189
+
190
+ ```sh
191
+ uv run --with groq python recognize.py
192
+ ```
193
+
194
+ Base64 会让请求体积比原文件更大。如果请求接近 20 MB 上限,请先缩小或压缩图片,或者改用模型能够访问的 HTTPS 图片 URL。
195
+
196
+ ## 7. 常见问题
197
+
198
+ ### `401 Invalid API Key`
199
+
200
+ - 确认复制的是完整的 `gsk_...` 密钥。
201
+ - 环境变量中不要包含多余空格、引号内容或换行。
202
+ - 如果密钥曾经出现在公开位置,删除旧密钥并重新创建。
203
+
204
+ ### `404` 或 `model not found`
205
+
206
+ - 模型名必须是 `qwen/qwen3.6-27b`。
207
+ - 该模型目前属于 Preview;如果 Groq 后续调整可用性,请查看官方模型页和 Groq Console 中当前可选模型。
208
+
209
+ ### `413` 或图片过大
210
+
211
+ - Base64 图片限制比 URL 图片严格;先缩小尺寸或压缩质量。
212
+ - 不要把大量图片塞进一个请求;按 Qwen3.6-27B 模型专页的限制,单次最多 3 张。
213
+
214
+ ### `429 Too Many Requests`
215
+
216
+ - Free Plan 已达到分钟、Token 或每日限制。
217
+ - 查看响应头中的速率限制信息,等待额度恢复后重试。
218
+
219
+ ### 模型只描述图片,没有回答重点
220
+
221
+ 把任务写具体,例如:
222
+
223
+ ```text
224
+ 不要泛泛描述。请只完成三件事:
225
+ 1. 逐字抄出红色错误框里的文字;
226
+ 2. 返回错误框在原图中的大致位置;
227
+ 3. 根据界面上下文判断最可能的原因。
228
+ ```
229
+
230
+ ## 官方资料
231
+
232
+ - [Groq Quickstart](https://console.groq.com/docs/quickstart)
233
+ - [Groq API Keys](https://console.groq.com/keys)
234
+ - [Qwen3.6-27B 模型页](https://console.groq.com/docs/model/qwen/qwen3.6-27b)
235
+ - [Groq Images and Vision](https://console.groq.com/docs/vision)
236
+ - [Groq Rate Limits](https://console.groq.com/docs/rate-limits)
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write dsh-vision-toolkit/docs/python-runtime.md
5
+ python-runtime.md: d2071e9ffbffe97d44c5708193e24ee3eabb50b1
6
+ python-runtime.zh.md: 0ef2e984b564b5436424fbca70262e0b9c59aed9