@oneciel-ai/claude-any 0.1.24

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 (60) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +9 -0
  3. package/README.md +435 -0
  4. package/claude-any-menu.py +1851 -0
  5. package/claude-any-tool-guard.py +440 -0
  6. package/claude_any.py +6039 -0
  7. package/docs/README.ja.md +372 -0
  8. package/docs/README.ko.md +373 -0
  9. package/docs/README.zh.md +352 -0
  10. package/docs/assets/claude-any-base-url.en.png +0 -0
  11. package/docs/assets/claude-any-base-url.ja.png +0 -0
  12. package/docs/assets/claude-any-base-url.ko.png +0 -0
  13. package/docs/assets/claude-any-base-url.png +0 -0
  14. package/docs/assets/claude-any-base-url.zh.png +0 -0
  15. package/docs/assets/claude-any-demo.en.gif +0 -0
  16. package/docs/assets/claude-any-demo.en.mp4 +0 -0
  17. package/docs/assets/claude-any-demo.gif +0 -0
  18. package/docs/assets/claude-any-demo.ja.gif +0 -0
  19. package/docs/assets/claude-any-demo.ja.mp4 +0 -0
  20. package/docs/assets/claude-any-demo.ko.gif +0 -0
  21. package/docs/assets/claude-any-demo.ko.mp4 +0 -0
  22. package/docs/assets/claude-any-demo.mp4 +0 -0
  23. package/docs/assets/claude-any-demo.zh.gif +0 -0
  24. package/docs/assets/claude-any-demo.zh.mp4 +0 -0
  25. package/docs/assets/claude-any-main.en.png +0 -0
  26. package/docs/assets/claude-any-main.ja.png +0 -0
  27. package/docs/assets/claude-any-main.ko.png +0 -0
  28. package/docs/assets/claude-any-main.png +0 -0
  29. package/docs/assets/claude-any-main.zh.png +0 -0
  30. package/docs/assets/claude-any-model.en.png +0 -0
  31. package/docs/assets/claude-any-model.ja.png +0 -0
  32. package/docs/assets/claude-any-model.ko.png +0 -0
  33. package/docs/assets/claude-any-model.png +0 -0
  34. package/docs/assets/claude-any-model.zh.png +0 -0
  35. package/docs/assets/claude-any-nvidia-nim.gif +0 -0
  36. package/docs/assets/claude-any-ollama-cloud.gif +0 -0
  37. package/docs/assets/claude-any-options.en.png +0 -0
  38. package/docs/assets/claude-any-options.ja.png +0 -0
  39. package/docs/assets/claude-any-options.ko.png +0 -0
  40. package/docs/assets/claude-any-options.png +0 -0
  41. package/docs/assets/claude-any-options.zh.png +0 -0
  42. package/docs/assets/claude-any-provider.en.png +0 -0
  43. package/docs/assets/claude-any-provider.ja.png +0 -0
  44. package/docs/assets/claude-any-provider.ko.png +0 -0
  45. package/docs/assets/claude-any-provider.png +0 -0
  46. package/docs/assets/claude-any-provider.zh.png +0 -0
  47. package/docs/assets/claude-any-test.en.png +0 -0
  48. package/docs/assets/claude-any-test.ja.png +0 -0
  49. package/docs/assets/claude-any-test.ko.png +0 -0
  50. package/docs/assets/claude-any-test.png +0 -0
  51. package/docs/assets/claude-any-test.zh.png +0 -0
  52. package/docs/github-descriptions.md +235 -0
  53. package/docs/manual.md +496 -0
  54. package/install.ps1 +24 -0
  55. package/install.sh +19 -0
  56. package/npm-bin/claude-any-stop.js +6 -0
  57. package/npm-bin/claude-any.js +5 -0
  58. package/npm-bin/claude-anyctl.js +5 -0
  59. package/npm-bin/run-claude-any.js +51 -0
  60. package/package.json +45 -0
