@aiping.cn/model_router 1.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;AAczC,QAAA,cAAc,GAAuC;IAChE,aAAa,EAAE,wBAAwB;IACvC,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,UAAU;IACtB,4DAA4D;IAC5D,4FAA4F;IAC5F,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,KAAK;IACrB,YAAY,EAAE,KAAK;CACpB,CAAC"}
@@ -0,0 +1,70 @@
1
+ {
2
+ "id": "@aiping.cn/model_router",
3
+ "version": "1.0.0",
4
+ "name": "AIPing Model Router",
5
+ "description": "Routes 'aiping:claw' model requests between your local Ollama model and AIPing cloud (Kimi-2.5) using fast rule-based scoring.",
6
+ "extensions": ["dist/index.js"],
7
+ "configSchema": {
8
+ "type": "object",
9
+ "required": ["aipingApiKey"],
10
+ "properties": {
11
+ "aipingApiKey": {
12
+ "type": "string",
13
+ "title": "AIPing API Key",
14
+ "description": "Your AIPing API key. Get it at https://aiping.cn/user/user-center",
15
+ "secret": true
16
+ },
17
+ "localProxyUrl": {
18
+ "type": "string",
19
+ "title": "Local Proxy URL",
20
+ "description": "Ollama or local proxy base URL",
21
+ "default": "http://localhost:11434"
22
+ },
23
+ "localProxyKey": {
24
+ "type": "string",
25
+ "title": "Local Proxy Key",
26
+ "description": "Optional auth key for the local proxy",
27
+ "secret": true,
28
+ "default": ""
29
+ },
30
+ "localModel": {
31
+ "type": "string",
32
+ "title": "Local Model Name",
33
+ "description": "Name of the local model to use (e.g. qwen2.5:4b)",
34
+ "default": "qwen2.5:4b"
35
+ },
36
+ "cloudModel": {
37
+ "type": "string",
38
+ "title": "Cloud Model Name",
39
+ "description": "AIPing cloud model to use",
40
+ "default": "kimi-2.5"
41
+ },
42
+ "routingThreshold": {
43
+ "type": "number",
44
+ "title": "Routing Threshold",
45
+ "description": "复杂度评分阈值 (0-100)。评分 >= 阈值 → 云端,< 阈值 → 本地。默认 85 使约 90% 请求走本地。",
46
+ "default": 85,
47
+ "minimum": 0,
48
+ "maximum": 100
49
+ },
50
+ "fallbackToCloud": {
51
+ "type": "boolean",
52
+ "title": "Fallback to Cloud",
53
+ "description": "Automatically fall back to cloud if local model fails or times out",
54
+ "default": true
55
+ },
56
+ "localTimeoutMs": {
57
+ "type": "number",
58
+ "title": "Local Model Timeout (ms)",
59
+ "description": "Timeout for local model requests before triggering fallback",
60
+ "default": 30000
61
+ },
62
+ "debugRouting": {
63
+ "type": "boolean",
64
+ "title": "Debug Routing",
65
+ "description": "Log routing decisions to console",
66
+ "default": false
67
+ }
68
+ }
69
+ }
70
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@aiping.cn/model_router",
3
+ "version": "1.2.0",
4
+ "description": "OpenClaw plugin: smart routing between local Ollama models and AIPing cloud (Kimi-2.5). ~90% requests stay local.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "openclaw.plugin.json",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "dev": "tsc --watch",
15
+ "test": "vitest run",
16
+ "test:watch": "vitest",
17
+ "lint": "eslint src --ext .ts",
18
+ "prepublishOnly": "npm run build",
19
+ "release": "node scripts/release.mjs"
20
+ },
21
+ "keywords": [
22
+ "openclaw",
23
+ "openclaw-plugin",
24
+ "model-router",
25
+ "aiping",
26
+ "ollama",
27
+ "kimi",
28
+ "llm-routing",
29
+ "local-model"
30
+ ],
31
+ "author": "AIPing Team",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/haoruilee/aiping_router"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/haoruilee/aiping_router/issues"
38
+ },
39
+ "homepage": "https://github.com/haoruilee/aiping_router#readme",
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^20.11.0",
49
+ "typescript": "^5.3.3",
50
+ "vitest": "^1.2.0"
51
+ }
52
+ }