@mupt-ai/dari-gateway 1.0.365 → 1.0.366
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 +1 -1
- package/dist/models/canonical.d.ts +7 -1
- package/dist/models/canonical.js +9 -1
- package/dist/models/canonical_models.json +151 -0
- package/dist/models/provider_models.json +476 -0
- package/dist/self_host/config.d.ts +5 -0
- package/dist/self_host/config.js +8 -1
- package/dist/self_host/main.js +2 -2
- package/dist/self_host/resolve.js +22 -11
- package/package.json +2 -2
- package/src/models/canonical.ts +15 -1
- package/src/models/canonical_models.json +151 -0
- package/src/models/provider_models.json +476 -0
- package/src/self_host/config.ts +9 -1
- package/src/self_host/main.ts +2 -2
- package/src/self_host/resolve.ts +17 -7
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ native_compaction: false
|
|
|
126
126
|
agents: { codex: [openai/gpt-6.1-sol] }
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
Each model lists its `sources`, tried in order: `plan` (connected subscriptions), `reset` (when those plans are out, spend a banked reset, but only if the plan would otherwise be out at least `reset_min_hours`, or the reset would expire first; only right after `plan`), and `api` (the provider's API key). A model without `sources` uses `[plan, api]` here; on hosted Dari a model without them uses `[plan]`. The gateway has no Dari credits. `hosted` settings and a model's `fast` apply only on hosted Dari and are ignored here; `routing.rules` runs only on hosted Dari and is refused. A model's `provider` must be one that serves it, such as `opencode-go` or `
|
|
129
|
+
Each model lists its `sources`, tried in order: `plan` (connected subscriptions), `reset` (when those plans are out, spend a banked reset, but only if the plan would otherwise be out at least `reset_min_hours`, or the reset would expire first; only right after `plan`), and `api` (the provider's API key). A model without `sources` uses `[plan, api]` here; on hosted Dari a model without them uses `[plan]`. The gateway has no Dari credits. `hosted` settings and a model's `fast` apply only on hosted Dari and are ignored here; `routing.rules` runs only on hosted Dari and is refused. A model's `provider` must be one that serves it, such as `opencode-go`, `fireworks`, `openrouter`, or `vercel-ai-gateway` for the DeepSeek, Kimi, and GLM models; the plan-only provider `vercel-token-pass` serves through a connected subscription. Without a `provider`, a model its maker serves uses its maker's key, and one its maker does not (an open-weights model) uses the first key of any provider that runs it, Fireworks first; `GET /v1/canonical-models` lists each model's `providers`.
|
|
130
130
|
|
|
131
131
|
With any gateway key:
|
|
132
132
|
|
|
@@ -3,11 +3,17 @@ export type CanonicalModel = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
maker: string;
|
|
5
5
|
thinking_levels: string[];
|
|
6
|
+
providers: string[];
|
|
6
7
|
};
|
|
7
8
|
/** The canonical models Dari serves, from the monorepo's router catalog. */
|
|
8
9
|
export declare const CANONICAL_MODELS: readonly CanonicalModel[];
|
|
9
10
|
/** A model's catalog name; a model the catalog does not list keeps its id. */
|
|
10
11
|
export declare function canonicalModelName(id: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The providers whose API keys may serve a model a router spec names no
|
|
14
|
+
* provider for; a model the catalog does not list is its id's provider's.
|
|
15
|
+
*/
|
|
16
|
+
export declare function modelKeyProviders(id: string): string[];
|
|
11
17
|
/** A canonical model as a provider other than the one its id names serves it. */
|
|
12
18
|
export type ProviderModel = {
|
|
13
19
|
model_id: string;
|
|
@@ -18,5 +24,5 @@ export type ProviderModel = {
|
|
|
18
24
|
};
|
|
19
25
|
/** How `provider` serves a model whose id names another provider, if it does. */
|
|
20
26
|
export declare function providerModel(modelId: string, provider: string): ProviderModel | undefined;
|
|
21
|
-
/** The providers besides the one its id names that serve a model. */
|
|
27
|
+
/** The providers and gateways besides the one its id names that serve a model. */
|
|
22
28
|
export declare function otherModelProviders(modelId: string): string[];
|
package/dist/models/canonical.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { providerForModel } from "@mupt-ai/dari-router/policy-engine";
|
|
1
2
|
import canonicalModels from "./canonical_models.json" with { type: "json" };
|
|
2
3
|
import providerModels from "./provider_models.json" with { type: "json" };
|
|
3
4
|
/** The canonical models Dari serves, from the monorepo's router catalog. */
|
|
@@ -6,12 +7,19 @@ export const CANONICAL_MODELS = canonicalModels;
|
|
|
6
7
|
export function canonicalModelName(id) {
|
|
7
8
|
return CANONICAL_MODELS.find((model) => model.id === id)?.name ?? id;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The providers whose API keys may serve a model a router spec names no
|
|
12
|
+
* provider for; a model the catalog does not list is its id's provider's.
|
|
13
|
+
*/
|
|
14
|
+
export function modelKeyProviders(id) {
|
|
15
|
+
return CANONICAL_MODELS.find((model) => model.id === id)?.providers ?? [providerForModel(id)];
|
|
16
|
+
}
|
|
9
17
|
const PROVIDER_MODELS = providerModels;
|
|
10
18
|
/** How `provider` serves a model whose id names another provider, if it does. */
|
|
11
19
|
export function providerModel(modelId, provider) {
|
|
12
20
|
return PROVIDER_MODELS.find((row) => row.model_id === modelId && row.provider === provider);
|
|
13
21
|
}
|
|
14
|
-
/** The providers besides the one its id names that serve a model. */
|
|
22
|
+
/** The providers and gateways besides the one its id names that serve a model. */
|
|
15
23
|
export function otherModelProviders(modelId) {
|
|
16
24
|
return PROVIDER_MODELS.filter((row) => row.model_id === modelId).map((row) => row.provider);
|
|
17
25
|
}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"high",
|
|
10
10
|
"xhigh",
|
|
11
11
|
"max"
|
|
12
|
+
],
|
|
13
|
+
"providers": [
|
|
14
|
+
"openai"
|
|
12
15
|
]
|
|
13
16
|
},
|
|
14
17
|
{
|
|
@@ -21,6 +24,9 @@
|
|
|
21
24
|
"high",
|
|
22
25
|
"xhigh",
|
|
23
26
|
"max"
|
|
27
|
+
],
|
|
28
|
+
"providers": [
|
|
29
|
+
"openai"
|
|
24
30
|
]
|
|
25
31
|
},
|
|
26
32
|
{
|
|
@@ -34,6 +40,9 @@
|
|
|
34
40
|
"high",
|
|
35
41
|
"xhigh",
|
|
36
42
|
"max"
|
|
43
|
+
],
|
|
44
|
+
"providers": [
|
|
45
|
+
"openai"
|
|
37
46
|
]
|
|
38
47
|
},
|
|
39
48
|
{
|
|
@@ -46,6 +55,9 @@
|
|
|
46
55
|
"high",
|
|
47
56
|
"xhigh",
|
|
48
57
|
"max"
|
|
58
|
+
],
|
|
59
|
+
"providers": [
|
|
60
|
+
"openai"
|
|
49
61
|
]
|
|
50
62
|
},
|
|
51
63
|
{
|
|
@@ -59,6 +71,9 @@
|
|
|
59
71
|
"high",
|
|
60
72
|
"xhigh",
|
|
61
73
|
"max"
|
|
74
|
+
],
|
|
75
|
+
"providers": [
|
|
76
|
+
"openai"
|
|
62
77
|
]
|
|
63
78
|
},
|
|
64
79
|
{
|
|
@@ -72,6 +87,9 @@
|
|
|
72
87
|
"high",
|
|
73
88
|
"xhigh",
|
|
74
89
|
"max"
|
|
90
|
+
],
|
|
91
|
+
"providers": [
|
|
92
|
+
"openai"
|
|
75
93
|
]
|
|
76
94
|
},
|
|
77
95
|
{
|
|
@@ -85,6 +103,9 @@
|
|
|
85
103
|
"high",
|
|
86
104
|
"xhigh",
|
|
87
105
|
"max"
|
|
106
|
+
],
|
|
107
|
+
"providers": [
|
|
108
|
+
"openai"
|
|
88
109
|
]
|
|
89
110
|
},
|
|
90
111
|
{
|
|
@@ -98,6 +119,9 @@
|
|
|
98
119
|
"high",
|
|
99
120
|
"xhigh",
|
|
100
121
|
"max"
|
|
122
|
+
],
|
|
123
|
+
"providers": [
|
|
124
|
+
"openai"
|
|
101
125
|
]
|
|
102
126
|
},
|
|
103
127
|
{
|
|
@@ -111,6 +135,9 @@
|
|
|
111
135
|
"high",
|
|
112
136
|
"xhigh",
|
|
113
137
|
"max"
|
|
138
|
+
],
|
|
139
|
+
"providers": [
|
|
140
|
+
"openai"
|
|
114
141
|
]
|
|
115
142
|
},
|
|
116
143
|
{
|
|
@@ -124,6 +151,9 @@
|
|
|
124
151
|
"high",
|
|
125
152
|
"xhigh",
|
|
126
153
|
"max"
|
|
154
|
+
],
|
|
155
|
+
"providers": [
|
|
156
|
+
"openai"
|
|
127
157
|
]
|
|
128
158
|
},
|
|
129
159
|
{
|
|
@@ -137,6 +167,9 @@
|
|
|
137
167
|
"high",
|
|
138
168
|
"xhigh",
|
|
139
169
|
"max"
|
|
170
|
+
],
|
|
171
|
+
"providers": [
|
|
172
|
+
"anthropic"
|
|
140
173
|
]
|
|
141
174
|
},
|
|
142
175
|
{
|
|
@@ -150,6 +183,9 @@
|
|
|
150
183
|
"high",
|
|
151
184
|
"xhigh",
|
|
152
185
|
"max"
|
|
186
|
+
],
|
|
187
|
+
"providers": [
|
|
188
|
+
"anthropic"
|
|
153
189
|
]
|
|
154
190
|
},
|
|
155
191
|
{
|
|
@@ -162,6 +198,9 @@
|
|
|
162
198
|
"high",
|
|
163
199
|
"xhigh",
|
|
164
200
|
"max"
|
|
201
|
+
],
|
|
202
|
+
"providers": [
|
|
203
|
+
"anthropic"
|
|
165
204
|
]
|
|
166
205
|
},
|
|
167
206
|
{
|
|
@@ -175,6 +214,9 @@
|
|
|
175
214
|
"high",
|
|
176
215
|
"xhigh",
|
|
177
216
|
"max"
|
|
217
|
+
],
|
|
218
|
+
"providers": [
|
|
219
|
+
"anthropic"
|
|
178
220
|
]
|
|
179
221
|
},
|
|
180
222
|
{
|
|
@@ -187,6 +229,9 @@
|
|
|
187
229
|
"high",
|
|
188
230
|
"xhigh",
|
|
189
231
|
"max"
|
|
232
|
+
],
|
|
233
|
+
"providers": [
|
|
234
|
+
"anthropic"
|
|
190
235
|
]
|
|
191
236
|
},
|
|
192
237
|
{
|
|
@@ -199,6 +244,9 @@
|
|
|
199
244
|
"high",
|
|
200
245
|
"xhigh",
|
|
201
246
|
"max"
|
|
247
|
+
],
|
|
248
|
+
"providers": [
|
|
249
|
+
"anthropic"
|
|
202
250
|
]
|
|
203
251
|
},
|
|
204
252
|
{
|
|
@@ -211,6 +259,9 @@
|
|
|
211
259
|
"high",
|
|
212
260
|
"xhigh",
|
|
213
261
|
"max"
|
|
262
|
+
],
|
|
263
|
+
"providers": [
|
|
264
|
+
"anthropic"
|
|
214
265
|
]
|
|
215
266
|
},
|
|
216
267
|
{
|
|
@@ -223,6 +274,9 @@
|
|
|
223
274
|
"high",
|
|
224
275
|
"xhigh",
|
|
225
276
|
"max"
|
|
277
|
+
],
|
|
278
|
+
"providers": [
|
|
279
|
+
"anthropic"
|
|
226
280
|
]
|
|
227
281
|
},
|
|
228
282
|
{
|
|
@@ -234,6 +288,9 @@
|
|
|
234
288
|
"low",
|
|
235
289
|
"medium",
|
|
236
290
|
"high"
|
|
291
|
+
],
|
|
292
|
+
"providers": [
|
|
293
|
+
"anthropic"
|
|
237
294
|
]
|
|
238
295
|
},
|
|
239
296
|
{
|
|
@@ -247,6 +304,9 @@
|
|
|
247
304
|
"high",
|
|
248
305
|
"xhigh",
|
|
249
306
|
"max"
|
|
307
|
+
],
|
|
308
|
+
"providers": [
|
|
309
|
+
"meta"
|
|
250
310
|
]
|
|
251
311
|
},
|
|
252
312
|
{
|
|
@@ -260,6 +320,9 @@
|
|
|
260
320
|
"high",
|
|
261
321
|
"xhigh",
|
|
262
322
|
"max"
|
|
323
|
+
],
|
|
324
|
+
"providers": [
|
|
325
|
+
"meta"
|
|
263
326
|
]
|
|
264
327
|
},
|
|
265
328
|
{
|
|
@@ -273,6 +336,9 @@
|
|
|
273
336
|
"high",
|
|
274
337
|
"xhigh",
|
|
275
338
|
"max"
|
|
339
|
+
],
|
|
340
|
+
"providers": [
|
|
341
|
+
"meta"
|
|
276
342
|
]
|
|
277
343
|
},
|
|
278
344
|
{
|
|
@@ -284,6 +350,11 @@
|
|
|
284
350
|
"medium",
|
|
285
351
|
"high",
|
|
286
352
|
"xhigh"
|
|
353
|
+
],
|
|
354
|
+
"providers": [
|
|
355
|
+
"fireworks",
|
|
356
|
+
"openrouter",
|
|
357
|
+
"vercel-ai-gateway"
|
|
287
358
|
]
|
|
288
359
|
},
|
|
289
360
|
{
|
|
@@ -296,6 +367,9 @@
|
|
|
296
367
|
"medium",
|
|
297
368
|
"high",
|
|
298
369
|
"xhigh"
|
|
370
|
+
],
|
|
371
|
+
"providers": [
|
|
372
|
+
"meta"
|
|
299
373
|
]
|
|
300
374
|
},
|
|
301
375
|
{
|
|
@@ -306,6 +380,13 @@
|
|
|
306
380
|
"low",
|
|
307
381
|
"high",
|
|
308
382
|
"max"
|
|
383
|
+
],
|
|
384
|
+
"providers": [
|
|
385
|
+
"fireworks",
|
|
386
|
+
"opencode-go",
|
|
387
|
+
"vercel-token-pass",
|
|
388
|
+
"openrouter",
|
|
389
|
+
"vercel-ai-gateway"
|
|
309
390
|
]
|
|
310
391
|
},
|
|
311
392
|
{
|
|
@@ -316,6 +397,13 @@
|
|
|
316
397
|
"low",
|
|
317
398
|
"high",
|
|
318
399
|
"max"
|
|
400
|
+
],
|
|
401
|
+
"providers": [
|
|
402
|
+
"fireworks",
|
|
403
|
+
"opencode-go",
|
|
404
|
+
"vercel-token-pass",
|
|
405
|
+
"openrouter",
|
|
406
|
+
"vercel-ai-gateway"
|
|
319
407
|
]
|
|
320
408
|
},
|
|
321
409
|
{
|
|
@@ -326,6 +414,13 @@
|
|
|
326
414
|
"low",
|
|
327
415
|
"high",
|
|
328
416
|
"max"
|
|
417
|
+
],
|
|
418
|
+
"providers": [
|
|
419
|
+
"fireworks",
|
|
420
|
+
"opencode-go",
|
|
421
|
+
"vercel-token-pass",
|
|
422
|
+
"openrouter",
|
|
423
|
+
"vercel-ai-gateway"
|
|
329
424
|
]
|
|
330
425
|
},
|
|
331
426
|
{
|
|
@@ -336,6 +431,13 @@
|
|
|
336
431
|
"low",
|
|
337
432
|
"high",
|
|
338
433
|
"max"
|
|
434
|
+
],
|
|
435
|
+
"providers": [
|
|
436
|
+
"fireworks",
|
|
437
|
+
"opencode-go",
|
|
438
|
+
"vercel-token-pass",
|
|
439
|
+
"openrouter",
|
|
440
|
+
"vercel-ai-gateway"
|
|
339
441
|
]
|
|
340
442
|
},
|
|
341
443
|
{
|
|
@@ -346,6 +448,11 @@
|
|
|
346
448
|
"off",
|
|
347
449
|
"high",
|
|
348
450
|
"max"
|
|
451
|
+
],
|
|
452
|
+
"providers": [
|
|
453
|
+
"fireworks",
|
|
454
|
+
"openrouter",
|
|
455
|
+
"vercel-ai-gateway"
|
|
349
456
|
]
|
|
350
457
|
},
|
|
351
458
|
{
|
|
@@ -356,6 +463,12 @@
|
|
|
356
463
|
"off",
|
|
357
464
|
"high",
|
|
358
465
|
"max"
|
|
466
|
+
],
|
|
467
|
+
"providers": [
|
|
468
|
+
"fireworks",
|
|
469
|
+
"opencode-go",
|
|
470
|
+
"openrouter",
|
|
471
|
+
"vercel-ai-gateway"
|
|
359
472
|
]
|
|
360
473
|
},
|
|
361
474
|
{
|
|
@@ -366,6 +479,11 @@
|
|
|
366
479
|
"off",
|
|
367
480
|
"high",
|
|
368
481
|
"max"
|
|
482
|
+
],
|
|
483
|
+
"providers": [
|
|
484
|
+
"fireworks",
|
|
485
|
+
"openrouter",
|
|
486
|
+
"vercel-ai-gateway"
|
|
369
487
|
]
|
|
370
488
|
},
|
|
371
489
|
{
|
|
@@ -376,6 +494,12 @@
|
|
|
376
494
|
"off",
|
|
377
495
|
"high",
|
|
378
496
|
"max"
|
|
497
|
+
],
|
|
498
|
+
"providers": [
|
|
499
|
+
"fireworks",
|
|
500
|
+
"opencode-go",
|
|
501
|
+
"openrouter",
|
|
502
|
+
"vercel-ai-gateway"
|
|
379
503
|
]
|
|
380
504
|
},
|
|
381
505
|
{
|
|
@@ -386,6 +510,12 @@
|
|
|
386
510
|
"off",
|
|
387
511
|
"high",
|
|
388
512
|
"max"
|
|
513
|
+
],
|
|
514
|
+
"providers": [
|
|
515
|
+
"fireworks",
|
|
516
|
+
"vercel-token-pass",
|
|
517
|
+
"openrouter",
|
|
518
|
+
"vercel-ai-gateway"
|
|
389
519
|
]
|
|
390
520
|
},
|
|
391
521
|
{
|
|
@@ -397,6 +527,9 @@
|
|
|
397
527
|
"medium",
|
|
398
528
|
"high",
|
|
399
529
|
"xhigh"
|
|
530
|
+
],
|
|
531
|
+
"providers": [
|
|
532
|
+
"xai"
|
|
400
533
|
]
|
|
401
534
|
},
|
|
402
535
|
{
|
|
@@ -408,6 +541,9 @@
|
|
|
408
541
|
"medium",
|
|
409
542
|
"high",
|
|
410
543
|
"xhigh"
|
|
544
|
+
],
|
|
545
|
+
"providers": [
|
|
546
|
+
"xai"
|
|
411
547
|
]
|
|
412
548
|
},
|
|
413
549
|
{
|
|
@@ -418,6 +554,9 @@
|
|
|
418
554
|
"low",
|
|
419
555
|
"medium",
|
|
420
556
|
"high"
|
|
557
|
+
],
|
|
558
|
+
"providers": [
|
|
559
|
+
"google"
|
|
421
560
|
]
|
|
422
561
|
},
|
|
423
562
|
{
|
|
@@ -428,6 +567,9 @@
|
|
|
428
567
|
"low",
|
|
429
568
|
"medium",
|
|
430
569
|
"high"
|
|
570
|
+
],
|
|
571
|
+
"providers": [
|
|
572
|
+
"google"
|
|
431
573
|
]
|
|
432
574
|
},
|
|
433
575
|
{
|
|
@@ -439,6 +581,9 @@
|
|
|
439
581
|
"medium",
|
|
440
582
|
"high",
|
|
441
583
|
"xhigh"
|
|
584
|
+
],
|
|
585
|
+
"providers": [
|
|
586
|
+
"google"
|
|
442
587
|
]
|
|
443
588
|
},
|
|
444
589
|
{
|
|
@@ -450,6 +595,9 @@
|
|
|
450
595
|
"medium",
|
|
451
596
|
"high",
|
|
452
597
|
"xhigh"
|
|
598
|
+
],
|
|
599
|
+
"providers": [
|
|
600
|
+
"google"
|
|
453
601
|
]
|
|
454
602
|
},
|
|
455
603
|
{
|
|
@@ -460,6 +608,9 @@
|
|
|
460
608
|
"low",
|
|
461
609
|
"medium",
|
|
462
610
|
"high"
|
|
611
|
+
],
|
|
612
|
+
"providers": [
|
|
613
|
+
"google"
|
|
463
614
|
]
|
|
464
615
|
}
|
|
465
616
|
]
|