pi-multikey 1.9.0 → 1.11.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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/presets.ts +74 -18
  3. package/tui.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-multikey",
3
- "version": "1.9.0",
3
+ "version": "1.11.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
@@ -188,44 +188,100 @@ export const PRESETS: Preset[] = [
188
188
  id: "cline-free",
189
189
  name: "Cline Free",
190
190
  description:
191
- "api.cline.bot — Cline account free tier: DeepSeek V4 Flash, Longcat 2.0, Laguna S 2.1, GLM 5.2 (daily per-model quota, lineup rotates)",
191
+ "api.cline.bot — Cline account free tier: DeepSeek V4.1 Flash, Laguna S 2.1, GLM 5.3, Solar Pro 4, Muse Spark 1.3, Union Alpha (daily per-model quota, lineup rotates)",
192
192
  defaultPoolId: "cline",
193
193
  baseUrl: "https://api.cline.bot/api/v1",
194
194
  api: "openai-completions",
195
195
  keyHint: "Cline account — use 'Sign in with Cline (device flow)', or paste an access token from ~/.cline/data/secrets.json",
196
+ // FREE-TIER MODEL IDS ARE EXACT — copy them from the `free` bucket of
197
+ // GET /api/v1/ai/cline/recommended-models, NOT from GET /models (the
198
+ // OpenRouter catalog dump). Entries prefixed `cline-free/` are only free
199
+ // under that exact id: their raw vendor id (e.g. deepseek/deepseek-v4.1-flash)
200
+ // routes to usage-based billing and answers 402 insufficient_credits on a
201
+ // zero-balance account, while the cline-free/ id rides the daily per-model
202
+ // quota ($0). The cline-free/ namespace is additionally gated on the
203
+ // X-CLIENT-TYPE header — already sent on every request via
204
+ // endpointHeaders() in config.ts, so no extra config is needed.
205
+ // Verified live 2026-09-17 (probe account, multikey's exact header set):
206
+ // raw deepseek-v4.1-flash → 402; cline-free/deepseek-v4.1-flash → 200, $0.
196
207
  models: [
197
208
  {
198
- id: "deepseek/deepseek-v4-flash",
199
- name: "DeepSeek V4 Flash",
209
+ // Feed id: cline-free/deepseek-v4.1-flash. The raw id
210
+ // (deepseek/deepseek-v4.1-flash) is usage-billed — see the comment above.
211
+ // Catalog (openrouter): ctx 1048576, out 384000 (both verified live), text+image.
212
+ // Effort tiers verified live via reasoning:{effort} (incl. "none" = reasoning off).
213
+ id: "cline-free/deepseek-v4.1-flash",
214
+ name: "DeepSeek V4.1 Flash (Free)",
215
+ reasoning: true,
216
+ input: ["text", "image"],
217
+ contextWindow: 1_048_576,
218
+ maxTokens: 384_000,
219
+ compat: { thinkingFormat: "openrouter" },
220
+ thinkingLevelMap: levels({ off: "none", low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }),
221
+ },
222
+ {
223
+ // Free at its raw id (no cline-free/ prefix in the feed); 262K window measured
224
+ // live by the preset author. Not in any catalog (stealth) — sizes unverified.
225
+ id: "poolside/laguna-s-2.1:free",
226
+ name: "Laguna S 2.1 (Free)",
200
227
  reasoning: true,
201
228
  input: ["text"],
202
- contextWindow: 1_000_000,
203
- maxTokens: 131_072,
229
+ contextWindow: 262_144,
230
+ maxTokens: 32_768,
231
+ },
232
+ {
233
+ // z-ai/glm-5.2:free retired from the Cline lineup (id answers "model not found");
234
+ // succeeded by glm-5.3-flash. Always-on reasoning, no effort tiers; vision input.
235
+ id: "z-ai/glm-5.3-flash",
236
+ name: "GLM 5.3 (Free)",
237
+ reasoning: true,
238
+ input: ["text", "image"],
239
+ contextWindow: 1_048_576,
240
+ maxTokens: 128_000,
204
241
  },
205
242
  {
206
- id: "meituan/longcat-2.0",
207
- name: "Longcat 2.0",
243
+ // Feed id: cline-free/solar-pro4 (raw upstage/solar-pro4 is usage-billed).
244
+ // Catalog: ctx 524288 (1M rejected live: "maximum context length is 524288"),
245
+ // out 131072 (accepted live). Effort: none/high only (verified live).
246
+ id: "cline-free/solar-pro4",
247
+ name: "Upstage Solar Pro 4 (Free)",
208
248
  reasoning: true,
209
249
  input: ["text"],
210
- contextWindow: 1_000_000,
250
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
251
+ contextWindow: 524_288,
211
252
  maxTokens: 131_072,
253
+ compat: { thinkingFormat: "openrouter" },
254
+ thinkingLevelMap: levels({ off: "none", high: "high" }),
212
255
  },
213
256
  {
214
- id: "poolside/laguna-s-2.1:free",
215
- name: "Laguna S 2.1 (Free)",
257
+ // Same Meta model as OpenCode Zen's muse-spark-1.3-contributor-free, served
258
+ // through Cline's chat-completions endpoint (no Responses API / session
259
+ // affinity needed). Always-on reasoning; text + image input.
260
+ // Feed id: cline-free/muse-spark-1.3-contributor (raw meta/… is usage-billed).
261
+ // Catalog: ctx 1048576, out 943718, effort minimal..max (no toggle = always on).
262
+ // NOTE: the cline-free/ id answered "not available in your region" from the
263
+ // PH (2026-09-17 probe); the model may be region-gated on the free tier, so
264
+ // catalog values are unverified against the live free route.
265
+ id: "cline-free/muse-spark-1.3-contributor",
266
+ name: "Meta Muse Spark 1.3 Contributor (Free)",
216
267
  reasoning: true,
217
- input: ["text"],
218
- // Poolside doesn't publish the window; safe default, tune if needed.
219
- contextWindow: 128_000,
220
- maxTokens: 16_384,
268
+ input: ["text", "image"],
269
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
270
+ contextWindow: 1_048_576,
271
+ maxTokens: 943_718,
272
+ compat: { thinkingFormat: "openrouter" },
273
+ thinkingLevelMap: levels({ minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }),
221
274
  },
222
275
  {
223
- id: "z-ai/glm-5.2:free",
224
- name: "GLM 5.2 (Free)",
276
+ // Stealth promo model; free at its raw id (no cline-free/ prefix in the feed).
277
+ // Not in any catalog (stealth) — sizes/reasoning copied from the live pool,
278
+ // unverified.
279
+ id: "stealth/union-alpha",
280
+ name: "Union Alpha",
225
281
  reasoning: true,
226
282
  input: ["text"],
227
- contextWindow: 200_000,
228
- maxTokens: 131_072,
283
+ contextWindow: 262_000,
284
+ maxTokens: 16_384,
229
285
  },
230
286
  ],
231
287
  },
package/tui.ts CHANGED
@@ -267,7 +267,9 @@ export async function pickMany(
267
267
  if (v.length === 0) {
268
268
  add(theme.fg("warning", " No matches."));
269
269
  } else {
270
- for (let i = 0; i < Math.min(v.length, maxVisible); i++) {
270
+ const start = Math.max(0, Math.min(cursor - Math.floor(maxVisible / 2), Math.max(0, v.length - maxVisible)));
271
+ const end = Math.min(v.length, start + maxVisible);
272
+ for (let i = start; i < end; i++) {
271
273
  const item = v[i]!;
272
274
  const active = i === cursor;
273
275
  const check = selected.has(item.value) ? theme.fg("accent", "✓") : " ";