dsh-plugin-litellm-bridge 0.0.0-stage → 2.0.2
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 +165 -2
- package/docs/README.md +716 -0
- package/dsh-plugin-litellm-bridge/README.md +32 -0
- package/dsh-plugin-litellm-bridge/client/index.js +1336 -0
- package/dsh-plugin-litellm-bridge/cordis.patch.yml +27 -0
- package/dsh-plugin-litellm-bridge/icon.svg +12 -0
- package/dsh-plugin-litellm-bridge/lib/assemble-chain.js +193 -0
- package/dsh-plugin-litellm-bridge/lib/config-store.js +290 -0
- package/dsh-plugin-litellm-bridge/lib/gateway-client.js +587 -0
- package/dsh-plugin-litellm-bridge/lib/gateway-supervisor.js +518 -0
- package/dsh-plugin-litellm-bridge/lib/index.js +760 -0
- package/dsh-plugin-litellm-bridge/lib/model-pool.js +248 -0
- package/dsh-plugin-litellm-bridge/lib/probe-log.js +102 -0
- package/dsh-plugin-litellm-bridge/lib/subagent-routing.js +280 -0
- package/dsh-plugin-litellm-bridge/locale/en.json +43 -0
- package/dsh-plugin-litellm-bridge/locale/zh.json +43 -0
- package/dsh-plugin-litellm-bridge/manifest.json +57 -0
- package/package.json +73 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "LiteLLM 网关桥接",
|
|
4
|
+
"description": "配置 LiteLLM 网关地址、按 agent 类型编排 fallback 路由、查看网关调用日志、绑定会话 profile。插件不含任何路由/重试/降级逻辑,全部交由外部网关。"
|
|
5
|
+
},
|
|
6
|
+
"tabs": {
|
|
7
|
+
"gateway": "网关设置",
|
|
8
|
+
"routes": "路由配置",
|
|
9
|
+
"logs": "日志面板",
|
|
10
|
+
"session": "当前会话"
|
|
11
|
+
},
|
|
12
|
+
"gateway": {
|
|
13
|
+
"url": "网关地址",
|
|
14
|
+
"masterKey": "网关 master admin key",
|
|
15
|
+
"fromEnv": "来自 .env 环境变量",
|
|
16
|
+
"test": "测试连通性",
|
|
17
|
+
"save": "保存"
|
|
18
|
+
},
|
|
19
|
+
"routes": {
|
|
20
|
+
"primary": "首选模型",
|
|
21
|
+
"timeout": "超时(毫秒)",
|
|
22
|
+
"fallbacks": "fallback 备选模型(拖拽排序,顺序即降级优先级)",
|
|
23
|
+
"saveAndReload": "保存并热重载",
|
|
24
|
+
"save": "仅保存",
|
|
25
|
+
"preview": "预览 YAML"
|
|
26
|
+
},
|
|
27
|
+
"logs": {
|
|
28
|
+
"fallbackHint": "橙色 = 触发 fallback",
|
|
29
|
+
"failedHint": "红色 = 全链路失败",
|
|
30
|
+
"refresh": "刷新"
|
|
31
|
+
},
|
|
32
|
+
"session": {
|
|
33
|
+
"bindProfile": "本会话绑定的 Profile",
|
|
34
|
+
"saveToSession": "保存到会话变量",
|
|
35
|
+
"probe": "一键探针测试",
|
|
36
|
+
"recentDrops": "本会话最近降级记录",
|
|
37
|
+
"subagentRouting": "子代理路由覆盖",
|
|
38
|
+
"currentProvider": "当前供应商",
|
|
39
|
+
"rerouteToGateway": "子代理将改道网关",
|
|
40
|
+
"allViaGateway": "全部走网关",
|
|
41
|
+
"noOverride": "不覆盖"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": [
|
|
3
|
+
"这个文件是【人类可读的插件描述】,供人查阅、供插件市场/清单工具使用。",
|
|
4
|
+
"",
|
|
5
|
+
"重要说明:DSH 的 Cordis 插件系统【不使用】manifest.json 作为加载契约。",
|
|
6
|
+
"真实加载全部依赖 package.json 里的 `dsh` 字段:",
|
|
7
|
+
" - dsh.bundle.patch -> 指向 cordis.patch.yml,决定如何挂进 profile 组合树",
|
|
8
|
+
" - dsh.client -> { platform, inject },声明客户端半",
|
|
9
|
+
" - exports['./client'] -> 客户端模块的实际入口(__ModuleLoader__ 格式)",
|
|
10
|
+
"",
|
|
11
|
+
"可对照 dsh-llm-fallbacks / dsh-context / dsh-browser / dsh-qq-plugin 等",
|
|
12
|
+
"线上插件验证:它们都不带 manifest.json,只有 package.json 的 dsh 字段。",
|
|
13
|
+
"所以删掉本文件不影响插件加载;保留它是为了可读性与工具友好。",
|
|
14
|
+
"",
|
|
15
|
+
"`main` / `client` 两个字段是本文件的机器可读部分,镜像 package.json 的真相。"
|
|
16
|
+
],
|
|
17
|
+
"name": "dsh-plugin-litellm-bridge",
|
|
18
|
+
"displayName": "LiteLLM 网关桥接",
|
|
19
|
+
"version": "1.0.0",
|
|
20
|
+
"description": "LiteLLM 网关桥接面板:在 DSH 内配置网关地址、按 agent 类型编排 fallback 路由、同步网关模型清单、一键批量连通性测试、绑定会话 profile,并把子代理自动改道到网关降级池。插件本身不含任何路由/重试/降级逻辑,全部交由外部 LiteLLM 网关。",
|
|
21
|
+
"kind": "dsh-plugin",
|
|
22
|
+
"main": "./lib/index.js",
|
|
23
|
+
"client": "./client/index.js",
|
|
24
|
+
"icon": "./icon.svg",
|
|
25
|
+
"locale": {
|
|
26
|
+
"zh": "./locale/zh.json",
|
|
27
|
+
"en": "./locale/en.json"
|
|
28
|
+
},
|
|
29
|
+
"activation": {
|
|
30
|
+
"bundlePatch": "./cordis.patch.yml",
|
|
31
|
+
"rowId": "litellm-bridge",
|
|
32
|
+
"clientPlatform": "web"
|
|
33
|
+
},
|
|
34
|
+
"requires": {
|
|
35
|
+
"dsh": ">=0.2.2-rc.1",
|
|
36
|
+
"node": ">=22"
|
|
37
|
+
},
|
|
38
|
+
"capabilities": [
|
|
39
|
+
"读取/写入 LiteLLM 网关配置(经官方 REST API)",
|
|
40
|
+
"同步网关已注册模型清单(/v1/model/info + /v1/models)",
|
|
41
|
+
"一键批量连通性测试(轻量探针 + 失败归集)",
|
|
42
|
+
"读写会话 profile 变量(供 header 注入插件消费)",
|
|
43
|
+
"子代理路由覆盖(Trae/WorkBuddy 会话的子代理改道网关)"
|
|
44
|
+
],
|
|
45
|
+
"nonGoals": [
|
|
46
|
+
"不实现路由、重试、降级、冷却 —— 全部由 LiteLLM 网关负责",
|
|
47
|
+
"不读取、不落盘、不回显任何明文密钥 —— 密钥只在网关侧 .env"
|
|
48
|
+
],
|
|
49
|
+
"companionPlugins": [
|
|
50
|
+
{
|
|
51
|
+
"name": "dsh-plugin-header-inject",
|
|
52
|
+
"role": "读取会话 profile 变量并注入 x-agent-type / x-session-profile;仅当请求供应商为网关时才注入"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"repository": "https://github.com/heixiua/dsh-fallback-auto-pool-arch"
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-litellm-bridge",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "LiteLLM gateway bridge for DSH: assemble root / coder / research fallback chains from the DSH model pool and hand the order to a LiteLLM gateway that executes retries and fallbacks. The plugin performs no routing itself.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dsh",
|
|
7
|
+
"dsh-plugin",
|
|
8
|
+
"deepseek-harness",
|
|
9
|
+
"litellm",
|
|
10
|
+
"gateway",
|
|
11
|
+
"fallback",
|
|
12
|
+
"litellm-bridge"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "heixiua",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/heixiua/dsh-fallback-auto-pool-arch.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/heixiua/dsh-fallback-auto-pool-arch/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/heixiua/dsh-fallback-auto-pool-arch#readme",
|
|
25
|
+
"main": "./dsh-plugin-litellm-bridge/lib/index.js",
|
|
26
|
+
"icon": "./dsh-plugin-litellm-bridge/icon.svg",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"default": "./dsh-plugin-litellm-bridge/lib/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"default": "./dsh-plugin-litellm-bridge/client/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./locale/*.json": "./dsh-plugin-litellm-bridge/locale/*.json",
|
|
35
|
+
"./cordis.patch.yml": "./dsh-plugin-litellm-bridge/cordis.patch.yml",
|
|
36
|
+
"./icon": "./dsh-plugin-litellm-bridge/icon.svg",
|
|
37
|
+
"./manifest.json": "./dsh-plugin-litellm-bridge/manifest.json",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dsh-plugin-litellm-bridge/lib",
|
|
42
|
+
"dsh-plugin-litellm-bridge/client",
|
|
43
|
+
"dsh-plugin-litellm-bridge/locale",
|
|
44
|
+
"dsh-plugin-litellm-bridge/cordis.patch.yml",
|
|
45
|
+
"dsh-plugin-litellm-bridge/manifest.json",
|
|
46
|
+
"dsh-plugin-litellm-bridge/icon.svg",
|
|
47
|
+
"dsh-plugin-litellm-bridge/README.md",
|
|
48
|
+
"README.md",
|
|
49
|
+
"docs/README.md"
|
|
50
|
+
],
|
|
51
|
+
"dsh": {
|
|
52
|
+
"bundle": {
|
|
53
|
+
"patch": "./dsh-plugin-litellm-bridge/cordis.patch.yml"
|
|
54
|
+
},
|
|
55
|
+
"client": {
|
|
56
|
+
"platform": "web",
|
|
57
|
+
"inject": [
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
60
|
+
"@deepseek-ai/dsh-client-locale",
|
|
61
|
+
"@deepseek-ai/dsh-client-connection"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=22"
|
|
70
|
+
},
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
73
|
+
"registry": "https://registry.npmjs.org/"
|
|
74
|
+
}
|
|
75
|
+
}
|