pi-free 2.2.3 → 2.2.5
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/CHANGELOG.md +23 -48
- package/README.md +41 -532
- package/banner.svg +23 -20
- package/config.ts +779 -702
- package/constants.ts +11 -1
- package/index.ts +15 -1
- package/lib/built-in-toggle.ts +427 -259
- package/lib/model-detection.ts +296 -296
- package/lib/model-metadata.ts +10 -3
- package/lib/telemetry.ts +36 -44
- package/package.json +74 -73
- package/provider-failover/benchmark-lookup.ts +30 -15
- package/provider-helper.ts +27 -8
- package/providers/bai/bai.ts +2 -7
- package/providers/cline/cline-xml-bridge.ts +31 -25
- package/providers/cline/cline.ts +17 -8
- package/providers/kilo/kilo.ts +11 -6
- package/providers/model-fetcher.ts +1 -1
- package/providers/opencode-session.ts +2 -2
- package/providers/openmodel/openmodel.ts +525 -0
- package/providers/qoder/auth.ts +548 -0
- package/providers/qoder/cosy.ts +236 -0
- package/providers/qoder/models.ts +209 -0
- package/providers/qoder/qoder.ts +119 -0
- package/providers/qoder/stream.ts +585 -0
- package/providers/qoder/thinking-parser.ts +251 -0
- package/providers/qoder/transform.ts +192 -0
- package/providers/tokenrouter/tokenrouter.ts +3 -6
package/constants.ts
CHANGED
|
@@ -25,6 +25,8 @@ export const PROVIDER_NOVITA = "novita";
|
|
|
25
25
|
export const PROVIDER_ROUTEWAY = "routeway";
|
|
26
26
|
export const PROVIDER_TOKENROUTER = "tokenrouter";
|
|
27
27
|
export const PROVIDER_BAI = "bai";
|
|
28
|
+
export const PROVIDER_OPENMODEL = "openmodel";
|
|
29
|
+
export const PROVIDER_QODER = "qoder";
|
|
28
30
|
|
|
29
31
|
// Built-in pi providers that pi-free wraps with toggles
|
|
30
32
|
export const PROVIDER_OPENROUTER = "openrouter";
|
|
@@ -49,6 +51,8 @@ export const ALL_UNIQUE_PROVIDERS = [
|
|
|
49
51
|
PROVIDER_ROUTEWAY,
|
|
50
52
|
PROVIDER_TOKENROUTER,
|
|
51
53
|
PROVIDER_BAI,
|
|
54
|
+
PROVIDER_OPENMODEL,
|
|
55
|
+
PROVIDER_QODER,
|
|
52
56
|
] as const;
|
|
53
57
|
|
|
54
58
|
// =============================================================================
|
|
@@ -73,7 +77,13 @@ export const BASE_URL_NOVITA = "https://api.novita.ai/openai/v1";
|
|
|
73
77
|
export const BASE_URL_ROUTEWAY = "https://api.routeway.ai/v1";
|
|
74
78
|
export const BASE_URL_TOKENROUTER = "https://api.tokenrouter.com/v1";
|
|
75
79
|
export const BASE_URL_BAI = "https://api.b.ai/v1";
|
|
76
|
-
|
|
80
|
+
/**
|
|
81
|
+
* OpenModel is registered with `api: "anthropic-messages"`. The pi-ai
|
|
82
|
+
* Anthropic SDK appends `/v1/messages` to `baseURL`, so the base must
|
|
83
|
+
* NOT include `/v1`. See {@link PROVIDER_OPENMODEL}.
|
|
84
|
+
*/
|
|
85
|
+
export const BASE_URL_OPENMODEL = "https://api.openmodel.ai";
|
|
86
|
+
export const BASE_URL_QODER = "https://api2-v2.qoder.sh";
|
|
77
87
|
|
|
78
88
|
/** Cline fetches free models from OpenRouter */
|
|
79
89
|
export const BASE_URL_OPENROUTER = "https://openrouter.ai/api/v1";
|
package/index.ts
CHANGED
|
@@ -44,6 +44,8 @@ import tokenRouter from "./providers/tokenrouter/tokenrouter.ts";
|
|
|
44
44
|
import ollama from "./providers/ollama/ollama.ts";
|
|
45
45
|
import zenmux from "./providers/zenmux/zenmux.ts";
|
|
46
46
|
import bai from "./providers/bai/bai.ts";
|
|
47
|
+
import openmodel from "./providers/openmodel/openmodel.ts";
|
|
48
|
+
import qoder from "./providers/qoder/qoder.ts";
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Single source of truth for unique provider extensions (providers NOT
|
|
@@ -68,6 +70,8 @@ const UNIQUE_PROVIDERS: ReadonlyArray<(pi: ExtensionAPI) => Promise<void>> = [
|
|
|
68
70
|
routeway,
|
|
69
71
|
tokenRouter,
|
|
70
72
|
bai,
|
|
73
|
+
openmodel,
|
|
74
|
+
qoder,
|
|
71
75
|
];
|
|
72
76
|
|
|
73
77
|
const _logger = createLogger("pi-free");
|
|
@@ -188,7 +192,17 @@ function setupGlobalCommands(pi: ExtensionAPI) {
|
|
|
188
192
|
|
|
189
193
|
const lines = ["📊 Model Telemetry:", ""];
|
|
190
194
|
lines.push(
|
|
191
|
-
|
|
195
|
+
"Model".padEnd(40) +
|
|
196
|
+
" " +
|
|
197
|
+
"Calls".padEnd(6) +
|
|
198
|
+
" " +
|
|
199
|
+
"OK%".padEnd(6) +
|
|
200
|
+
" " +
|
|
201
|
+
"Lat".padEnd(7) +
|
|
202
|
+
" " +
|
|
203
|
+
"tok/s".padEnd(7) +
|
|
204
|
+
" " +
|
|
205
|
+
"Cost",
|
|
192
206
|
);
|
|
193
207
|
lines.push(`─`.repeat(75));
|
|
194
208
|
|