@musistudio/claude-code-router 1.0.29 → 1.0.31
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 +31 -1
- package/README_zh.md +28 -1
- package/dist/cli.js +5391 -5222
- package/dist/index.html +34 -35
- package/docker-compose.yml +3 -6
- package/dockerfile +16 -4
- package/package.json +2 -2
- package/scripts/build.js +0 -35
- package/ui/PROJECT.md +0 -23
- package/ui/README.md +0 -69
- package/ui/components.json +0 -21
- package/ui/config.example.json +0 -177
- package/ui/dist/index.html +0 -223
- package/ui/dist/vite.svg +0 -1
- package/ui/eslint.config.js +0 -23
- package/ui/index.html +0 -13
- package/ui/package-lock.json +0 -5033
- package/ui/package.json +0 -53
- package/ui/pnpm-lock.yaml +0 -3459
- package/ui/public/vite.svg +0 -1
- package/ui/tsconfig.app.json +0 -26
- package/ui/tsconfig.json +0 -26
- package/ui/tsconfig.tsbuildinfo +0 -1
- package/ui/vite.config.ts +0 -16
package/README.md
CHANGED
|
@@ -141,6 +141,16 @@ Here is a comprehensive example:
|
|
|
141
141
|
"enhancetool"
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "aihubmix",
|
|
147
|
+
"api_base_url": "https://aihubmix.com/v1/chat/completions",
|
|
148
|
+
"api_key": "sk-",
|
|
149
|
+
"models": [
|
|
150
|
+
"Z/glm-4.5",
|
|
151
|
+
"claude-opus-4-20250514",
|
|
152
|
+
"gemini-2.5-pro"
|
|
153
|
+
]
|
|
144
154
|
}
|
|
145
155
|
],
|
|
146
156
|
"Router": {
|
|
@@ -168,7 +178,7 @@ ccr code
|
|
|
168
178
|
> ccr restart
|
|
169
179
|
> ```
|
|
170
180
|
|
|
171
|
-
### 4. UI Mode
|
|
181
|
+
### 4. UI Mode (Beta)
|
|
172
182
|
|
|
173
183
|
For a more intuitive experience, you can use the UI mode to manage your configuration:
|
|
174
184
|
|
|
@@ -178,6 +188,11 @@ ccr ui
|
|
|
178
188
|
|
|
179
189
|
This will open a web-based interface where you can easily view and edit your `config.json` file.
|
|
180
190
|
|
|
191
|
+

|
|
192
|
+
|
|
193
|
+
> **Note**: The UI mode is currently in beta. 100% vibe coding: including project initialization, I just created a folder and a project.md document, and all code was generated by ccr + qwen3-coder + gemini(webSearch).
|
|
194
|
+
If you encounter any issues, please submit an issue on GitHub.
|
|
195
|
+
|
|
181
196
|
#### Providers
|
|
182
197
|
|
|
183
198
|
The `Providers` array is where you define the different model providers you want to use. Each provider object requires:
|
|
@@ -243,6 +258,7 @@ Transformers allow you to modify the request and response payloads to ensure com
|
|
|
243
258
|
|
|
244
259
|
**Available Built-in Transformers:**
|
|
245
260
|
|
|
261
|
+
- `Anthropic`:If you use only the `Anthropic` transformer, it will preserve the original request and response parameters(you can use it to connect directly to an Anthropic endpoint).
|
|
246
262
|
- `deepseek`: Adapts requests/responses for DeepSeek API.
|
|
247
263
|
- `gemini`: Adapts requests/responses for Gemini API.
|
|
248
264
|
- `openrouter`: Adapts requests/responses for OpenRouter API.
|
|
@@ -250,6 +266,11 @@ Transformers allow you to modify the request and response payloads to ensure com
|
|
|
250
266
|
- `maxtoken`: Sets a specific `max_tokens` value.
|
|
251
267
|
- `tooluse`: Optimizes tool usage for certain models via `tool_choice`.
|
|
252
268
|
- `gemini-cli` (experimental): Unofficial support for Gemini via Gemini CLI [gemini-cli.js](https://gist.github.com/musistudio/1c13a65f35916a7ab690649d3df8d1cd).
|
|
269
|
+
- `reasoning`: Used to process the `reasoning_content` field.
|
|
270
|
+
- `sampling`: Used to process sampling information fields such as `temperature`, `top_p`, `top_k`, and `repetition_penalty`.
|
|
271
|
+
- `enhancetool`: Adds a layer of error tolerance to the tool call parameters returned by the LLM (this will cause the tool call information to no longer be streamed).
|
|
272
|
+
- `cleancache`: Clears the `cache_control` field from requests.
|
|
273
|
+
- `vertex-gemini`: Handles the Gemini API using Vertex authentication.
|
|
253
274
|
|
|
254
275
|
**Custom Transformers:**
|
|
255
276
|
|
|
@@ -403,6 +424,8 @@ If you find this project helpful, please consider sponsoring its development. Yo
|
|
|
403
424
|
|
|
404
425
|
A huge thank you to all our sponsors for their generous support!
|
|
405
426
|
|
|
427
|
+
|
|
428
|
+
- [AIHubmix](https://aihubmix.com/)
|
|
406
429
|
- @Simon Leischnig
|
|
407
430
|
- [@duanshuaimin](https://github.com/duanshuaimin)
|
|
408
431
|
- [@vrgitadmin](https://github.com/vrgitadmin)
|
|
@@ -440,5 +463,12 @@ A huge thank you to all our sponsors for their generous support!
|
|
|
440
463
|
- [@congzhangzh](https://github.com/congzhangzh)
|
|
441
464
|
- @\*\_
|
|
442
465
|
- @Z\*m
|
|
466
|
+
- @*鑫
|
|
467
|
+
- @c\*y
|
|
468
|
+
- @\*昕
|
|
469
|
+
- [@witsice](https://github.com/witsice)
|
|
470
|
+
- @b\*g
|
|
471
|
+
- @\*亿
|
|
472
|
+
|
|
443
473
|
|
|
444
474
|
(If your name is masked, please contact me via my homepage email to update it with your GitHub username.)
|
package/README_zh.md
CHANGED
|
@@ -137,6 +137,16 @@ npm install -g @musistudio/claude-code-router
|
|
|
137
137
|
"enhancetool"
|
|
138
138
|
]
|
|
139
139
|
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "aihubmix",
|
|
143
|
+
"api_base_url": "https://aihubmix.com/v1/chat/completions",
|
|
144
|
+
"api_key": "sk-",
|
|
145
|
+
"models": [
|
|
146
|
+
"Z/glm-4.5",
|
|
147
|
+
"claude-opus-4-20250514",
|
|
148
|
+
"gemini-2.5-pro"
|
|
149
|
+
]
|
|
140
150
|
}
|
|
141
151
|
],
|
|
142
152
|
"Router": {
|
|
@@ -164,7 +174,7 @@ ccr code
|
|
|
164
174
|
> ccr restart
|
|
165
175
|
> ```
|
|
166
176
|
|
|
167
|
-
### 4. UI 模式
|
|
177
|
+
### 4. UI 模式 (Beta)
|
|
168
178
|
|
|
169
179
|
为了获得更直观的体验,您可以使用 UI 模式来管理您的配置:
|
|
170
180
|
|
|
@@ -174,6 +184,10 @@ ccr ui
|
|
|
174
184
|
|
|
175
185
|
这将打开一个基于 Web 的界面,您可以在其中轻松查看和编辑您的 `config.json` 文件。
|
|
176
186
|
|
|
187
|
+

|
|
188
|
+
|
|
189
|
+
> **注意**: UI 模式目前处于测试阶段。这是一个 100% vibe coding的项目,包括项目的初始化,我只是新建了一个文件夹和一个project.md文档。所有代码均由 ccr + qwen3-coder + gemini(webSearch) 实现。如有问题请提交 issue。
|
|
190
|
+
|
|
177
191
|
#### Providers
|
|
178
192
|
|
|
179
193
|
`Providers` 数组是您定义要使用的不同模型提供商的地方。每个提供商对象都需要:
|
|
@@ -238,6 +252,7 @@ Transformers 允许您修改请求和响应负载,以确保与不同提供商
|
|
|
238
252
|
|
|
239
253
|
**可用的内置 Transformer:**
|
|
240
254
|
|
|
255
|
+
- `Anthropic`: 如果你只使用这一个转换器,则会直接透传请求和响应(你可以用它来接入其他支持Anthropic端点的服务商)。
|
|
241
256
|
- `deepseek`: 适配 DeepSeek API 的请求/响应。
|
|
242
257
|
- `gemini`: 适配 Gemini API 的请求/响应。
|
|
243
258
|
- `openrouter`: 适配 OpenRouter API 的请求/响应。
|
|
@@ -245,6 +260,11 @@ Transformers 允许您修改请求和响应负载,以确保与不同提供商
|
|
|
245
260
|
- `maxtoken`: 设置特定的 `max_tokens` 值。
|
|
246
261
|
- `tooluse`: 优化某些模型的工具使用(通过`tool_choice`参数)。
|
|
247
262
|
- `gemini-cli` (实验性): 通过 Gemini CLI [gemini-cli.js](https://gist.github.com/musistudio/1c13a65f35916a7ab690649d3df8d1cd) 对 Gemini 的非官方支持。
|
|
263
|
+
- `reasoning`: 用于处理 `reasoning_content` 字段。
|
|
264
|
+
- `sampling`: 用于处理采样信息字段,如 `temperature`、`top_p`、`top_k` 和 `repetition_penalty`。
|
|
265
|
+
- `enhancetool`: 对 LLM 返回的工具调用参数增加一层容错处理(这会导致不再流式返回工具调用信息)。
|
|
266
|
+
- `cleancache`: 清除请求中的 `cache_control` 字段。
|
|
267
|
+
- `vertex-gemini`: 处理使用 vertex 鉴权的 gemini api。
|
|
248
268
|
|
|
249
269
|
**自定义 Transformer:**
|
|
250
270
|
|
|
@@ -399,6 +419,7 @@ jobs:
|
|
|
399
419
|
|
|
400
420
|
非常感谢所有赞助商的慷慨支持!
|
|
401
421
|
|
|
422
|
+
- [AIHubmix](https://aihubmix.com/)
|
|
402
423
|
- @Simon Leischnig
|
|
403
424
|
- [@duanshuaimin](https://github.com/duanshuaimin)
|
|
404
425
|
- [@vrgitadmin](https://github.com/vrgitadmin)
|
|
@@ -435,6 +456,12 @@ jobs:
|
|
|
435
456
|
- [@congzhangzh](https://github.com/congzhangzh)
|
|
436
457
|
- @*_
|
|
437
458
|
- @Z\*m
|
|
459
|
+
- @*鑫
|
|
460
|
+
- @c\*y
|
|
461
|
+
- @\*昕
|
|
462
|
+
- [@witsice](https://github.com/witsice)
|
|
463
|
+
- @b\*g
|
|
464
|
+
- @\*亿
|
|
438
465
|
|
|
439
466
|
(如果您的名字被屏蔽,请通过我的主页电子邮件与我联系,以便使用您的 GitHub 用户名进行更新。)
|
|
440
467
|
|