pi-multikey 1.2.0 → 1.3.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.
package/README.md CHANGED
@@ -46,6 +46,22 @@ Built-in presets decouple "model settings" from "keys". The data comes from b.ai
46
46
 
47
47
  > Why `null` must be explicit: pi's `getSupportedThinkingLevels` treats `mapped === null` as unsupported and hides that level, but **omitting** it is treated as supported and the level name is sent to the API verbatim; `xhigh` / `max` additionally require an explicit non-null value to be usable.
48
48
 
49
+ ### OpenCode Zen (free tier)
50
+
51
+ Endpoint `https://opencode.ai/zen/v1`; keys from [opencode.ai/auth](https://opencode.ai/auth) → workspace Keys. Context / max-output are the **Zen free-tier serving limits** (consistent across models.dev `opencode` provider + pi's built-in opencode catalog); the raw models are bigger — MiMo V2.5 = 1M ctx, Hy3 = 262K ctx. `muse-spark-1.2-contributor-free` uses the OpenAI **Responses** API endpoint; the other six use chat completions.
52
+
53
+ | Model | ctx / max-out | Modalities | Supported thinking levels |
54
+ |---|---|---|---|
55
+ | big-pickle | 200K / 32K | text | always-on (no thinkingLevelMap, like pi's catalog) |
56
+ | mimo-v2.5-free | 200K / 32K | text+image | always-on (no thinkingLevelMap) |
57
+ | hy3-free | 190K / 64K | text | low · medium · high (no off) |
58
+ | ling-3.0-flash-fin-free | 256K / 32K | text | always-on (no thinkingLevelMap) |
59
+ | nemotron-3-ultra-free | 1M / 128K | text | always-on (no thinkingLevelMap) |
60
+ | nemotron-3.5-lightning-free | 256K / 256K | text | always-on (no thinkingLevelMap) |
61
+ | muse-spark-1.2-contributor-free | 1M / 128K | text+image | minimal · low · medium · high · xhigh (no off, Responses API) |
62
+
63
+ > All seven models are free (zero per-token cost) for a limited time while OpenCode collects feedback; data may be used to improve the models (Nemotron free endpoints are NVIDIA trials — don't send confidential data).
64
+
49
65
  To add a preset: append one entry to the `PRESETS` array in `presets.ts`.
50
66
 
51
67
  ## Configuration
@@ -74,7 +90,7 @@ To add a preset: append one entry to the `PRESETS` array in `presets.ts`.
74
90
  }
75
91
  ```
76
92
 
77
- To add nvidia / opencode etc. later: `/multikey` → `Add pool…` (Custom), or edit the JSON directly and `Reload config from disk`.
93
+ To add nvidia / other providers later: `/multikey` → `Add pool…` (Custom), or edit the JSON directly and `Reload config from disk`.
78
94
 
79
95
  ### Adding a custom pool (no questions about API types)
80
96
 
@@ -100,6 +116,7 @@ The detected header style is stored as `"auth": "api-key"` only when the endpoin
100
116
  │ └─ Delete pool
101
117
  ├─ Add pool…
102
118
  │ ├─ Preset: B.AI all model settings preloaded; paste keys (verified by a probe) and you're done
119
+ │ ├─ Preset: OpenCode Zen free-tier models preloaded (7 models); paste keys and you're done
103
120
  │ └─ Custom… id + base URL + keys, then auto-probe, model multi-select, safe defaults
104
121
  └─ Reload config from disk
105
122
  ```
package/README.zh.md CHANGED
@@ -49,6 +49,25 @@ DeepSeek / Tencent / 小米官方文档,并对每个 thinking 档位做过实
49
49
  > 视为不支持并隐藏该档,但**省略**会被当作支持并把档名原样发给 API;
50
50
  > `xhigh` / `max` 还要求显式给出非 null 值才可用。
51
51
 
52
+ ### OpenCode Zen(免费层)
53
+
54
+ 端点 `https://opencode.ai/zen/v1`;密钥从 [opencode.ai/auth](https://opencode.ai/auth) → workspace Keys 获取。
55
+ 上下文/最大输出为 **Zen 免费层限制**(models.dev `opencode` provider 与 pi 内置 opencode 目录一致);
56
+ 原始模型更大——MiMo V2.5 = 1M ctx,Hy3 = 262K ctx。
57
+ `muse-spark-1.2-contributor-free` 使用 OpenAI **Responses** API;其余六个使用 chat completions。
58
+
59
+ | 模型 | ctx / max-out | 模态 | 生效 thinking 档位 |
60
+ |---|---|---|---|
61
+ | big-pickle | 200K / 32K | text | 始终思考(无 thinkingLevelMap,与 pi 内置目录一致) |
62
+ | mimo-v2.5-free | 200K / 32K | text+image | 始终思考(无 thinkingLevelMap) |
63
+ | hy3-free | 190K / 64K | text | low · medium · high(无 off) |
64
+ | ling-3.0-flash-fin-free | 256K / 32K | text | 始终思考(无 thinkingLevelMap) |
65
+ | nemotron-3-ultra-free | 1M / 128K | text | 始终思考(无 thinkingLevelMap) |
66
+ | nemotron-3.5-lightning-free | 256K / 256K | text | 始终思考(无 thinkingLevelMap) |
67
+ | muse-spark-1.2-contributor-free | 1M / 128K | text+image | minimal · low · medium · high · xhigh(无 off,Responses API) |
68
+
69
+ > 以上七个模型在 OpenCode 收集反馈期间均免费(零 token 费用);数据可能用于改进模型(Nemotron 免费端点为 NVIDIA 试用——请勿提交机密数据)。
70
+
52
71
  新增 preset:在 `presets.ts` 的 `PRESETS` 数组里加一项即可。
53
72
 
54
73
  ## 配置
@@ -79,7 +98,7 @@ DeepSeek / Tencent / 小米官方文档,并对每个 thinking 档位做过实
79
98
  }
80
99
  ```
81
100
 
82
- 以后要加 nvidia / opencode 等:`/multikey` → `Add pool…`(Custom),或直接编辑
101
+ 以后要加 nvidia 等其他 provider:`/multikey` → `Add pool…`(Custom),或直接编辑
83
102
  JSON 后 `Reload config from disk`。
84
103
 
85
104
  ### 添加自定义池(不再询问 API 类型)
@@ -106,6 +125,7 @@ JSON 后 `Reload config from disk`。
106
125
  │ └─ Delete pool
107
126
  ├─ Add pool…
108
127
  │ ├─ Preset: B.AI 预置全部模型设定,粘贴 key(自动校验)即可用
128
+ │ ├─ Preset: OpenCode Zen 免费层模型预置(7 个模型),粘贴 key 即可用
109
129
  │ └─ Custom… 只填 id + Base URL + key,随后自动探测、多选模型、安全默认值
110
130
  └─ Reload config from disk
111
131
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-multikey",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "One pi provider backed by many API keys: automatic 429 rotation, per-request key leases for concurrent subagents, and a /multikey management TUI",
5
5
  "keywords": [
6
6
  "pi-package",
package/presets.ts CHANGED
@@ -43,6 +43,14 @@ const BAI_COMPAT = {
43
43
  supportsReasoningEffort: true,
44
44
  };
45
45
 
46
+ // Shared compat for OpenCode Zen's openai-completions free models, mirroring pi's
47
+ // built-in opencode catalog (dist/bundle/chunks/chunk-OMWWHBTG.js).
48
+ const ZEN_CHAT_COMPAT = {
49
+ supportsStore: false,
50
+ supportsDeveloperRole: false,
51
+ maxTokensField: "max_tokens",
52
+ };
53
+
46
54
  export const PRESETS: Preset[] = [
47
55
  {
48
56
  id: "b-ai",
@@ -120,6 +128,94 @@ export const PRESETS: Preset[] = [
120
128
  },
121
129
  ],
122
130
  },
131
+ {
132
+ id: "opencode-zen",
133
+ name: "OpenCode Zen",
134
+ description: "opencode.ai/zen free tier — Big Pickle, MiMo V2.5, Hy3, Ling 3.0 Fin, Nemotron 3 Ultra/Lightning, Muse Spark 1.2 (7 free models)",
135
+ defaultPoolId: "zen",
136
+ baseUrl: "https://opencode.ai/zen/v1",
137
+ api: "openai-completions",
138
+ keyHint: "https://opencode.ai/auth → sign in → workspace Keys page (one entry per key; multiple keys share the load)",
139
+ models: [
140
+ {
141
+ // models.dev `opencode` provider + pi built-in catalog. Stealth model;
142
+ // always-on reasoning with no effort control (no thinkingLevelMap, like pi's catalog).
143
+ id: "big-pickle",
144
+ name: "Big Pickle",
145
+ reasoning: true,
146
+ input: ["text"],
147
+ contextWindow: 200_000,
148
+ maxTokens: 32_000,
149
+ compat: ZEN_CHAT_COMPAT,
150
+ },
151
+ {
152
+ // Xiaomi MiMo V2.5 omni; raw model is 1M ctx but the Zen FREE tier serves 200K/32K.
153
+ id: "mimo-v2.5-free",
154
+ name: "MiMo V2.5 Free",
155
+ reasoning: true,
156
+ input: ["text", "image"],
157
+ contextWindow: 200_000,
158
+ maxTokens: 32_000,
159
+ compat: ZEN_CHAT_COMPAT,
160
+ },
161
+ {
162
+ // Tencent Hy3; raw model is 262K ctx but the Zen FREE tier serves 190K/64K.
163
+ // thinkingFormat defaults to reasoning_effort: levels map straight to Hy3's
164
+ // low/medium/high effort tiers; no off toggle on the free endpoint.
165
+ id: "hy3-free",
166
+ name: "Hy3 Free",
167
+ reasoning: true,
168
+ input: ["text"],
169
+ contextWindow: 190_000,
170
+ maxTokens: 64_000,
171
+ thinkingLevelMap: levels({ low: "low", medium: "medium", high: "high" }),
172
+ compat: ZEN_CHAT_COMPAT,
173
+ },
174
+ {
175
+ // Finance-tuned Ling 3.0 Flash; reasoning toggle only (no effort tiers).
176
+ id: "ling-3.0-flash-fin-free",
177
+ name: "Ling 3.0 Flash Fin Free",
178
+ reasoning: true,
179
+ input: ["text"],
180
+ contextWindow: 262_144,
181
+ maxTokens: 32_768,
182
+ compat: ZEN_CHAT_COMPAT,
183
+ },
184
+ {
185
+ // NVIDIA Nemotron 3 Ultra; largest open-weight reasoning model on the free tier.
186
+ id: "nemotron-3-ultra-free",
187
+ name: "Nemotron 3 Ultra Free",
188
+ reasoning: true,
189
+ input: ["text"],
190
+ contextWindow: 1_000_000,
191
+ maxTokens: 128_000,
192
+ compat: ZEN_CHAT_COMPAT,
193
+ },
194
+ {
195
+ // NVIDIA Nemotron 3.5 Lightning (MoE); fast agentic model, 262K output cap.
196
+ id: "nemotron-3.5-lightning-free",
197
+ name: "Nemotron 3.5 Lightning Free",
198
+ reasoning: true,
199
+ input: ["text"],
200
+ contextWindow: 262_144,
201
+ maxTokens: 262_144,
202
+ compat: ZEN_CHAT_COMPAT,
203
+ },
204
+ {
205
+ // Meta Muse Spark 1.2 Contributor Free — OpenAI Responses API endpoint (not chat
206
+ // completions), effort tiers minimal..xhigh, no off. compat mirrors pi's catalog.
207
+ id: "muse-spark-1.2-contributor-free",
208
+ name: "Muse Spark 1.2 Contributor Free",
209
+ api: "openai-responses",
210
+ reasoning: true,
211
+ input: ["text", "image"],
212
+ contextWindow: 1_048_576,
213
+ maxTokens: 131_072,
214
+ thinkingLevelMap: levels({ minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: "xhigh" }),
215
+ compat: { sessionAffinityFormat: "openai-nosession" },
216
+ },
217
+ ],
218
+ },
123
219
  ];
124
220
 
125
221
  export function findPreset(id: string): Preset | undefined {