pi-free 2.2.2 → 2.2.4
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 +18 -39
- package/README.md +41 -532
- package/banner.svg +23 -20
- package/config.ts +774 -702
- package/constants.ts +11 -1
- package/index.ts +432 -419
- package/lib/model-detection.ts +296 -296
- package/lib/model-metadata.ts +10 -3
- package/lib/telemetry.ts +36 -44
- package/package.json +3 -2
- package/provider-failover/benchmark-lookup.ts +30 -15
- package/provider-helper.ts +27 -8
- package/providers/bai/bai.ts +232 -237
- 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/encoding.ts +48 -0
- package/providers/qoder/models.ts +321 -0
- package/providers/qoder/qoder.ts +154 -0
- package/providers/qoder/stream.ts +677 -0
- package/providers/qoder/thinking-parser.ts +251 -0
- package/providers/qoder/transform.ts +189 -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://api3.qoder.sh";
|
|
77
87
|
|
|
78
88
|
/** Cline fetches free models from OpenRouter */
|
|
79
89
|
export const BASE_URL_OPENROUTER = "https://openrouter.ai/api/v1";
|