@jameslovespancakes/pi-plus 1.0.0 → 1.0.1
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/LICENSE +21 -21
- package/README.md +190 -190
- package/config/pi-plus.example.json +60 -60
- package/config/skills/model-routing/SKILL.md +86 -86
- package/images/pi-plus.svg +10 -10
- package/package.json +67 -67
- package/server/board-server.mjs +641 -641
- package/server/package.json +17 -17
- package/src/core/accounts/registry.ts +93 -93
- package/src/core/anthropic/client-identity.ts +241 -241
- package/src/core/catalog/quality.ts +314 -314
- package/src/core/config.ts +169 -169
- package/src/core/env.ts +58 -58
- package/src/core/exec/process.ts +146 -146
- package/src/core/exec/ssh-config.ts +157 -157
- package/src/core/policy/policy.ts +183 -183
- package/src/core/quota/pool.ts +64 -64
- package/src/core/quota/usage-source.ts +289 -289
- package/src/core/store.ts +43 -43
- package/src/domains/agents/board-setup.ts +409 -409
- package/src/domains/agents/index.ts +462 -462
- package/src/domains/models/catalog-tool.ts +361 -361
- package/src/domains/models/index.ts +14 -14
- package/src/domains/models/policy-gate.ts +169 -169
- package/src/domains/models/provider-picker.ts +207 -207
- package/src/domains/remote/config-path.ts +41 -41
- package/src/domains/remote/index.ts +866 -866
- package/src/domains/remote/setup.ts +425 -425
- package/src/domains/setup/index.ts +220 -220
- package/src/domains/subscriptions/accounts.ts +242 -242
- package/src/domains/subscriptions/footer.ts +182 -182
- package/src/domains/subscriptions/index.ts +42 -42
- package/src/domains/subscriptions/provider.ts +219 -219
- package/src/domains/subscriptions/providers/anthropic.ts +149 -149
- package/src/domains/subscriptions/providers/codex.ts +148 -148
- package/src/domains/subscriptions/routing.ts +72 -72
- package/src/services/usage-service.ts +186 -186
- package/src/ui/format.ts +73 -73
- package/src/ui/usage-bars.ts +154 -154
- package/src/vendor/anthropic.ts +109 -109
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: model-routing
|
|
3
|
-
description: Choose the right model for a task or workflow stage using live benchmark data. Use when delegating work to subagents, authoring or running inline workflows, or whenever deciding which model should handle a task.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Model routing
|
|
7
|
-
|
|
8
|
-
Do not guess model quality and do not rely on fixed `small`/`medium`/`big`
|
|
9
|
-
profiles. Those profiles have been removed from this machine. Pick a model per
|
|
10
|
-
task from live data.
|
|
11
|
-
|
|
12
|
-
## 1. Read the catalogue first
|
|
13
|
-
|
|
14
|
-
Call the `list_models` tool before delegating work:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
list_models(sort_by: "coding", limit: 15)
|
|
18
|
-
list_models(sort_by: "cost_efficiency", provider: "openai-codex")
|
|
19
|
-
list_models(query: "opus", detail: "full")
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
It returns, per model:
|
|
23
|
-
|
|
24
|
-
- Artificial Analysis Intelligence, Coding and Math indices
|
|
25
|
-
- Terminal-Bench Hard, Terminal-Bench 2.1, τ²-bench, τ-bench Banking
|
|
26
|
-
- LiveCodeBench, SciCode, GPQA Diamond, HLE, MMLU-Pro, IFBench, AIME, MATH-500,
|
|
27
|
-
long-context reasoning
|
|
28
|
-
- price per 1M input/output/blended tokens, throughput, time to first token
|
|
29
|
-
- cost-efficiency ratios (score per dollar)
|
|
30
|
-
- `billing` (`sub` or `paid`) and remaining subscription quota
|
|
31
|
-
- `conf`: `measured`, `inferred`, or `unrated`
|
|
32
|
-
|
|
33
|
-
## 2. Match the metric to the task
|
|
34
|
-
|
|
35
|
-
| Task | Rank by |
|
|
36
|
-
|---|---|
|
|
37
|
-
| Agentic coding, terminal work, multi-step edits | Terminal-Bench Hard, then Coding Index |
|
|
38
|
-
| Tool-calling reliability | τ²-bench |
|
|
39
|
-
| Algorithmic code generation | LiveCodeBench, SciCode |
|
|
40
|
-
| Research, analysis, hard reasoning | GPQA, HLE, Intelligence Index |
|
|
41
|
-
| Long document or repo-wide reasoning | long-context reasoning, context window |
|
|
42
|
-
| Bulk or throwaway fan-out | cost efficiency and tok/s |
|
|
43
|
-
|
|
44
|
-
## 3. Respect billing policy
|
|
45
|
-
|
|
46
|
-
- Subscription models (`anthropic/*`, `openai-codex/*`) are free to use. Prefer
|
|
47
|
-
them, and prefer accounts with quota remaining.
|
|
48
|
-
- Metered models (`openrouter/*`, `google/*`, `openai/*`, `xai/*`) are blocked at
|
|
49
|
-
the provider boundary until the user runs `/model-approve <provider>`. If a
|
|
50
|
-
call is blocked, switch to a subscription model or ask the user; never retry
|
|
51
|
-
in a loop.
|
|
52
|
-
- Check `/model-policy` for the current spend ceiling.
|
|
53
|
-
|
|
54
|
-
## 4. Use explicit models in workflows
|
|
55
|
-
|
|
56
|
-
In inline workflow scripts pass `model` on each `agent()` call:
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
const findings = await parallel([
|
|
60
|
-
() => agent(prompt, { model: "openai-codex/gpt-5.6-terra", schema: Finding }),
|
|
61
|
-
() => agent(prompt, { model: "anthropic/claude-sonnet-5", schema: Finding }),
|
|
62
|
-
]);
|
|
63
|
-
|
|
64
|
-
const synthesis = await agent(summaryPrompt, {
|
|
65
|
-
model: "anthropic/claude-opus-5",
|
|
66
|
-
thinkingLevel: "high",
|
|
67
|
-
});
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Rules:
|
|
71
|
-
|
|
72
|
-
- Always use the full `provider/id` form.
|
|
73
|
-
- Give cheap, fast, high-throughput models the wide fan-out stages.
|
|
74
|
-
- Give the strongest agentic model the synthesis, planning and patch-writing
|
|
75
|
-
stages.
|
|
76
|
-
- Thinking level changes measured quality: `list_models` scores resolve per
|
|
77
|
-
effort level where Artificial Analysis publishes them, so raise
|
|
78
|
-
`thinkingLevel` when a stage is hard rather than switching to a costlier model
|
|
79
|
-
by default.
|
|
80
|
-
- If a model is `unrated`, say so before using it for important work, and prefer
|
|
81
|
-
a `measured` alternative of similar cost.
|
|
82
|
-
|
|
83
|
-
## 5. Quota awareness
|
|
84
|
-
|
|
85
|
-
If Claude's 5h pool is nearly exhausted, route to Codex instead of stalling, and
|
|
86
|
-
mention the switch. The `/usage` bar shows remaining quota for every account.
|
|
1
|
+
---
|
|
2
|
+
name: model-routing
|
|
3
|
+
description: Choose the right model for a task or workflow stage using live benchmark data. Use when delegating work to subagents, authoring or running inline workflows, or whenever deciding which model should handle a task.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Model routing
|
|
7
|
+
|
|
8
|
+
Do not guess model quality and do not rely on fixed `small`/`medium`/`big`
|
|
9
|
+
profiles. Those profiles have been removed from this machine. Pick a model per
|
|
10
|
+
task from live data.
|
|
11
|
+
|
|
12
|
+
## 1. Read the catalogue first
|
|
13
|
+
|
|
14
|
+
Call the `list_models` tool before delegating work:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
list_models(sort_by: "coding", limit: 15)
|
|
18
|
+
list_models(sort_by: "cost_efficiency", provider: "openai-codex")
|
|
19
|
+
list_models(query: "opus", detail: "full")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
It returns, per model:
|
|
23
|
+
|
|
24
|
+
- Artificial Analysis Intelligence, Coding and Math indices
|
|
25
|
+
- Terminal-Bench Hard, Terminal-Bench 2.1, τ²-bench, τ-bench Banking
|
|
26
|
+
- LiveCodeBench, SciCode, GPQA Diamond, HLE, MMLU-Pro, IFBench, AIME, MATH-500,
|
|
27
|
+
long-context reasoning
|
|
28
|
+
- price per 1M input/output/blended tokens, throughput, time to first token
|
|
29
|
+
- cost-efficiency ratios (score per dollar)
|
|
30
|
+
- `billing` (`sub` or `paid`) and remaining subscription quota
|
|
31
|
+
- `conf`: `measured`, `inferred`, or `unrated`
|
|
32
|
+
|
|
33
|
+
## 2. Match the metric to the task
|
|
34
|
+
|
|
35
|
+
| Task | Rank by |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Agentic coding, terminal work, multi-step edits | Terminal-Bench Hard, then Coding Index |
|
|
38
|
+
| Tool-calling reliability | τ²-bench |
|
|
39
|
+
| Algorithmic code generation | LiveCodeBench, SciCode |
|
|
40
|
+
| Research, analysis, hard reasoning | GPQA, HLE, Intelligence Index |
|
|
41
|
+
| Long document or repo-wide reasoning | long-context reasoning, context window |
|
|
42
|
+
| Bulk or throwaway fan-out | cost efficiency and tok/s |
|
|
43
|
+
|
|
44
|
+
## 3. Respect billing policy
|
|
45
|
+
|
|
46
|
+
- Subscription models (`anthropic/*`, `openai-codex/*`) are free to use. Prefer
|
|
47
|
+
them, and prefer accounts with quota remaining.
|
|
48
|
+
- Metered models (`openrouter/*`, `google/*`, `openai/*`, `xai/*`) are blocked at
|
|
49
|
+
the provider boundary until the user runs `/model-approve <provider>`. If a
|
|
50
|
+
call is blocked, switch to a subscription model or ask the user; never retry
|
|
51
|
+
in a loop.
|
|
52
|
+
- Check `/model-policy` for the current spend ceiling.
|
|
53
|
+
|
|
54
|
+
## 4. Use explicit models in workflows
|
|
55
|
+
|
|
56
|
+
In inline workflow scripts pass `model` on each `agent()` call:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const findings = await parallel([
|
|
60
|
+
() => agent(prompt, { model: "openai-codex/gpt-5.6-terra", schema: Finding }),
|
|
61
|
+
() => agent(prompt, { model: "anthropic/claude-sonnet-5", schema: Finding }),
|
|
62
|
+
]);
|
|
63
|
+
|
|
64
|
+
const synthesis = await agent(summaryPrompt, {
|
|
65
|
+
model: "anthropic/claude-opus-5",
|
|
66
|
+
thinkingLevel: "high",
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Rules:
|
|
71
|
+
|
|
72
|
+
- Always use the full `provider/id` form.
|
|
73
|
+
- Give cheap, fast, high-throughput models the wide fan-out stages.
|
|
74
|
+
- Give the strongest agentic model the synthesis, planning and patch-writing
|
|
75
|
+
stages.
|
|
76
|
+
- Thinking level changes measured quality: `list_models` scores resolve per
|
|
77
|
+
effort level where Artificial Analysis publishes them, so raise
|
|
78
|
+
`thinkingLevel` when a stage is hard rather than switching to a costlier model
|
|
79
|
+
by default.
|
|
80
|
+
- If a model is `unrated`, say so before using it for important work, and prefer
|
|
81
|
+
a `measured` alternative of similar cost.
|
|
82
|
+
|
|
83
|
+
## 5. Quota awareness
|
|
84
|
+
|
|
85
|
+
If Claude's 5h pool is nearly exhausted, route to Codex instead of stalling, and
|
|
86
|
+
mention the switch. The `/usage` bar shows remaining quota for every account.
|
package/images/pi-plus.svg
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800">
|
|
3
|
-
<!-- Original Pi logo paths, unchanged -->
|
|
4
|
-
<path fill="#F09082" d="M165.29 165.29H517.36V400H400V282.65H165.29Z"/>
|
|
5
|
-
<path fill="#4D9ABF" d="M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"/>
|
|
6
|
-
<path fill="#F1BE58" d="M517.36 400H634.72V634.72H517.36Z"/>
|
|
7
|
-
|
|
8
|
-
<!-- Plus mark, matching the logo's square/pixel geometry -->
|
|
9
|
-
<path fill="#F09082" d="M697.84 223.97H736.96V263.09H776.08V302.21H736.96V341.33H697.84V302.21H658.72V263.09H697.84Z"/>
|
|
10
|
-
</svg>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800">
|
|
3
|
+
<!-- Original Pi logo paths, unchanged -->
|
|
4
|
+
<path fill="#F09082" d="M165.29 165.29H517.36V400H400V282.65H165.29Z"/>
|
|
5
|
+
<path fill="#4D9ABF" d="M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"/>
|
|
6
|
+
<path fill="#F1BE58" d="M517.36 400H634.72V634.72H517.36Z"/>
|
|
7
|
+
|
|
8
|
+
<!-- Plus mark, matching the logo's square/pixel geometry -->
|
|
9
|
+
<path fill="#F09082" d="M697.84 223.97H736.96V263.09H776.08V302.21H736.96V341.33H697.84V302.21H658.72V263.09H697.84Z"/>
|
|
10
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@jameslovespancakes/pi-plus",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Consolidated pi extensions: Claude subscription accounts and quota HUD, benchmark-driven model catalog and billing policy, live agent board, and capacity-gated remote test workers.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "james",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"pi-package",
|
|
10
|
-
"pi",
|
|
11
|
-
"extensions",
|
|
12
|
-
"anthropic",
|
|
13
|
-
"claude",
|
|
14
|
-
"quota",
|
|
15
|
-
"models"
|
|
16
|
-
],
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/jameslovespancakes/pi-plus.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/jameslovespancakes/pi-plus#readme",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/jameslovespancakes/pi-plus/issues"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"src",
|
|
27
|
-
"server",
|
|
28
|
-
"config/skills",
|
|
29
|
-
"config/pi-plus.example.json",
|
|
30
|
-
"images",
|
|
31
|
-
"README.md",
|
|
32
|
-
"LICENSE"
|
|
33
|
-
],
|
|
34
|
-
"pi": {
|
|
35
|
-
"extensions": [
|
|
36
|
-
"./src/domains/setup/index.ts",
|
|
37
|
-
"./src/domains/subscriptions/index.ts",
|
|
38
|
-
"./src/domains/models/index.ts",
|
|
39
|
-
"./src/domains/agents/index.ts",
|
|
40
|
-
"./src/domains/remote/index.ts"
|
|
41
|
-
],
|
|
42
|
-
"skills": [
|
|
43
|
-
"./config/skills"
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"ws": "^8.18.3"
|
|
48
|
-
},
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"@earendil-works/pi-agent-core": "*",
|
|
51
|
-
"@earendil-works/pi-ai": "*",
|
|
52
|
-
"@earendil-works/pi-coding-agent": "*",
|
|
53
|
-
"@earendil-works/pi-tui": "*",
|
|
54
|
-
"typebox": "*"
|
|
55
|
-
},
|
|
56
|
-
"scripts": {
|
|
57
|
-
"lint": "oxlint",
|
|
58
|
-
"lint:fix": "oxlint --fix",
|
|
59
|
-
"typecheck": "tsc -p tsconfig.json",
|
|
60
|
-
"test": "node --test \"tests/*.test.ts\"",
|
|
61
|
-
"verify": "npm run lint && npm run typecheck && npm test",
|
|
62
|
-
"version:next": "node scripts/bump-version.mjs --dry-run"
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"oxlint": "^1.83.0"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@jameslovespancakes/pi-plus",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Consolidated pi extensions: Claude subscription accounts and quota HUD, benchmark-driven model catalog and billing policy, live agent board, and capacity-gated remote test workers.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "james",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"pi-package",
|
|
10
|
+
"pi",
|
|
11
|
+
"extensions",
|
|
12
|
+
"anthropic",
|
|
13
|
+
"claude",
|
|
14
|
+
"quota",
|
|
15
|
+
"models"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/jameslovespancakes/pi-plus.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/jameslovespancakes/pi-plus#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/jameslovespancakes/pi-plus/issues"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src",
|
|
27
|
+
"server",
|
|
28
|
+
"config/skills",
|
|
29
|
+
"config/pi-plus.example.json",
|
|
30
|
+
"images",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"pi": {
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./src/domains/setup/index.ts",
|
|
37
|
+
"./src/domains/subscriptions/index.ts",
|
|
38
|
+
"./src/domains/models/index.ts",
|
|
39
|
+
"./src/domains/agents/index.ts",
|
|
40
|
+
"./src/domains/remote/index.ts"
|
|
41
|
+
],
|
|
42
|
+
"skills": [
|
|
43
|
+
"./config/skills"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"ws": "^8.18.3"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@earendil-works/pi-agent-core": "*",
|
|
51
|
+
"@earendil-works/pi-ai": "*",
|
|
52
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
53
|
+
"@earendil-works/pi-tui": "*",
|
|
54
|
+
"typebox": "*"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"lint": "oxlint",
|
|
58
|
+
"lint:fix": "oxlint --fix",
|
|
59
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
60
|
+
"test": "node --test \"tests/*.test.ts\"",
|
|
61
|
+
"verify": "npm run lint && npm run typecheck && npm test",
|
|
62
|
+
"version:next": "node scripts/bump-version.mjs --dry-run"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"oxlint": "^1.83.0"
|
|
66
|
+
}
|
|
67
|
+
}
|