@@ -0,0 +1,352 @@
1
+ # Claude Any
2
+
3
+ | [English](../README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | 中文 |
4
+ | --- | --- | --- | --- |
5
+
6
+ > ## 🚀 用免费/低成本 LLM 获取完整的 Claude Code 体验
7
+ >
8
+ > - **免费** — [NVIDIA hosted NIM](https://build.nvidia.com/)(qwen3-coder-480b、gpt-oss 等),通过 API Catalog 使用。
9
+ > - **低成本** — [Ollama Cloud](https://ollama.com/cloud) 提供 GLM、Qwen、DeepSeek 等开源权重模型,价格远低于前沿模型。
10
+ > - **免费 + 本地** — 在自己的 GPU 上使用 [Ollama](https://ollama.com/) 或 [vLLM](https://github.com/vllm-project/vllm),完全离线。
11
+ >
12
+ > 在 Claude Code 启动**之前**,通过控制台菜单选择 provider、模型、Base URL、API 密钥、流式行为以及 LLM 选项。Claude Code 本体保持原样运行 —— 所有原生工具、slash 命令和工作流都不受影响。
13
+
14
+ ### 演示
15
+
16
+ ![NVIDIA hosted NIM 驱动 Claude Code(deepseek-4-flash)](assets/claude-any-nvidia-nim.gif)
17
+
18
+ NVIDIA hosted NIM(deepseek-4-flash)通过 claude-any 路由器驱动 Claude Code。  [完整 mp4 ⤓](https://github.com/OneCielAI/claude-any/raw/main/demo/claude-any-nvidia-nim.mp4)
19
+
20
+ ![Ollama Cloud 经由 claude-any 路由器(glm-5.1)](assets/claude-any-ollama-cloud.gif)
21
+
22
+ Ollama Cloud(glm-5.1)在启用 SSE 单词边界分块的情况下通过 claude-any 路由器流式传输。  [完整 mp4 ⤓](https://github.com/OneCielAI/claude-any/raw/main/demo/claude-any-ollama-cloud.mp4)
23
+
24
+ ---
25
+
26
+ Claude Any 是 Claude Code 的启动前供应商选择器。它可以在 Claude Code 启动前
27
+ 选择 Anthropic、Ollama、Ollama Cloud、vLLM、NVIDIA hosted 或 self-hosted
28
+ NIM,并把普通 Claude Code 参数原样传递。
29
+
30
+ Credits: One Ciel LLC
31
+
32
+ 当前版本: `0.1.24`
33
+
34
+ ## 为什么存在
35
+
36
+ 即使使用 Claude Code 的最高套餐,长时间工作时也可能遇到 token 不足,或者
37
+ 必须等待下一轮额度才能继续会话。Claude Any 不是为了替代 Claude Code,而是
38
+ 为了让工作不中断。NVIDIA NIM、Ollama Cloud、vLLM、本地 Ollama 等供应商可
39
+ 用于摘要、调研、日志、简单编码和后台委派任务。
40
+
41
+ 如果供应商提供 Anthropic 兼容 Messages 端点,Claude Any 会优先使用这条
42
+ 路径,以尽量保留 Claude Code 的工具、权限、模型选择和工作流体验。远程供应商
43
+ 无法直接提供的网页搜索能力,则通过独立 MCP 工具补充。
44
+
45
+ 启动前菜单优先考虑控制台和 SSH 工作流。Claude Code 启动前,可以方便地查看
46
+ 和修改供应商、模型、Base URL、API 密钥和选项。
47
+
48
+ macOS 尚未充分测试,但项目主要基于 portable Python 和 shell wrapper。如遇
49
+ 问题请反馈。
50
+
51
+ - D. Yun
52
+
53
+ ## 安装
54
+
55
+ 要求:
56
+
57
+ - Python 3.10+
58
+ - 已安装 Claude Code,并可通过 `claude` 命令运行
59
+ - 只有启用 MCP 网页工具时才需要 Node/npm
60
+
61
+ 当前可直接使用的 GitHub 安装:
62
+
63
+ ```sh
64
+ npm install -g https://github.com/OneCielAI/claude-any.git
65
+ claude-any
66
+ ```
67
+
68
+ 源码安装:
69
+
70
+ ```sh
71
+ git clone https://github.com/OneCielAI/claude-any.git
72
+ cd claude-any
73
+ ./install.sh
74
+ claude-any
75
+ ```
76
+
77
+ Windows PowerShell 源码安装:
78
+
79
+ ```powershell
80
+ git clone https://github.com/OneCielAI/claude-any.git
81
+ cd claude-any
82
+ .\install.ps1
83
+ claude-any
84
+ ```
85
+
86
+ 首次发布到 npm registry 后安装:
87
+
88
+ ```sh
89
+ npm install -g @oneciel-ai/claude-any
90
+ claude-any
91
+ ```
92
+
93
+ 升级:
94
+
95
+ ```sh
96
+ # GitHub 安装,当前推荐方式
97
+ npm install -g https://github.com/OneCielAI/claude-any.git --force
98
+ claude-any version
99
+ ```
100
+
101
+ 要让 `npm update -g @oneciel-ai/claude-any` 正常工作,必须先用同一个 package
102
+ name 发布到 public npm registry。
103
+
104
+ ```sh
105
+ npm login
106
+ npm publish --access public
107
+ npm install -g @oneciel-ai/claude-any
108
+ npm update -g @oneciel-ai/claude-any
109
+ ```
110
+
111
+ 如果使用自动发布,请创建 npm automation token,将它保存为 GitHub repository
112
+ secret `NPM_TOKEN`,然后发布 GitHub Release 或手动运行 `Publish to npm`
113
+ workflow。
114
+
115
+ 版本使用 SemVer。后续发布时,更新 `package.json` 中的 `version`,创建相同
116
+ 版本的 Git tag,例如 `v0.1.1`,再发布 GitHub Release 即可触发 npm publish
117
+ workflow。发布到 registry 之后,可以使用以下命令升级。
118
+
119
+ ```sh
120
+ npm update -g @oneciel-ai/claude-any
121
+ ```
122
+
123
+
124
+ ![Claude Any menu](assets/claude-any-main.zh.png)
125
+
126
+ ## 演示
127
+
128
+ ![Claude Any demo](assets/claude-any-demo.zh.gif)
129
+
130
+ 当前演示展示供应商选择、Base URL、模型选择、LLM 选项和兼容性测试。兼容性
131
+ 测试不仅检查普通文本响应,还会检查必需的 `tool_use` 和 `tool_result` 往返。
132
+
133
+ | 供应商 | Base URL | 模型 | LLM 选项 | 兼容性 |
134
+ | --- | --- | --- | --- | --- |
135
+ | ![Provider](assets/claude-any-provider.zh.png) | ![Base URL](assets/claude-any-base-url.zh.png) | ![Model](assets/claude-any-model.zh.png) | ![Options](assets/claude-any-options.zh.png) | ![Test](assets/claude-any-test.zh.png) |
136
+
137
+ 详细设置、headless 参数和故障排查请看 [manual](manual.md)。演示视频位于
138
+ [assets/claude-any-demo.zh.mp4](assets/claude-any-demo.zh.mp4)。
139
+
140
+ ## 开发故事
141
+
142
+ Claude Any 是通过一系列实际集成测试构建出来的:先尝试供应商切换,然后验证
143
+ 模型发现、API 密钥输入、兼容性测试、网页搜索工具、超时处理,以及 Claude
144
+ Code 的原生行为。最有用的结论是:当供应商提供 Anthropic 兼容 Messages 端点时,
145
+ 这是最干净的集成路径。Ollama、vLLM 和 NIM 都可以提供 Anthropic 兼容路由,
146
+ 这种路径比通用 OpenAI 兼容 chat 路由更能保留 Claude Code 的工具模型。
147
+
148
+ 本地 Ollama 和 vLLM 也在 RTX 5090 与 MSI GB10 级硬件上测试过 Qwen 3.6 27B
149
+ Q4。它可以运行,但速度不应直接与 native Claude Code 或 Codex 比较。对于这类
150
+ 混合后台工作,NVIDIA NIM 和 Ollama Cloud 的一些 hosted/cloud 模型反而比预期
151
+ 更实用。
152
+
153
+ OpenAI 兼容端点被有意排除在 Claude Code 的主要路径之外。在测试中,通过
154
+ generic OpenAI chat 兼容层进行 tool-call 转换时,在 tool parameter、tool
155
+ result、重复调用、retry 和模型选择附近表现得更脆弱。因此 Claude Any 优先
156
+ 使用 native Anthropic 兼容 endpoint,只在需要 provider-specific 适配时使用
157
+ 一个小型 router。
158
+
159
+ 最近的 vLLM 测试说明,服务器端 tool-call parser 必须和模型系列匹配。即使
160
+ vLLM 服务器可连接、`/v1/messages` 可用,只要 `--tool-call-parser` 不匹配,
161
+ Claude Code 也可能无法解析 tool call 并停止。Qwen3-Coder 系列优先使用
162
+ `--enable-auto-tool-choice --tool-call-parser qwen3_xml`;`hermes` 更适合
163
+ Hermes 格式模型或部分较旧的 Qwen tool template。
164
+
165
+ ## 推荐用途
166
+
167
+ 适合速度不是主要瓶颈的后台运维任务,例如 Docker 主机维护、Windows/Linux
168
+ 管理、清理脚本、定期安全检查、日志审查、Windows Event Log 审查、病毒或
169
+ 勒索软件入侵尝试整理、暴力登录尝试审查和报告草稿生成。
170
+
171
+ 它不能替代专业安全产品,但可以帮助管理员把重复检查变成脚本和可读报告。用
172
+ 这种方式可以构建免费或低成本的系统安全看护助手。
173
+
174
+ 例如,可以把“在 Docker 容器中安装 PostgreSQL”或“分析今天的 Docker 日志并
175
+ 通过邮件发送报告”这样的请求转成具体命令、脚本、计划任务和摘要。
176
+
177
+ 一种实用模式是分层监督:小模型负责检测和摘要,大模型负责审核、策略和计划,
178
+ 然后小模型在大模型监督下执行重复任务。
179
+
180
+ ## 主要功能
181
+
182
+ - 英语、韩语、日语、中文 UI 的启动前菜单。
183
+ - 按供应商列出模型,并支持自定义模型输入。
184
+ - 在 Claude Code 聊天输入之外设置 API 密钥。
185
+ - LLM 选项/预设,可配置 context window、output tokens、timeout、sampling 和 native compatibility。
186
+ - 启动前文本、`tool_use`、`tool_result` 兼容性测试。
187
+ - 当 vLLM/NIM 的 `/v1/models` 返回 `max_model_len` 时显示运行时上下文。
188
+ - 面向 SSH 和终端的控制台优先 UI。
189
+ - 有 Anthropic 兼容端点时优先使用 native 路径。
190
+ - 必要时使用 provider-specific router。
191
+ - 为 non-native provider 连接 DuckDuckGo/fetch MCP。
192
+ - 支持 `--ca-provider`、`--ca-model`、`--ca-base-url` 等 headless 参数。
193
+ - Ollama/Ollama Cloud 路由路径的流式代理 — token 到达后立即转发给 Claude Code,
194
+ 不再等待完整响应。
195
+ - 按 provider 的 `stream` on/off 开关和 `stream_word_chunking` 选项,可将文本
196
+ delta 合并到单词边界后再发送,缓解长流式响应中 SSE 分片导致的 tool-call /
197
+ JSON 解析错误。
198
+ - LLM options 菜单会在面板底部以当前语言(英语/韩语/日语/中文)显示高亮行的
199
+ 含义;布尔行(`Stream`、`Stream word chunking`、`Native compatibility`、
200
+ `Think`)按 Enter 即可就地切换。
201
+ - Tool guard hook 覆盖范围扩展到 Claude Code 的全部 hook event(包含
202
+ `WorktreeCreate` / `WorktreeRemove`),解决非 git 工作目录下 Agent isolation
203
+ 因 `Cannot create agent worktree: not in a git repository...` 而失败的问题。
204
+ - 配置文件缓存 — 路由器将设置缓存到内存,仅在文件修改时重新读取,
205
+ 减少了每次请求的磁盘 I/O 开销。
206
+
207
+ ## 更新日志
208
+
209
+ ### 0.1.24
210
+
211
+ - **首次正式发布到 npm registry**: 在正确的 scope `@oneciel-ai/claude-any` 下发布。此前的 0.1.x 版本从未上传到 registry,从该版本起可以直接通过 `npm install -g @oneciel-ai/claude-any` 安装。
212
+
213
+ ### 0.1.23
214
+
215
+ - **流式开关**: 每个 non-Anthropic provider 新增 `stream_enabled` 开关(在 LLM
216
+ options 菜单、`claude-anyctl ollama-options` / `provider-options`、以及 headless
217
+ 参数中都可用)。关闭后路由器会对上游强制 `stream:false`,把完整响应一次性
218
+ 返回给 Claude Code — 这是流式分片破坏 tool-call/JSON 解析时的回避方案。
219
+ - **单词边界流式**: 新增 `stream_word_chunking` 选项。将 SSE 文本 delta 在
220
+ 空白/单词边界处合并后再发送。Ollama 路由路径和 native 透传路径(vLLM、NVIDIA
221
+ hosted、self-hosted NIM)都已实现。工具 delta 和非文本 SSE 事件原样透传。
222
+ - **完整 hook 处理**: `install_tool_guard_hooks` 现在会注册 Claude Code 的全部
223
+ hook event(PreToolUse、PostToolUse、PostToolUseFailure、PostToolBatch、
224
+ PermissionRequest、PermissionDenied、SessionStart/End、Setup、UserPromptSubmit/
225
+ Expansion、Stop、StopFailure、InstructionsLoaded、ConfigChange、CwdChanged、
226
+ Notification、SubagentStart/Stop、TeammateIdle、TaskCreated、TaskCompleted、
227
+ PreCompact、PostCompact、WorktreeCreate、WorktreeRemove、Elicitation、
228
+ ElicitationResult)。WorktreeCreate 处理器返回 `worktreePath = base_path`,
229
+ 因此非 git 目录中 Agent isolation 也能正常工作。
230
+ - **Windows hook 兼容性**: `shell_command_string` 现在在 Windows 上输出正斜杠和
231
+ POSIX 引用,避免 Claude Code 的 sh hook 执行器把 `C:\Users\...` 中的反斜杠
232
+ 当作转义字符吞掉。
233
+ - **LLM options UX**: 在面板底部以用户语言显示高亮行的解释。布尔切换
234
+ (`Stream`、`Stream word chunking`、`Native compatibility`、`Think`)按 Enter
235
+ 原地切换 — 无需输入提示。
236
+
237
+ ### 0.1.22
238
+
239
+ - **Headless 手册扩展**: 增加面向自动化和远程服务器的 headless setup / launch / test / passthrough / cleanup 实用示例。
240
+
241
+ ### 0.1.21
242
+
243
+ - **服务生命周期文档**: 明确说明 Claude Any 会在启动时只启动当前 provider 所需的 router/proxy,`claude-any stop` 是显式清理命令。
244
+
245
+ ### 0.1.20
246
+
247
+ - **NVIDIA hosted quick test**: `auto` 模式现在对 NVIDIA hosted provider 使用 text-only quick test,避免菜单检查中较慢或不稳定的 tool_use 请求。text + tool_use 使用 `smoke`,完整 text/tool_use/tool_result round trip 使用 `full`。
248
+ - **菜单测试超时**: 终端菜单现在运行 `claude-any test 60 auto`,让 hosted model 的 pre-launch test 更快结束。
249
+
250
+ ### 0.1.19
251
+
252
+ - **更快的兼容性测试**: `claude-any test` 现在支持 `auto`、`smoke`、`full` 模式。
253
+ - **菜单默认测试提速**: 终端菜单现在运行 `claude-any test 120 auto`。NVIDIA hosted 兼容性检查会更快,完整验证仍可通过 `claude-any test 180 full` 使用。
254
+
255
+ ### 0.1.18
256
+
257
+ - **NVIDIA hosted 临时故障诊断**: 兼容性测试现在会将 `RemoteDisconnected`、connection reset、502/503/504 响应标记为 NVIDIA hosted backend/API Catalog 的临时 upstream 故障。
258
+ - **NVIDIA proxy 清理改进**: `claude-any stop` 现在也会匹配 `nvd-claude-proxy` 可执行进程,从而更可靠地清理 stale proxy session。
259
+
260
+ ### 0.1.17
261
+
262
+ - **菜单兼容性测试超时**: 终端菜单现在以明确的 180 秒限制运行兼容性测试,并在超过 hard limit 时停止子进程,避免较慢的 hosted model 让菜单看起来无限等待。
263
+
264
+ ### 0.1.16
265
+
266
+ - **NVIDIA hosted proxy 启动修复**: 在 fallback 到 `python -m nvd_claude_proxy.main` 之前,先检测并启动已安装的 `nvd-claude-proxy`/`ncp` 可执行文件。支持 proxy 通过 uv tool 安装、命令可用但无法从 Claude Any 的 Python 解释器 import 的环境。
267
+
268
+ ### 0.1.15
269
+
270
+ - **Ollama/Ollama Cloud 工具调用流式修复**: 流式工具调用现在使用连续的 Anthropic SSE content block index 和 `input_json_delta` payload 输出,避免 Claude Code 将 malformed streamed tool-use block 拒绝为 `Invalid tool parameters`。
271
+ - **Tool guard 自动安装**: 非 Anthropic provider 启动时会将 Claude Any tool guard 合并到 `~/.claude/settings.json`,在执行前规范化生成的工具输入。
272
+ - **工具调用诊断日志**: 路由器侧工具调用记录到 `~/.config/claude-any/tool-calls.jsonl`,Claude Code hook 输入记录到 `~/.claude/claude-any-tool-guard/tool-events.jsonl`。
273
+ - **工具输入规范化**: guard 会将 `path` 映射为 `file_path`、`cmd` 映射为 `command`、`query` 映射为 `pattern`,并在缺少必填字段时返回明确提示。
274
+
275
+ ### 0.1.14
276
+
277
+ - **SSH/终端方向键兼容性**: 重写 `read_menu_key()`,加入 ANSI escape sequence 解析器,并将 raw 终端设置移至 `portable_select()`,使菜单循环期间终端始终维持 raw 模式。解决按键间隙 `ECHO` 恢复导致转义序列泄漏到屏幕的问题。方向键、Home、End 键现可在 SSH 会话中稳定工作。
278
+ - **测试超时**: 将兼容性测试默认超时从 60 秒延长至 120 秒,以适配较慢的云供应商。
279
+ - **Ollama Cloud 兼容性测试修复**: 在兼容性测试请求中添加 `"stream": false`,使路由器向 Ollama Cloud 请求单个 JSON 响应而非 SSE 流式传输,从而解决 `post_json` 在收集所有 SSE 分片时超时的问题。
280
+
281
+ ### 0.1.13
282
+
283
+ - **Ollama 流式代理**: 路由器现在以 Anthropic SSE 格式实时流式传输 Ollama/Ollama Cloud 响应,替代了之前缓冲完整响应再转发的方式。
284
+ - **配置缓存**: `load_config()` 将配置文件缓存到内存,仅在文件修改时间变化时重新读取。消除了路由器每个请求中重复的磁盘读取和 JSON 解析。
285
+ - **Token 估算缓存**: `estimate_tokens()` 接受可选的缓存字典,避免单个请求中的冗余 `json.dumps()` 调用。`ollama_chat_request` 和 `cap_output_tokens_for_context` 共享同一缓存。
286
+
287
+ ### 0.1.12
288
+
289
+ - 刷新文档和演示素材。
290
+
291
+ ### 0.1.11
292
+
293
+ - 验证工具调用兼容性。
294
+
295
+ ### 0.1.10
296
+
297
+ - 在测试中显示运行时上下文。
298
+
299
+ ### 0.1.9
300
+
301
+ - 将预设上限限制到服务器上下文。
302
+
303
+ ### 0.1.8
304
+
305
+ - 本地化 LLM 预设。
306
+
307
+ ## 供应商说明
308
+
309
+ | Provider | Mode | Notes |
310
+ | --- | --- | --- |
311
+ | Anthropic | Native Claude Code | 使用 Claude 登录或 Anthropic API key。 |
312
+ | Ollama | Native 优先,必要时 router | 本地 Ollama 通常不需要 API key;通过本地 Ollama 使用 `:cloud` 模型时,需要在 Ollama host 上 `ollama signin`。 |
313
+ | Ollama Cloud | Router | 直接调用 `https://ollama.com/api`,需要 Ollama API key。 |
314
+ | vLLM | Native Anthropic-compatible endpoint | 使用 Anthropic 兼容 `/v1/messages` endpoint,并让 `--tool-call-parser` 匹配模型系列。 |
315
+ | NVIDIA hosted | Router/proxy | 通过 compatibility 路径使用 NVIDIA hosted API。 |
316
+ | self-hosted NIM | Native Anthropic-compatible endpoint | 使用 self-hosted NIM 的 Anthropic 兼容 endpoint。 |
317
+
318
+ ## 服务生命周期
319
+
320
+ Claude Any 不会一直运行所有可能的 backend helper。正常生命周期如下:
321
+
322
+ - 启动前,可用 `claude-any stop` 清理受管理的 router/proxy 进程。
323
+ - `claude-any` 启动 Claude Code 时,只启动当前所选 provider 需要的服务。
324
+ - Ollama/Ollama Cloud router mode 使用 `127.0.0.1:8799` 上的 Claude Any router。
325
+ - NVIDIA hosted router mode 使用 `127.0.0.1:8799` 上的 Claude Any router,并且只在
326
+ 该 provider 需要时启动 `127.0.0.1:8788` 上的 `nvd-claude-proxy`。
327
+ - 从 NVIDIA hosted 切换到其他 provider 时,不需要让 NVIDIA proxy 一直运行。新的
328
+ test 或 launch 之前,请用 `claude-any stop` 清理 stale session。
329
+
330
+ 这样 Claude Code 可以始终使用稳定的 Claude Any 入口,同时 provider-specific helper
331
+ 只在需要时启动。
332
+
333
+ 为 Claude Code 启动 Qwen3-Coder vLLM 的示例:
334
+
335
+ ```sh
336
+ vllm serve Qwen/Qwen3-Coder-30B-A3B-Instruct \
337
+ --host 0.0.0.0 \
338
+ --port 8000 \
339
+ --served-model-name qwen3-coder-30b \
340
+ --max-model-len 65536 \
341
+ --enable-auto-tool-choice \
342
+ --tool-call-parser qwen3_xml
343
+ ```
344
+
345
+ 链接:
346
+
347
+ - vLLM Claude Code integration: https://docs.vllm.ai/en/latest/serving/integrations/claude_code/
348
+ - vLLM tool calling: https://docs.vllm.ai/en/stable/features/tool_calling/
349
+
350
+ ## 许可证
351
+
352
+ MIT。请参阅 [LICENSE](../LICENSE)。
Binary file
Binary file
Binary file
Binary file
Binary file