hedgequantx 2.6.162 → 2.7.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 +15 -88
- package/bin/cli.js +0 -11
- package/dist/lib/api.jsc +0 -0
- package/dist/lib/api2.jsc +0 -0
- package/dist/lib/core.jsc +0 -0
- package/dist/lib/core2.jsc +0 -0
- package/dist/lib/data.js +1 -1
- package/dist/lib/data.jsc +0 -0
- package/dist/lib/data2.jsc +0 -0
- package/dist/lib/decoder.jsc +0 -0
- package/dist/lib/m/mod1.jsc +0 -0
- package/dist/lib/m/mod2.jsc +0 -0
- package/dist/lib/n/r1.jsc +0 -0
- package/dist/lib/n/r2.jsc +0 -0
- package/dist/lib/n/r3.jsc +0 -0
- package/dist/lib/n/r4.jsc +0 -0
- package/dist/lib/n/r5.jsc +0 -0
- package/dist/lib/n/r6.jsc +0 -0
- package/dist/lib/n/r7.jsc +0 -0
- package/dist/lib/o/util1.jsc +0 -0
- package/dist/lib/o/util2.jsc +0 -0
- package/package.json +6 -3
- package/src/app.js +40 -162
- package/src/config/constants.js +31 -33
- package/src/config/propfirms.js +13 -217
- package/src/config/settings.js +0 -43
- package/src/lib/api.js +198 -0
- package/src/lib/api2.js +353 -0
- package/src/lib/core.js +539 -0
- package/src/lib/core2.js +341 -0
- package/src/lib/data.js +555 -0
- package/src/lib/data2.js +492 -0
- package/src/lib/decoder.js +599 -0
- package/src/lib/m/s1.js +804 -0
- package/src/lib/m/s2.js +34 -0
- package/src/lib/n/r1.js +454 -0
- package/src/lib/n/r2.js +514 -0
- package/src/lib/n/r3.js +631 -0
- package/src/lib/n/r4.js +401 -0
- package/src/lib/n/r5.js +335 -0
- package/src/lib/n/r6.js +425 -0
- package/src/lib/n/r7.js +530 -0
- package/src/lib/o/l1.js +44 -0
- package/src/lib/o/l2.js +427 -0
- package/src/lib/python-bridge.js +206 -0
- package/src/menus/connect.js +14 -176
- package/src/menus/dashboard.js +65 -110
- package/src/pages/accounts.js +18 -18
- package/src/pages/algo/copy-trading.js +210 -240
- package/src/pages/algo/index.js +41 -104
- package/src/pages/algo/one-account.js +386 -33
- package/src/pages/algo/ui.js +312 -151
- package/src/pages/orders.js +3 -3
- package/src/pages/positions.js +3 -3
- package/src/pages/stats/chart.js +74 -0
- package/src/pages/stats/display.js +228 -0
- package/src/pages/stats/index.js +236 -0
- package/src/pages/stats/metrics.js +213 -0
- package/src/pages/user.js +6 -6
- package/src/services/hqx-server/constants.js +55 -0
- package/src/services/hqx-server/index.js +401 -0
- package/src/services/hqx-server/latency.js +81 -0
- package/src/services/index.js +12 -3
- package/src/services/rithmic/accounts.js +7 -32
- package/src/services/rithmic/connection.js +1 -204
- package/src/services/rithmic/contracts.js +235 -0
- package/src/services/rithmic/handlers.js +21 -196
- package/src/services/rithmic/index.js +60 -291
- package/src/services/rithmic/market.js +31 -0
- package/src/services/rithmic/orders.js +5 -361
- package/src/services/rithmic/protobuf.js +5 -195
- package/src/services/session.js +22 -173
- package/src/ui/box.js +10 -18
- package/src/ui/index.js +1 -3
- package/src/ui/menu.js +1 -1
- package/src/utils/prompts.js +2 -2
- package/dist/lib/m/s1.js +0 -1
- package/src/menus/ai-agent-connect.js +0 -181
- package/src/menus/ai-agent-models.js +0 -219
- package/src/menus/ai-agent-oauth.js +0 -292
- package/src/menus/ai-agent-ui.js +0 -141
- package/src/menus/ai-agent.js +0 -484
- package/src/pages/algo/algo-config.js +0 -195
- package/src/pages/algo/algo-multi.js +0 -801
- package/src/pages/algo/algo-utils.js +0 -58
- package/src/pages/algo/copy-engine.js +0 -449
- package/src/pages/algo/custom-strategy.js +0 -459
- package/src/pages/algo/logger.js +0 -245
- package/src/pages/algo/smart-logs-data.js +0 -218
- package/src/pages/algo/smart-logs.js +0 -387
- package/src/pages/algo/ui-constants.js +0 -144
- package/src/pages/algo/ui-summary.js +0 -184
- package/src/pages/stats-calculations.js +0 -191
- package/src/pages/stats-ui.js +0 -381
- package/src/pages/stats.js +0 -339
- package/src/services/ai/client-analysis.js +0 -194
- package/src/services/ai/client-models.js +0 -333
- package/src/services/ai/client.js +0 -343
- package/src/services/ai/index.js +0 -384
- package/src/services/ai/oauth-anthropic.js +0 -265
- package/src/services/ai/oauth-gemini.js +0 -223
- package/src/services/ai/oauth-iflow.js +0 -269
- package/src/services/ai/oauth-openai.js +0 -233
- package/src/services/ai/oauth-qwen.js +0 -279
- package/src/services/ai/providers/index.js +0 -526
- package/src/services/ai/proxy-install.js +0 -249
- package/src/services/ai/proxy-manager.js +0 -494
- package/src/services/ai/proxy-remote.js +0 -161
- package/src/services/ai/strategy-supervisor.js +0 -1312
- package/src/services/ai/supervisor-data.js +0 -195
- package/src/services/ai/supervisor-optimize.js +0 -215
- package/src/services/ai/supervisor-sync.js +0 -178
- package/src/services/ai/supervisor-utils.js +0 -158
- package/src/services/ai/supervisor.js +0 -484
- package/src/services/ai/validation.js +0 -250
- package/src/services/hqx-server-events.js +0 -110
- package/src/services/hqx-server-handlers.js +0 -217
- package/src/services/hqx-server-latency.js +0 -136
- package/src/services/hqx-server.js +0 -403
- package/src/services/position-constants.js +0 -28
- package/src/services/position-manager.js +0 -528
- package/src/services/position-momentum.js +0 -206
- package/src/services/projectx/accounts.js +0 -142
- package/src/services/projectx/index.js +0 -443
- package/src/services/projectx/market.js +0 -172
- package/src/services/projectx/stats.js +0 -110
- package/src/services/projectx/trading.js +0 -180
- package/src/services/rithmic/latency-tracker.js +0 -182
- package/src/services/rithmic/market-data.js +0 -549
- package/src/services/rithmic/specs.js +0 -146
- package/src/services/rithmic/trade-history.js +0 -254
- package/src/services/session-history.js +0 -475
- package/src/services/strategy/hft-tick.js +0 -507
- package/src/services/strategy/recovery-math.js +0 -402
- package/src/services/tradovate/constants.js +0 -109
- package/src/services/tradovate/index.js +0 -505
- package/src/services/tradovate/market.js +0 -47
- package/src/services/tradovate/websocket.js +0 -97
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Providers Configuration
|
|
3
|
-
* Each provider has connection options (API Key, Plans, etc.)
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT: models arrays are empty - models MUST be fetched from real APIs
|
|
6
|
-
* No hardcoded model lists allowed (see RULES.md)
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const PROVIDERS = {
|
|
10
|
-
// ========== UNIFIED PROVIDERS (RECOMMENDED) ==========
|
|
11
|
-
openrouter: {
|
|
12
|
-
id: 'openrouter',
|
|
13
|
-
name: 'OPENROUTER (RECOMMENDED)',
|
|
14
|
-
description: '1 API key for 100+ models',
|
|
15
|
-
category: 'unified',
|
|
16
|
-
models: [], // Fetched from API at runtime
|
|
17
|
-
defaultModel: null, // Will use first model from API
|
|
18
|
-
options: [
|
|
19
|
-
{
|
|
20
|
-
id: 'api_key',
|
|
21
|
-
label: 'API KEY',
|
|
22
|
-
description: [
|
|
23
|
-
'Get key at openrouter.ai/keys',
|
|
24
|
-
'Access to Claude, GPT-4, Gemini, Llama & more',
|
|
25
|
-
'Pay-per-use, no subscriptions'
|
|
26
|
-
],
|
|
27
|
-
fields: ['apiKey'],
|
|
28
|
-
url: 'https://openrouter.ai/keys'
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
endpoint: 'https://openrouter.ai/api/v1'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
// ========== DIRECT PROVIDERS ==========
|
|
35
|
-
anthropic: {
|
|
36
|
-
id: 'anthropic',
|
|
37
|
-
name: 'CLAUDE (ANTHROPIC)',
|
|
38
|
-
description: 'Pro/Max or API Key',
|
|
39
|
-
category: 'direct',
|
|
40
|
-
models: [], // Fetched from API at runtime
|
|
41
|
-
defaultModel: null, // Will use first model from API
|
|
42
|
-
options: [
|
|
43
|
-
{
|
|
44
|
-
id: 'oauth_max',
|
|
45
|
-
label: 'CLAUDE PRO/MAX (OAUTH)',
|
|
46
|
-
description: [
|
|
47
|
-
'Login with your Claude subscription',
|
|
48
|
-
'Unlimited usage with your plan'
|
|
49
|
-
],
|
|
50
|
-
fields: ['oauth'],
|
|
51
|
-
authType: 'oauth'
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'api_key',
|
|
55
|
-
label: 'API KEY (PAY-PER-USE)',
|
|
56
|
-
description: [
|
|
57
|
-
'Get key at console.anthropic.com',
|
|
58
|
-
'~$0.10 per trading session'
|
|
59
|
-
],
|
|
60
|
-
fields: ['apiKey'],
|
|
61
|
-
url: 'https://console.anthropic.com/settings/keys'
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
endpoint: 'https://api.anthropic.com/v1'
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
openai: {
|
|
68
|
-
id: 'openai',
|
|
69
|
-
name: 'OPENAI (GPT-4/5)',
|
|
70
|
-
description: 'Plus/Pro or API Key',
|
|
71
|
-
category: 'direct',
|
|
72
|
-
models: [], // Fetched from API at runtime
|
|
73
|
-
defaultModel: null, // Will use first model from API
|
|
74
|
-
options: [
|
|
75
|
-
{
|
|
76
|
-
id: 'oauth_plus',
|
|
77
|
-
label: 'PLUS/PRO SUBSCRIPTION (OAUTH)',
|
|
78
|
-
description: [
|
|
79
|
-
'Login with your ChatGPT account',
|
|
80
|
-
'Unlimited with your plan'
|
|
81
|
-
],
|
|
82
|
-
fields: ['oauth'],
|
|
83
|
-
authType: 'oauth'
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'api_key',
|
|
87
|
-
label: 'API KEY (PAY-PER-USE)',
|
|
88
|
-
description: [
|
|
89
|
-
'Get key at platform.openai.com',
|
|
90
|
-
'~$0.15 per trading session'
|
|
91
|
-
],
|
|
92
|
-
fields: ['apiKey'],
|
|
93
|
-
url: 'https://platform.openai.com/api-keys'
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
endpoint: 'https://api.openai.com/v1'
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
gemini: {
|
|
100
|
-
id: 'gemini',
|
|
101
|
-
name: 'GEMINI (GOOGLE)',
|
|
102
|
-
description: 'Advanced or API Key',
|
|
103
|
-
category: 'direct',
|
|
104
|
-
models: [], // Fetched from API at runtime
|
|
105
|
-
defaultModel: null, // Will use first model from API
|
|
106
|
-
options: [
|
|
107
|
-
{
|
|
108
|
-
id: 'oauth_advanced',
|
|
109
|
-
label: 'ADVANCED SUBSCRIPTION (OAUTH)',
|
|
110
|
-
description: [
|
|
111
|
-
'Login with your Google account',
|
|
112
|
-
'Unlimited with your plan'
|
|
113
|
-
],
|
|
114
|
-
fields: ['oauth'],
|
|
115
|
-
authType: 'oauth'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: 'api_key',
|
|
119
|
-
label: 'API KEY (FREE TIER)',
|
|
120
|
-
description: [
|
|
121
|
-
'Get key at aistudio.google.com',
|
|
122
|
-
'Free tier: 60 requests/min'
|
|
123
|
-
],
|
|
124
|
-
fields: ['apiKey'],
|
|
125
|
-
url: 'https://aistudio.google.com/apikey'
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
endpoint: 'https://generativelanguage.googleapis.com/v1'
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
deepseek: {
|
|
132
|
-
id: 'deepseek',
|
|
133
|
-
name: 'DEEPSEEK',
|
|
134
|
-
description: 'Very cheap & capable',
|
|
135
|
-
category: 'direct',
|
|
136
|
-
models: [], // Fetched from API at runtime
|
|
137
|
-
defaultModel: null, // Will use first model from API
|
|
138
|
-
options: [
|
|
139
|
-
{
|
|
140
|
-
id: 'api_key',
|
|
141
|
-
label: 'API KEY (VERY CHEAP)',
|
|
142
|
-
description: [
|
|
143
|
-
'Get key at platform.deepseek.com',
|
|
144
|
-
'~$0.02 per trading session'
|
|
145
|
-
],
|
|
146
|
-
fields: ['apiKey'],
|
|
147
|
-
url: 'https://platform.deepseek.com'
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
endpoint: 'https://api.deepseek.com/v1'
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
groq: {
|
|
154
|
-
id: 'groq',
|
|
155
|
-
name: 'GROQ',
|
|
156
|
-
description: 'Ultra fast inference',
|
|
157
|
-
category: 'direct',
|
|
158
|
-
models: [], // Fetched from API at runtime
|
|
159
|
-
defaultModel: null, // Will use first model from API
|
|
160
|
-
options: [
|
|
161
|
-
{
|
|
162
|
-
id: 'api_key',
|
|
163
|
-
label: 'API KEY (FREE TIER)',
|
|
164
|
-
description: [
|
|
165
|
-
'Get key at console.groq.com',
|
|
166
|
-
'Generous free tier',
|
|
167
|
-
'Ultra low latency'
|
|
168
|
-
],
|
|
169
|
-
fields: ['apiKey'],
|
|
170
|
-
url: 'https://console.groq.com/keys'
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
endpoint: 'https://api.groq.com/openai/v1'
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
xai: {
|
|
177
|
-
id: 'xai',
|
|
178
|
-
name: 'GROK (XAI)',
|
|
179
|
-
description: 'Elon Musk\'s Grok AI',
|
|
180
|
-
category: 'direct',
|
|
181
|
-
models: [], // Fetched from API at runtime
|
|
182
|
-
defaultModel: null, // Will use first model from API
|
|
183
|
-
options: [
|
|
184
|
-
{
|
|
185
|
-
id: 'api_key',
|
|
186
|
-
label: 'API KEY',
|
|
187
|
-
description: [
|
|
188
|
-
'Get key at console.x.ai',
|
|
189
|
-
'Grok models from xAI'
|
|
190
|
-
],
|
|
191
|
-
fields: ['apiKey'],
|
|
192
|
-
url: 'https://console.x.ai'
|
|
193
|
-
}
|
|
194
|
-
],
|
|
195
|
-
endpoint: 'https://api.x.ai/v1'
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
mistral: {
|
|
199
|
-
id: 'mistral',
|
|
200
|
-
name: 'MISTRAL',
|
|
201
|
-
description: 'European AI leader',
|
|
202
|
-
category: 'direct',
|
|
203
|
-
models: [], // Fetched from API at runtime
|
|
204
|
-
defaultModel: null, // Will use first model from API
|
|
205
|
-
options: [
|
|
206
|
-
{
|
|
207
|
-
id: 'api_key',
|
|
208
|
-
label: 'API KEY',
|
|
209
|
-
description: [
|
|
210
|
-
'Get key at console.mistral.ai',
|
|
211
|
-
'Fast European models'
|
|
212
|
-
],
|
|
213
|
-
fields: ['apiKey'],
|
|
214
|
-
url: 'https://console.mistral.ai'
|
|
215
|
-
}
|
|
216
|
-
],
|
|
217
|
-
endpoint: 'https://api.mistral.ai/v1'
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
perplexity: {
|
|
221
|
-
id: 'perplexity',
|
|
222
|
-
name: 'PERPLEXITY',
|
|
223
|
-
description: 'Real-time web search AI',
|
|
224
|
-
category: 'direct',
|
|
225
|
-
models: [], // Fetched from API at runtime
|
|
226
|
-
defaultModel: null, // Will use first model from API
|
|
227
|
-
options: [
|
|
228
|
-
{
|
|
229
|
-
id: 'api_key',
|
|
230
|
-
label: 'API KEY',
|
|
231
|
-
description: [
|
|
232
|
-
'Get key at perplexity.ai/settings/api',
|
|
233
|
-
'Real-time market news & data',
|
|
234
|
-
'Web search integrated'
|
|
235
|
-
],
|
|
236
|
-
fields: ['apiKey'],
|
|
237
|
-
url: 'https://www.perplexity.ai/settings/api'
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
endpoint: 'https://api.perplexity.ai'
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
together: {
|
|
244
|
-
id: 'together',
|
|
245
|
-
name: 'TOGETHER AI',
|
|
246
|
-
description: 'Open source models, fast & cheap',
|
|
247
|
-
category: 'direct',
|
|
248
|
-
models: [], // Fetched from API at runtime
|
|
249
|
-
defaultModel: null, // Will use first model from API
|
|
250
|
-
options: [
|
|
251
|
-
{
|
|
252
|
-
id: 'api_key',
|
|
253
|
-
label: 'API KEY',
|
|
254
|
-
description: [
|
|
255
|
-
'Get key at api.together.xyz',
|
|
256
|
-
'100+ open source models',
|
|
257
|
-
'Fast inference, good pricing'
|
|
258
|
-
],
|
|
259
|
-
fields: ['apiKey'],
|
|
260
|
-
url: 'https://api.together.xyz/settings/api-keys'
|
|
261
|
-
}
|
|
262
|
-
],
|
|
263
|
-
endpoint: 'https://api.together.xyz/v1'
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
iflow: {
|
|
267
|
-
id: 'iflow',
|
|
268
|
-
name: 'IFLOW',
|
|
269
|
-
description: 'Subscription (OAuth)',
|
|
270
|
-
category: 'direct',
|
|
271
|
-
models: [], // Fetched from API at runtime
|
|
272
|
-
defaultModel: null, // Will use first model from API
|
|
273
|
-
options: [
|
|
274
|
-
{
|
|
275
|
-
id: 'oauth_sub',
|
|
276
|
-
label: 'SUBSCRIPTION (OAUTH)',
|
|
277
|
-
description: [
|
|
278
|
-
'Login with your iFlow account',
|
|
279
|
-
'Access to DeepSeek, Kimi, GLM & more'
|
|
280
|
-
],
|
|
281
|
-
fields: ['oauth'],
|
|
282
|
-
authType: 'oauth'
|
|
283
|
-
}
|
|
284
|
-
],
|
|
285
|
-
endpoint: 'https://api.iflow.com/v1'
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
qwen: {
|
|
290
|
-
id: 'qwen',
|
|
291
|
-
name: 'QWEN (ALIBABA)',
|
|
292
|
-
description: 'Chat subscription or API Key',
|
|
293
|
-
category: 'direct',
|
|
294
|
-
models: [], // Fetched from API at runtime
|
|
295
|
-
defaultModel: null, // Will use first model from API
|
|
296
|
-
options: [
|
|
297
|
-
{
|
|
298
|
-
id: 'oauth_chat',
|
|
299
|
-
label: 'CHAT SUBSCRIPTION (OAUTH)',
|
|
300
|
-
description: [
|
|
301
|
-
'Login with your Qwen account',
|
|
302
|
-
'Unlimited with your plan'
|
|
303
|
-
],
|
|
304
|
-
fields: ['oauth'],
|
|
305
|
-
authType: 'oauth'
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
id: 'api_key',
|
|
309
|
-
label: 'API KEY (DASHSCOPE)',
|
|
310
|
-
description: [
|
|
311
|
-
'Get key at dashscope.aliyun.com',
|
|
312
|
-
'Qwen2.5 models',
|
|
313
|
-
'Very competitive pricing'
|
|
314
|
-
],
|
|
315
|
-
fields: ['apiKey'],
|
|
316
|
-
url: 'https://dashscope.console.aliyun.com/apiKey'
|
|
317
|
-
}
|
|
318
|
-
],
|
|
319
|
-
endpoint: 'https://dashscope.aliyuncs.com/compatible-mode/v1'
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
moonshot: {
|
|
323
|
-
id: 'moonshot',
|
|
324
|
-
name: 'MOONSHOT (KIMI)',
|
|
325
|
-
description: '200K context window',
|
|
326
|
-
category: 'direct',
|
|
327
|
-
models: [], // Fetched from API at runtime
|
|
328
|
-
defaultModel: null, // Will use first model from API
|
|
329
|
-
options: [
|
|
330
|
-
{
|
|
331
|
-
id: 'api_key',
|
|
332
|
-
label: 'API KEY',
|
|
333
|
-
description: [
|
|
334
|
-
'Get key at platform.moonshot.cn',
|
|
335
|
-
'Up to 200K context',
|
|
336
|
-
'Good for long documents'
|
|
337
|
-
],
|
|
338
|
-
fields: ['apiKey'],
|
|
339
|
-
url: 'https://platform.moonshot.cn/console/api-keys'
|
|
340
|
-
}
|
|
341
|
-
],
|
|
342
|
-
endpoint: 'https://api.moonshot.cn/v1'
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
yi: {
|
|
346
|
-
id: 'yi',
|
|
347
|
-
name: '01.AI (YI)',
|
|
348
|
-
description: 'Yi models by Kai-Fu Lee',
|
|
349
|
-
category: 'direct',
|
|
350
|
-
models: [], // Fetched from API at runtime
|
|
351
|
-
defaultModel: null, // Will use first model from API
|
|
352
|
-
options: [
|
|
353
|
-
{
|
|
354
|
-
id: 'api_key',
|
|
355
|
-
label: 'API KEY',
|
|
356
|
-
description: [
|
|
357
|
-
'Get key at platform.01.ai',
|
|
358
|
-
'Yi-Large: GPT-4 level',
|
|
359
|
-
'Affordable pricing'
|
|
360
|
-
],
|
|
361
|
-
fields: ['apiKey'],
|
|
362
|
-
url: 'https://platform.01.ai'
|
|
363
|
-
}
|
|
364
|
-
],
|
|
365
|
-
endpoint: 'https://api.01.ai/v1'
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
zhipu: {
|
|
369
|
-
id: 'zhipu',
|
|
370
|
-
name: 'ZHIPU AI (GLM)',
|
|
371
|
-
description: 'ChatGLM models',
|
|
372
|
-
category: 'direct',
|
|
373
|
-
models: [], // Fetched from API at runtime
|
|
374
|
-
defaultModel: null, // Will use first model from API
|
|
375
|
-
options: [
|
|
376
|
-
{
|
|
377
|
-
id: 'api_key',
|
|
378
|
-
label: 'API KEY',
|
|
379
|
-
description: [
|
|
380
|
-
'Get key at open.bigmodel.cn',
|
|
381
|
-
'ChatGLM-4 models',
|
|
382
|
-
'Strong multilingual'
|
|
383
|
-
],
|
|
384
|
-
fields: ['apiKey'],
|
|
385
|
-
url: 'https://open.bigmodel.cn/usercenter/apikeys'
|
|
386
|
-
}
|
|
387
|
-
],
|
|
388
|
-
endpoint: 'https://open.bigmodel.cn/api/paas/v4'
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
baichuan: {
|
|
392
|
-
id: 'baichuan',
|
|
393
|
-
name: 'BAICHUAN',
|
|
394
|
-
description: 'Multilingual AI model',
|
|
395
|
-
category: 'direct',
|
|
396
|
-
models: [], // Fetched from API at runtime
|
|
397
|
-
defaultModel: null, // Will use first model from API
|
|
398
|
-
options: [
|
|
399
|
-
{
|
|
400
|
-
id: 'api_key',
|
|
401
|
-
label: 'API KEY',
|
|
402
|
-
description: [
|
|
403
|
-
'Get key at platform.baichuan-ai.com',
|
|
404
|
-
'Strong multilingual support',
|
|
405
|
-
'Competitive pricing'
|
|
406
|
-
],
|
|
407
|
-
fields: ['apiKey'],
|
|
408
|
-
url: 'https://platform.baichuan-ai.com/console/apikey'
|
|
409
|
-
}
|
|
410
|
-
],
|
|
411
|
-
endpoint: 'https://api.baichuan-ai.com/v1'
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
// ========== LOCAL / FREE ==========
|
|
415
|
-
ollama: {
|
|
416
|
-
id: 'ollama',
|
|
417
|
-
name: 'OLLAMA (LOCAL - FREE)',
|
|
418
|
-
description: '100% free, runs locally',
|
|
419
|
-
category: 'local',
|
|
420
|
-
models: [], // Fetched from local API at runtime
|
|
421
|
-
defaultModel: null, // Will use first model from API
|
|
422
|
-
options: [
|
|
423
|
-
{
|
|
424
|
-
id: 'local',
|
|
425
|
-
label: 'LOCAL INSTALLATION (FREE)',
|
|
426
|
-
description: [
|
|
427
|
-
'Download at ollama.ai',
|
|
428
|
-
'100% free, no API key needed',
|
|
429
|
-
'Run: ollama pull llama3.1'
|
|
430
|
-
],
|
|
431
|
-
fields: ['endpoint'],
|
|
432
|
-
url: 'https://ollama.ai',
|
|
433
|
-
defaultEndpoint: 'http://localhost:11434'
|
|
434
|
-
}
|
|
435
|
-
]
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
lmstudio: {
|
|
439
|
-
id: 'lmstudio',
|
|
440
|
-
name: 'LM STUDIO (LOCAL - FREE)',
|
|
441
|
-
description: 'Local with GUI',
|
|
442
|
-
category: 'local',
|
|
443
|
-
models: [], // Fetched from local API at runtime
|
|
444
|
-
defaultModel: null, // Will use first model from API
|
|
445
|
-
options: [
|
|
446
|
-
{
|
|
447
|
-
id: 'local',
|
|
448
|
-
label: 'LOCAL SERVER (FREE)',
|
|
449
|
-
description: [
|
|
450
|
-
'Download at lmstudio.ai',
|
|
451
|
-
'GUI for local models',
|
|
452
|
-
'OpenAI-compatible API'
|
|
453
|
-
],
|
|
454
|
-
fields: ['endpoint'],
|
|
455
|
-
url: 'https://lmstudio.ai',
|
|
456
|
-
defaultEndpoint: 'http://localhost:1234/v1'
|
|
457
|
-
}
|
|
458
|
-
]
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
// ========== CUSTOM ==========
|
|
462
|
-
custom: {
|
|
463
|
-
id: 'custom',
|
|
464
|
-
name: 'CUSTOM ENDPOINT',
|
|
465
|
-
description: 'Any OpenAI-compatible API',
|
|
466
|
-
category: 'custom',
|
|
467
|
-
models: [], // User must specify model
|
|
468
|
-
defaultModel: null,
|
|
469
|
-
options: [
|
|
470
|
-
{
|
|
471
|
-
id: 'custom',
|
|
472
|
-
label: 'CUSTOM OPENAI-COMPATIBLE API',
|
|
473
|
-
description: [
|
|
474
|
-
'Self-hosted models',
|
|
475
|
-
'vLLM, TGI, etc.',
|
|
476
|
-
'Any OpenAI-compatible endpoint'
|
|
477
|
-
],
|
|
478
|
-
fields: ['endpoint', 'apiKey', 'model']
|
|
479
|
-
}
|
|
480
|
-
]
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Get all providers
|
|
486
|
-
*/
|
|
487
|
-
const getProviders = () => Object.values(PROVIDERS);
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Get providers by category
|
|
491
|
-
*/
|
|
492
|
-
const getProvidersByCategory = (category) => {
|
|
493
|
-
return Object.values(PROVIDERS).filter(p => p.category === category);
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Get provider by ID
|
|
498
|
-
*/
|
|
499
|
-
const getProvider = (id) => PROVIDERS[id] || null;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Get provider options
|
|
503
|
-
*/
|
|
504
|
-
const getProviderOptions = (id) => {
|
|
505
|
-
const provider = PROVIDERS[id];
|
|
506
|
-
return provider ? provider.options : [];
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Get categories
|
|
511
|
-
*/
|
|
512
|
-
const getCategories = () => [
|
|
513
|
-
{ id: 'unified', name: 'UNIFIED (RECOMMENDED)', description: '1 API key for multiple models' },
|
|
514
|
-
{ id: 'direct', name: 'DIRECT PROVIDERS', description: 'Connect directly to each provider' },
|
|
515
|
-
{ id: 'local', name: 'LOCAL (FREE)', description: 'Run models on your machine' },
|
|
516
|
-
{ id: 'custom', name: 'CUSTOM', description: 'Self-hosted solutions' }
|
|
517
|
-
];
|
|
518
|
-
|
|
519
|
-
module.exports = {
|
|
520
|
-
PROVIDERS,
|
|
521
|
-
getProviders,
|
|
522
|
-
getProvidersByCategory,
|
|
523
|
-
getProvider,
|
|
524
|
-
getProviderOptions,
|
|
525
|
-
getCategories
|
|
526
|
-
};
|