@anjieyang/uncommon-route 0.2.0 → 0.2.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 +68 -0
- package/package.json +3 -2
- package/src/index.js +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @anjieyang/uncommon-route
|
|
2
|
+
|
|
3
|
+
**OpenClaw plugin for [UncommonRoute](https://github.com/anjieyang/UncommonRoute) — SOTA LLM Router**
|
|
4
|
+
|
|
5
|
+
98% accuracy, <1ms local routing, OpenAI + Anthropic compatible.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
openclaw plugins install @anjieyang/uncommon-route
|
|
11
|
+
openclaw gateway restart
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
That's it. The plugin auto-installs the Python package, starts the proxy, and registers everything.
|
|
15
|
+
|
|
16
|
+
## What It Does
|
|
17
|
+
|
|
18
|
+
Routes every LLM request to the **cheapest model that can handle it** — simple questions go to budget models, complex tasks go to frontier models. Saves 60-97% on API costs with no quality loss.
|
|
19
|
+
|
|
20
|
+
- **39-feature cascade classifier** — structural, unicode, and keyword analysis
|
|
21
|
+
- **Step-aware agentic routing** — different models for different steps in a workflow
|
|
22
|
+
- **Session persistence** — sticky model per task, auto-escalation on failure
|
|
23
|
+
- **Spend control** — per-request, hourly, daily, session limits
|
|
24
|
+
- **Dual protocol** — OpenAI (`/v1/chat/completions`) + Anthropic (`/v1/messages`)
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `/route <prompt>` | Preview which model would be selected |
|
|
31
|
+
| `/spend status` | View current spending and limits |
|
|
32
|
+
| `/spend set hourly 5.00` | Set an hourly spending limit |
|
|
33
|
+
| `/feedback ok\|weak\|strong` | Rate the last routing decision |
|
|
34
|
+
| `/sessions` | View active routing sessions |
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
plugins:
|
|
40
|
+
entries:
|
|
41
|
+
"@anjieyang/uncommon-route":
|
|
42
|
+
port: 8403
|
|
43
|
+
upstream: "https://api.commonstack.ai/v1"
|
|
44
|
+
spendLimits:
|
|
45
|
+
hourly: 5.00
|
|
46
|
+
daily: 20.00
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Upstream Providers
|
|
50
|
+
|
|
51
|
+
Works with any OpenAI-compatible API:
|
|
52
|
+
|
|
53
|
+
| Provider | URL |
|
|
54
|
+
|---|---|
|
|
55
|
+
| [Commonstack](https://commonstack.ai) | `https://api.commonstack.ai/v1` |
|
|
56
|
+
| [OpenRouter](https://openrouter.ai) | `https://openrouter.ai/api/v1` |
|
|
57
|
+
| OpenAI | `https://api.openai.com/v1` |
|
|
58
|
+
| Local (Ollama) | `http://127.0.0.1:11434/v1` |
|
|
59
|
+
|
|
60
|
+
## Links
|
|
61
|
+
|
|
62
|
+
- [GitHub](https://github.com/anjieyang/UncommonRoute)
|
|
63
|
+
- [PyPI](https://pypi.org/project/uncommon-route/)
|
|
64
|
+
- [Full Documentation](https://github.com/anjieyang/UncommonRoute#readme)
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anjieyang/uncommon-route",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "OpenClaw plugin — UncommonRoute smart LLM router, 98% accuracy, OpenAI + Anthropic compatible",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"src/",
|
|
14
14
|
"openclaw.plugin.json",
|
|
15
|
-
"openclaw.security.json"
|
|
15
|
+
"openclaw.security.json",
|
|
16
|
+
"README.md"
|
|
16
17
|
],
|
|
17
18
|
"keywords": [
|
|
18
19
|
"openclaw",
|
package/src/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { spawn, execSync } from "node:child_process";
|
|
17
17
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
18
18
|
|
|
19
|
-
const VERSION = "0.2.
|
|
19
|
+
const VERSION = "0.2.2";
|
|
20
20
|
const DEFAULT_PORT = 8403;
|
|
21
21
|
const DEFAULT_UPSTREAM = "";
|
|
22
22
|
const HEALTH_TIMEOUT_MS = 15_000;
|