@billjr99/pi-openai-compat 1.0.1 → 1.0.3
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/index.ts +1 -59
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -56,7 +56,6 @@ const TEMPLATES: Record<string, {
|
|
|
56
56
|
displayName: string;
|
|
57
57
|
baseUrl: string;
|
|
58
58
|
keyless: boolean;
|
|
59
|
-
keyHint?: string;
|
|
60
59
|
/** If set, only models whose id appears in this list are kept after fetching. */
|
|
61
60
|
modelFilter?: string[];
|
|
62
61
|
/** If true, prompt the user to confirm/edit the base URL (like ollama/custom). */
|
|
@@ -66,118 +65,62 @@ const TEMPLATES: Record<string, {
|
|
|
66
65
|
displayName: "OpenRouter",
|
|
67
66
|
baseUrl: "https://openrouter.ai/api/v1",
|
|
68
67
|
keyless: false,
|
|
69
|
-
keyHint: "sk-or-... from openrouter.ai/keys",
|
|
70
68
|
},
|
|
71
69
|
nvidia_nim: {
|
|
72
70
|
displayName: "NVIDIA NIM",
|
|
73
71
|
baseUrl: "https://integrate.api.nvidia.com/v1",
|
|
74
72
|
keyless: false,
|
|
75
|
-
keyHint: "nvapi-... from build.nvidia.com",
|
|
76
73
|
},
|
|
77
74
|
nous: {
|
|
78
75
|
displayName: "Nous Research Portal",
|
|
79
76
|
baseUrl: "https://inference-api.nousresearch.com/v1",
|
|
80
77
|
keyless: false,
|
|
81
|
-
keyHint: "Your Nous Portal API key",
|
|
82
78
|
},
|
|
83
79
|
google: {
|
|
84
80
|
displayName: "Google Gemini",
|
|
85
81
|
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
86
82
|
keyless: false,
|
|
87
|
-
keyHint: "Free key from aistudio.google.com (free Google account, no credit card)",
|
|
88
|
-
modelFilter: [
|
|
89
|
-
"gemini-2.5-flash",
|
|
90
|
-
"gemini-2.5-flash-lite",
|
|
91
|
-
"gemini-3-flash-preview",
|
|
92
|
-
"gemini-3.1-flash-lite-preview",
|
|
93
|
-
"gemini-3.1-pro-preview",
|
|
94
|
-
],
|
|
95
83
|
},
|
|
96
84
|
cerebras: {
|
|
97
85
|
displayName: "Cerebras",
|
|
98
86
|
baseUrl: "https://api.cerebras.ai/v1",
|
|
99
87
|
keyless: false,
|
|
100
|
-
keyHint: "Free account at cerebras.ai (no credit card)",
|
|
101
|
-
modelFilter: ["qwen3-235b"],
|
|
102
88
|
},
|
|
103
89
|
github_models: {
|
|
104
90
|
displayName: "GitHub Models",
|
|
105
91
|
baseUrl: "https://models.inference.ai.azure.com",
|
|
106
92
|
keyless: false,
|
|
107
|
-
keyHint: "GitHub Personal Access Token (any free GitHub account, no special scopes needed)",
|
|
108
|
-
modelFilter: ["gpt-4o", "openai/gpt-4.1"],
|
|
109
93
|
},
|
|
110
94
|
sambanova: {
|
|
111
95
|
displayName: "SambaNova",
|
|
112
96
|
baseUrl: "https://api.sambanova.ai/v1",
|
|
113
97
|
keyless: false,
|
|
114
|
-
keyHint: "Free account at cloud.sambanova.ai (no credit card)",
|
|
115
|
-
modelFilter: [
|
|
116
|
-
"Meta-Llama-3.3-70B-Instruct",
|
|
117
|
-
"DeepSeek-V3.1",
|
|
118
|
-
"DeepSeek-V3.2",
|
|
119
|
-
"gpt-oss-120b",
|
|
120
|
-
"Llama-4-Maverick-17B-128E-Instruct",
|
|
121
|
-
"gemma-3-12b-it",
|
|
122
|
-
],
|
|
123
98
|
},
|
|
124
99
|
mistral: {
|
|
125
100
|
displayName: "Mistral",
|
|
126
101
|
baseUrl: "https://api.mistral.ai/v1",
|
|
127
102
|
keyless: false,
|
|
128
|
-
keyHint: 'Free "Experiment" tier at console.mistral.ai (no credit card)',
|
|
129
|
-
modelFilter: [
|
|
130
|
-
"mistral-large-latest",
|
|
131
|
-
"mistral-medium-latest",
|
|
132
|
-
"magistral-medium-latest",
|
|
133
|
-
"codestral-latest",
|
|
134
|
-
"devstral-latest",
|
|
135
|
-
],
|
|
136
103
|
},
|
|
137
104
|
groq: {
|
|
138
105
|
displayName: "Groq",
|
|
139
106
|
baseUrl: "https://api.groq.com/openai/v1",
|
|
140
107
|
keyless: false,
|
|
141
|
-
keyHint: "Free account at console.groq.com (no credit card)",
|
|
142
|
-
modelFilter: [
|
|
143
|
-
"llama-3.3-70b-versatile",
|
|
144
|
-
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
145
|
-
"openai/gpt-oss-120b",
|
|
146
|
-
"openai/gpt-oss-20b",
|
|
147
|
-
"qwen/qwen3-32b",
|
|
148
|
-
"llama-3.1-8b-instant",
|
|
149
|
-
],
|
|
150
108
|
},
|
|
151
109
|
cloudflare: {
|
|
152
110
|
displayName: "Cloudflare Workers AI",
|
|
153
111
|
baseUrl: "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1",
|
|
154
112
|
keyless: false,
|
|
155
113
|
promptUrl: true,
|
|
156
|
-
keyHint: 'Cloudflare API Token with "Workers AI Read" permission (free account at cloudflare.com)',
|
|
157
|
-
modelFilter: [
|
|
158
|
-
"@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
159
|
-
"@cf/meta/llama-4-scout-17b-16e-instruct",
|
|
160
|
-
"@cf/openai/gpt-oss-120b",
|
|
161
|
-
"@cf/zai-org/glm-4.7-flash",
|
|
162
|
-
"@cf/moonshotai/kimi-k2.5",
|
|
163
|
-
"@cf/moonshotai/kimi-k2.6",
|
|
164
|
-
"@cf/qwen/qwen3-30b-a3b-fp8",
|
|
165
|
-
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
|
|
166
|
-
"@cf/ibm-granite/granite-4.0-h-micro",
|
|
167
|
-
],
|
|
168
114
|
},
|
|
169
115
|
zhipu: {
|
|
170
116
|
displayName: "Zhipu (Z.ai / BigModel)",
|
|
171
117
|
baseUrl: "https://open.bigmodel.cn/api/paas/v4",
|
|
172
118
|
keyless: false,
|
|
173
|
-
keyHint: "Free account at open.bigmodel.cn (no credit card)",
|
|
174
|
-
modelFilter: ["glm-4.5-flash", "glm-4.7-flash"],
|
|
175
119
|
},
|
|
176
120
|
cohere: {
|
|
177
121
|
displayName: "Cohere",
|
|
178
122
|
baseUrl: "https://api.cohere.com/compatibility/v1",
|
|
179
123
|
keyless: false,
|
|
180
|
-
keyHint: "Your Cohere API key",
|
|
181
124
|
},
|
|
182
125
|
ollama: {
|
|
183
126
|
displayName: "Ollama (local, keyless)",
|
|
@@ -190,7 +133,6 @@ const TEMPLATES: Record<string, {
|
|
|
190
133
|
baseUrl: "",
|
|
191
134
|
keyless: false,
|
|
192
135
|
promptUrl: true,
|
|
193
|
-
keyHint: "Bearer token or API key (leave blank if keyless)",
|
|
194
136
|
},
|
|
195
137
|
};
|
|
196
138
|
|
|
@@ -400,7 +342,7 @@ export default async function (pi: ExtensionAPI) {
|
|
|
400
342
|
if (!tpl.keyless) {
|
|
401
343
|
const entered = await ctx.ui.input(
|
|
402
344
|
"API Key",
|
|
403
|
-
|
|
345
|
+
"Your API key — leave blank if keyless:",
|
|
404
346
|
""
|
|
405
347
|
);
|
|
406
348
|
if (entered == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@billjr99/pi-openai-compat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "pi-coding-agent extension: OpenAI-compatible endpoint support (OpenRouter, NVIDIA NIM, Nous Portal, Ollama, custom)",
|
|
5
5
|
"author": "Bill Mongan <https://github.com/BillJr99>",
|
|
6
6
|
"license": "MIT",
|