@ai-sdk/deepinfra 3.0.99 → 3.0.100
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 +6 -0
- package/dist/index.d.ts +500 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +508 -579
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/deepinfra-model-catalog.ts +616 -363
|
@@ -4,71 +4,12 @@ import type {
|
|
|
4
4
|
OpenAICompatibleEmbeddingModelOptions,
|
|
5
5
|
} from '@ai-sdk/openai-compatible';
|
|
6
6
|
import type {
|
|
7
|
-
|
|
7
|
+
ModelCapability,
|
|
8
8
|
ModelEntry,
|
|
9
9
|
ProviderOptionDefinition,
|
|
10
10
|
ProviderOptionDefinitions,
|
|
11
11
|
} from '@ai-sdk/provider';
|
|
12
12
|
import type { DeepInfraImageModelOptions } from './deepinfra-image-model-options';
|
|
13
|
-
const imageDetails: Partial<
|
|
14
|
-
Record<string, { dimensionSpecification: string; notes: string }>
|
|
15
|
-
> = {
|
|
16
|
-
'stabilityai/sd3.5': {
|
|
17
|
-
dimensionSpecification: 'Aspect Ratio',
|
|
18
|
-
notes: 'Premium quality base model, 8B parameters',
|
|
19
|
-
},
|
|
20
|
-
'black-forest-labs/FLUX-1.1-pro': {
|
|
21
|
-
dimensionSpecification: 'Size',
|
|
22
|
-
notes: 'Latest state-of-art model with superior prompt following',
|
|
23
|
-
},
|
|
24
|
-
'black-forest-labs/FLUX-1-schnell': {
|
|
25
|
-
dimensionSpecification: 'Size',
|
|
26
|
-
notes: 'Fast generation in 1-4 steps',
|
|
27
|
-
},
|
|
28
|
-
'black-forest-labs/FLUX-1-dev': {
|
|
29
|
-
dimensionSpecification: 'Size',
|
|
30
|
-
notes: 'Optimized for anatomical accuracy',
|
|
31
|
-
},
|
|
32
|
-
'black-forest-labs/FLUX-pro': {
|
|
33
|
-
dimensionSpecification: 'Size',
|
|
34
|
-
notes: 'Flagship Flux model',
|
|
35
|
-
},
|
|
36
|
-
'black-forest-labs/FLUX.1-Kontext-dev': {
|
|
37
|
-
dimensionSpecification: 'Size',
|
|
38
|
-
notes: 'Image editing and transformation model',
|
|
39
|
-
},
|
|
40
|
-
'black-forest-labs/FLUX.1-Kontext-pro': {
|
|
41
|
-
dimensionSpecification: 'Size',
|
|
42
|
-
notes: 'Professional image editing and transformation',
|
|
43
|
-
},
|
|
44
|
-
'stabilityai/sd3.5-medium': {
|
|
45
|
-
dimensionSpecification: 'Aspect Ratio',
|
|
46
|
-
notes: 'Balanced 2.5B parameter model',
|
|
47
|
-
},
|
|
48
|
-
'stabilityai/sdxl-turbo': {
|
|
49
|
-
dimensionSpecification: 'Aspect Ratio',
|
|
50
|
-
notes: 'Optimized for fast generation',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
const embeddingTokenLimits: Partial<Record<string, number>> = {
|
|
54
|
-
'BAAI/bge-base-en-v1.5': 512,
|
|
55
|
-
'BAAI/bge-large-en-v1.5': 512,
|
|
56
|
-
'BAAI/bge-m3': 8192,
|
|
57
|
-
'intfloat/e5-base-v2': 512,
|
|
58
|
-
'intfloat/e5-large-v2': 512,
|
|
59
|
-
'intfloat/multilingual-e5-large': 512,
|
|
60
|
-
'sentence-transformers/all-MiniLM-L12-v2': 256,
|
|
61
|
-
'sentence-transformers/all-MiniLM-L6-v2': 256,
|
|
62
|
-
'sentence-transformers/all-mpnet-base-v2': 384,
|
|
63
|
-
'sentence-transformers/clip-ViT-B-32': 77,
|
|
64
|
-
'sentence-transformers/clip-ViT-B-32-multilingual-v1': 77,
|
|
65
|
-
'sentence-transformers/multi-qa-mpnet-base-dot-v1': 512,
|
|
66
|
-
'sentence-transformers/paraphrase-MiniLM-L6-v2': 128,
|
|
67
|
-
'shibing624/text2vec-base-chinese': 512,
|
|
68
|
-
'thenlper/gte-base': 512,
|
|
69
|
-
'thenlper/gte-large': 512,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
13
|
const compatiblelanguageProviderOptions = {
|
|
73
14
|
user: {
|
|
74
15
|
description:
|
|
@@ -133,298 +74,406 @@ export const deepInfraProviderOptions = {
|
|
|
133
74
|
>,
|
|
134
75
|
} as const satisfies ProviderOptionDefinitions;
|
|
135
76
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
'
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
'
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
'
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
'
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
'
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
'
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
'
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
'
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
'
|
|
231
|
-
|
|
232
|
-
'black-forest-labs/FLUX.1-Kontext-pro',
|
|
233
|
-
'stabilityai/sd3.5-medium',
|
|
234
|
-
'stabilityai/sdxl-turbo',
|
|
235
|
-
] as const;
|
|
236
|
-
const documentedLanguageCapabilities: Record<
|
|
237
|
-
string,
|
|
238
|
-
NonNullable<ModelCapabilities['language']>
|
|
239
|
-
> = {
|
|
240
|
-
'meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8': {
|
|
241
|
-
inputs: { image: true, audio: 'unknown' },
|
|
77
|
+
type FunctionTools = 'unknown' | false | readonly 'streaming'[];
|
|
78
|
+
|
|
79
|
+
function toolCapabilities(functionTools: FunctionTools) {
|
|
80
|
+
return {
|
|
81
|
+
usage: functionTools === 'unknown' ? 'unknown' : functionTools !== false,
|
|
82
|
+
streaming:
|
|
83
|
+
functionTools === 'unknown'
|
|
84
|
+
? 'unknown'
|
|
85
|
+
: functionTools !== false && functionTools.includes('streaming'),
|
|
86
|
+
} as const;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Language models
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* One row of the language model matrix. Every capability that differs between
|
|
93
|
+
* models is one flat cell, and every listed model fills in every cell. Nothing
|
|
94
|
+
* is derived from the model ID.
|
|
95
|
+
*
|
|
96
|
+
* Facts that depend on each other share one cell, so a row cannot contradict
|
|
97
|
+
* itself: a cell is a single value, one of a fixed set of values, or the list
|
|
98
|
+
* of what the model supports.
|
|
99
|
+
*/
|
|
100
|
+
export type DeepInfraLanguageModelRow = {
|
|
101
|
+
image: ModelCapability;
|
|
102
|
+
objectGeneration: ModelCapability;
|
|
103
|
+
/**
|
|
104
|
+
* `false`: the model does not call function tools. Otherwise it does, and
|
|
105
|
+
* the list holds what it supports on top of that: `streaming` means it
|
|
106
|
+
* also calls tools in a streamed response. `'unknown'`: not documented.
|
|
107
|
+
*/
|
|
108
|
+
functionTools: FunctionTools;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Language model matrix: model IDs by capability. To add a model, add a row
|
|
113
|
+
* and fill in every column.
|
|
114
|
+
*/
|
|
115
|
+
const languageModelDefinitions = {
|
|
116
|
+
'01-ai/Yi-34B-Chat': {
|
|
117
|
+
image: 'unknown',
|
|
118
|
+
objectGeneration: 'unknown',
|
|
119
|
+
functionTools: 'unknown',
|
|
120
|
+
},
|
|
121
|
+
'Austism/chronos-hermes-13b-v2': {
|
|
122
|
+
image: 'unknown',
|
|
123
|
+
objectGeneration: 'unknown',
|
|
124
|
+
functionTools: 'unknown',
|
|
125
|
+
},
|
|
126
|
+
'bigcode/starcoder2-15b-instruct-v0.1': {
|
|
127
|
+
image: 'unknown',
|
|
128
|
+
objectGeneration: 'unknown',
|
|
129
|
+
functionTools: 'unknown',
|
|
130
|
+
},
|
|
131
|
+
'bigcode/starcoder2-15b': {
|
|
132
|
+
image: 'unknown',
|
|
133
|
+
objectGeneration: 'unknown',
|
|
134
|
+
functionTools: 'unknown',
|
|
135
|
+
},
|
|
136
|
+
'codellama/CodeLlama-34b-Instruct-hf': {
|
|
137
|
+
image: 'unknown',
|
|
138
|
+
objectGeneration: 'unknown',
|
|
139
|
+
functionTools: 'unknown',
|
|
140
|
+
},
|
|
141
|
+
'codellama/CodeLlama-70b-Instruct-hf': {
|
|
142
|
+
image: 'unknown',
|
|
143
|
+
objectGeneration: 'unknown',
|
|
144
|
+
functionTools: 'unknown',
|
|
145
|
+
},
|
|
146
|
+
'cognitivecomputations/dolphin-2.6-mixtral-8x7b': {
|
|
147
|
+
image: 'unknown',
|
|
148
|
+
objectGeneration: 'unknown',
|
|
149
|
+
functionTools: 'unknown',
|
|
150
|
+
},
|
|
151
|
+
'cognitivecomputations/dolphin-2.9.1-llama-3-70b': {
|
|
152
|
+
image: 'unknown',
|
|
153
|
+
objectGeneration: 'unknown',
|
|
154
|
+
functionTools: 'unknown',
|
|
155
|
+
},
|
|
156
|
+
'databricks/dbrx-instruct': {
|
|
157
|
+
image: 'unknown',
|
|
158
|
+
objectGeneration: 'unknown',
|
|
159
|
+
functionTools: 'unknown',
|
|
160
|
+
},
|
|
161
|
+
'deepinfra/airoboros-70b': {
|
|
162
|
+
image: 'unknown',
|
|
163
|
+
objectGeneration: 'unknown',
|
|
164
|
+
functionTools: 'unknown',
|
|
165
|
+
},
|
|
166
|
+
'deepseek-ai/DeepSeek-V3': {
|
|
167
|
+
image: false,
|
|
168
|
+
objectGeneration: true,
|
|
169
|
+
functionTools: ['streaming'],
|
|
170
|
+
},
|
|
171
|
+
'deepseek-ai/DeepSeek-R1': {
|
|
172
|
+
image: false,
|
|
242
173
|
objectGeneration: false,
|
|
243
|
-
|
|
244
|
-
reasoning: { support: 'unknown' },
|
|
245
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
174
|
+
functionTools: false,
|
|
246
175
|
},
|
|
247
|
-
'
|
|
248
|
-
|
|
176
|
+
'deepseek-ai/DeepSeek-R1-Distill-Llama-70B': {
|
|
177
|
+
image: false,
|
|
178
|
+
objectGeneration: false,
|
|
179
|
+
functionTools: false,
|
|
180
|
+
},
|
|
181
|
+
'deepseek-ai/DeepSeek-R1-Turbo': {
|
|
182
|
+
image: false,
|
|
183
|
+
objectGeneration: false,
|
|
184
|
+
functionTools: false,
|
|
185
|
+
},
|
|
186
|
+
'google/codegemma-7b-it': {
|
|
187
|
+
image: false,
|
|
188
|
+
objectGeneration: false,
|
|
189
|
+
functionTools: false,
|
|
190
|
+
},
|
|
191
|
+
'google/gemma-1.1-7b-it': {
|
|
192
|
+
image: 'unknown',
|
|
193
|
+
objectGeneration: 'unknown',
|
|
194
|
+
functionTools: 'unknown',
|
|
195
|
+
},
|
|
196
|
+
'google/gemma-2-27b-it': {
|
|
197
|
+
image: 'unknown',
|
|
198
|
+
objectGeneration: 'unknown',
|
|
199
|
+
functionTools: 'unknown',
|
|
200
|
+
},
|
|
201
|
+
'google/gemma-2-9b-it': {
|
|
202
|
+
image: false,
|
|
249
203
|
objectGeneration: false,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
204
|
+
functionTools: false,
|
|
205
|
+
},
|
|
206
|
+
'Gryphe/MythoMax-L2-13b-turbo': {
|
|
207
|
+
image: 'unknown',
|
|
208
|
+
objectGeneration: 'unknown',
|
|
209
|
+
functionTools: 'unknown',
|
|
210
|
+
},
|
|
211
|
+
'Gryphe/MythoMax-L2-13b': {
|
|
212
|
+
image: 'unknown',
|
|
213
|
+
objectGeneration: 'unknown',
|
|
214
|
+
functionTools: 'unknown',
|
|
215
|
+
},
|
|
216
|
+
'HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1': {
|
|
217
|
+
image: 'unknown',
|
|
218
|
+
objectGeneration: 'unknown',
|
|
219
|
+
functionTools: 'unknown',
|
|
220
|
+
},
|
|
221
|
+
'KoboldAI/LLaMA2-13B-Tiefighter': {
|
|
222
|
+
image: 'unknown',
|
|
223
|
+
objectGeneration: 'unknown',
|
|
224
|
+
functionTools: 'unknown',
|
|
225
|
+
},
|
|
226
|
+
'lizpreciatior/lzlv_70b_fp16_hf': {
|
|
227
|
+
image: 'unknown',
|
|
228
|
+
objectGeneration: 'unknown',
|
|
229
|
+
functionTools: 'unknown',
|
|
230
|
+
},
|
|
231
|
+
'mattshumer/Reflection-Llama-3.1-70B': {
|
|
232
|
+
image: 'unknown',
|
|
233
|
+
objectGeneration: 'unknown',
|
|
234
|
+
functionTools: 'unknown',
|
|
235
|
+
},
|
|
236
|
+
'meta-llama/Llama-2-13b-chat-hf': {
|
|
237
|
+
image: 'unknown',
|
|
238
|
+
objectGeneration: 'unknown',
|
|
239
|
+
functionTools: 'unknown',
|
|
240
|
+
},
|
|
241
|
+
'meta-llama/Llama-2-70b-chat-hf': {
|
|
242
|
+
image: 'unknown',
|
|
243
|
+
objectGeneration: 'unknown',
|
|
244
|
+
functionTools: 'unknown',
|
|
245
|
+
},
|
|
246
|
+
'meta-llama/Llama-2-7b-chat-hf': {
|
|
247
|
+
image: 'unknown',
|
|
248
|
+
objectGeneration: 'unknown',
|
|
249
|
+
functionTools: 'unknown',
|
|
250
|
+
},
|
|
251
|
+
'meta-llama/Llama-3.2-11B-Vision-Instruct': {
|
|
252
|
+
image: true,
|
|
253
|
+
objectGeneration: true,
|
|
254
|
+
functionTools: false,
|
|
255
|
+
},
|
|
256
|
+
'meta-llama/Llama-3.2-1B-Instruct': {
|
|
257
|
+
image: 'unknown',
|
|
258
|
+
objectGeneration: 'unknown',
|
|
259
|
+
functionTools: 'unknown',
|
|
260
|
+
},
|
|
261
|
+
'meta-llama/Llama-3.2-3B-Instruct': {
|
|
262
|
+
image: 'unknown',
|
|
263
|
+
objectGeneration: 'unknown',
|
|
264
|
+
functionTools: 'unknown',
|
|
265
|
+
},
|
|
266
|
+
'meta-llama/Llama-3.2-90B-Vision-Instruct': {
|
|
267
|
+
image: true,
|
|
268
|
+
objectGeneration: true,
|
|
269
|
+
functionTools: false,
|
|
253
270
|
},
|
|
254
271
|
'meta-llama/Llama-3.3-70B-Instruct-Turbo': {
|
|
255
|
-
|
|
272
|
+
image: false,
|
|
256
273
|
objectGeneration: true,
|
|
257
|
-
|
|
258
|
-
reasoning: { support: 'unknown' },
|
|
259
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
274
|
+
functionTools: ['streaming'],
|
|
260
275
|
},
|
|
261
276
|
'meta-llama/Llama-3.3-70B-Instruct': {
|
|
262
|
-
|
|
277
|
+
image: false,
|
|
263
278
|
objectGeneration: true,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
279
|
+
functionTools: ['streaming'],
|
|
280
|
+
},
|
|
281
|
+
'meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8': {
|
|
282
|
+
image: true,
|
|
283
|
+
objectGeneration: false,
|
|
284
|
+
functionTools: false,
|
|
285
|
+
},
|
|
286
|
+
'meta-llama/Llama-4-Scout-17B-16E-Instruct': {
|
|
287
|
+
image: true,
|
|
288
|
+
objectGeneration: false,
|
|
289
|
+
functionTools: false,
|
|
290
|
+
},
|
|
291
|
+
'meta-llama/Meta-Llama-3-70B-Instruct': {
|
|
292
|
+
image: 'unknown',
|
|
293
|
+
objectGeneration: 'unknown',
|
|
294
|
+
functionTools: 'unknown',
|
|
295
|
+
},
|
|
296
|
+
'meta-llama/Meta-Llama-3-8B-Instruct': {
|
|
297
|
+
image: 'unknown',
|
|
298
|
+
objectGeneration: 'unknown',
|
|
299
|
+
functionTools: 'unknown',
|
|
267
300
|
},
|
|
268
301
|
'meta-llama/Meta-Llama-3.1-405B-Instruct': {
|
|
269
|
-
|
|
302
|
+
image: false,
|
|
270
303
|
objectGeneration: true,
|
|
271
|
-
|
|
272
|
-
reasoning: { support: 'unknown' },
|
|
273
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
304
|
+
functionTools: ['streaming'],
|
|
274
305
|
},
|
|
275
306
|
'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo': {
|
|
276
|
-
|
|
307
|
+
image: false,
|
|
277
308
|
objectGeneration: true,
|
|
278
|
-
|
|
279
|
-
reasoning: { support: 'unknown' },
|
|
280
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
309
|
+
functionTools: ['streaming'],
|
|
281
310
|
},
|
|
282
311
|
'meta-llama/Meta-Llama-3.1-70B-Instruct': {
|
|
283
|
-
|
|
312
|
+
image: false,
|
|
284
313
|
objectGeneration: true,
|
|
285
|
-
|
|
286
|
-
reasoning: { support: 'unknown' },
|
|
287
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
314
|
+
functionTools: ['streaming'],
|
|
288
315
|
},
|
|
289
316
|
'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo': {
|
|
290
|
-
|
|
317
|
+
image: false,
|
|
291
318
|
objectGeneration: true,
|
|
292
|
-
|
|
293
|
-
reasoning: { support: 'unknown' },
|
|
294
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
319
|
+
functionTools: [],
|
|
295
320
|
},
|
|
296
321
|
'meta-llama/Meta-Llama-3.1-8B-Instruct': {
|
|
297
|
-
|
|
322
|
+
image: false,
|
|
298
323
|
objectGeneration: true,
|
|
299
|
-
|
|
300
|
-
reasoning: { support: 'unknown' },
|
|
301
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
324
|
+
functionTools: ['streaming'],
|
|
302
325
|
},
|
|
303
|
-
'
|
|
304
|
-
|
|
305
|
-
objectGeneration:
|
|
306
|
-
|
|
307
|
-
reasoning: { support: 'unknown' },
|
|
308
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
326
|
+
'microsoft/Phi-3-medium-4k-instruct': {
|
|
327
|
+
image: 'unknown',
|
|
328
|
+
objectGeneration: 'unknown',
|
|
329
|
+
functionTools: 'unknown',
|
|
309
330
|
},
|
|
310
|
-
'
|
|
311
|
-
|
|
312
|
-
objectGeneration:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
331
|
+
'microsoft/WizardLM-2-7B': {
|
|
332
|
+
image: 'unknown',
|
|
333
|
+
objectGeneration: 'unknown',
|
|
334
|
+
functionTools: 'unknown',
|
|
335
|
+
},
|
|
336
|
+
'microsoft/WizardLM-2-8x22B': {
|
|
337
|
+
image: false,
|
|
338
|
+
objectGeneration: false,
|
|
339
|
+
functionTools: false,
|
|
340
|
+
},
|
|
341
|
+
'mistralai/Mistral-7B-Instruct-v0.1': {
|
|
342
|
+
image: 'unknown',
|
|
343
|
+
objectGeneration: 'unknown',
|
|
344
|
+
functionTools: 'unknown',
|
|
345
|
+
},
|
|
346
|
+
'mistralai/Mistral-7B-Instruct-v0.2': {
|
|
347
|
+
image: 'unknown',
|
|
348
|
+
objectGeneration: 'unknown',
|
|
349
|
+
functionTools: 'unknown',
|
|
350
|
+
},
|
|
351
|
+
'mistralai/Mistral-7B-Instruct-v0.3': {
|
|
352
|
+
image: 'unknown',
|
|
353
|
+
objectGeneration: 'unknown',
|
|
354
|
+
functionTools: 'unknown',
|
|
355
|
+
},
|
|
356
|
+
'mistralai/Mistral-Nemo-Instruct-2407': {
|
|
357
|
+
image: 'unknown',
|
|
358
|
+
objectGeneration: 'unknown',
|
|
359
|
+
functionTools: 'unknown',
|
|
360
|
+
},
|
|
361
|
+
'mistralai/Mixtral-8x22B-Instruct-v0.1': {
|
|
362
|
+
image: 'unknown',
|
|
363
|
+
objectGeneration: 'unknown',
|
|
364
|
+
functionTools: 'unknown',
|
|
365
|
+
},
|
|
366
|
+
'mistralai/Mixtral-8x22B-v0.1': {
|
|
367
|
+
image: 'unknown',
|
|
368
|
+
objectGeneration: 'unknown',
|
|
369
|
+
functionTools: 'unknown',
|
|
316
370
|
},
|
|
317
371
|
'mistralai/Mixtral-8x7B-Instruct-v0.1': {
|
|
318
|
-
|
|
372
|
+
image: false,
|
|
319
373
|
objectGeneration: true,
|
|
320
|
-
|
|
321
|
-
reasoning: { support: 'unknown' },
|
|
322
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
374
|
+
functionTools: [],
|
|
323
375
|
},
|
|
324
|
-
'
|
|
325
|
-
|
|
376
|
+
'NousResearch/Hermes-3-Llama-3.1-405B': {
|
|
377
|
+
image: 'unknown',
|
|
378
|
+
objectGeneration: 'unknown',
|
|
379
|
+
functionTools: 'unknown',
|
|
380
|
+
},
|
|
381
|
+
'nvidia/Llama-3.1-Nemotron-70B-Instruct': {
|
|
382
|
+
image: false,
|
|
326
383
|
objectGeneration: true,
|
|
327
|
-
|
|
328
|
-
reasoning: { support: 'unknown' },
|
|
329
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
384
|
+
functionTools: [],
|
|
330
385
|
},
|
|
331
|
-
'
|
|
332
|
-
|
|
333
|
-
objectGeneration:
|
|
334
|
-
|
|
335
|
-
reasoning: { support: 'unknown' },
|
|
336
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
386
|
+
'nvidia/Nemotron-4-340B-Instruct': {
|
|
387
|
+
image: 'unknown',
|
|
388
|
+
objectGeneration: 'unknown',
|
|
389
|
+
functionTools: 'unknown',
|
|
337
390
|
},
|
|
338
|
-
'
|
|
339
|
-
|
|
340
|
-
objectGeneration:
|
|
341
|
-
|
|
342
|
-
reasoning: { support: 'unknown' },
|
|
343
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
391
|
+
'openbmb/MiniCPM-Llama3-V-2_5': {
|
|
392
|
+
image: 'unknown',
|
|
393
|
+
objectGeneration: 'unknown',
|
|
394
|
+
functionTools: 'unknown',
|
|
344
395
|
},
|
|
345
|
-
'
|
|
346
|
-
|
|
347
|
-
objectGeneration:
|
|
348
|
-
|
|
349
|
-
reasoning: { support: 'unknown' },
|
|
350
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
396
|
+
'openchat/openchat_3.5': {
|
|
397
|
+
image: 'unknown',
|
|
398
|
+
objectGeneration: 'unknown',
|
|
399
|
+
functionTools: 'unknown',
|
|
351
400
|
},
|
|
352
|
-
'
|
|
353
|
-
|
|
354
|
-
objectGeneration:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
401
|
+
'openchat/openchat-3.6-8b': {
|
|
402
|
+
image: 'unknown',
|
|
403
|
+
objectGeneration: 'unknown',
|
|
404
|
+
functionTools: 'unknown',
|
|
405
|
+
},
|
|
406
|
+
'Phind/Phind-CodeLlama-34B-v2': {
|
|
407
|
+
image: 'unknown',
|
|
408
|
+
objectGeneration: 'unknown',
|
|
409
|
+
functionTools: 'unknown',
|
|
410
|
+
},
|
|
411
|
+
'Qwen/Qwen2-72B-Instruct': {
|
|
412
|
+
image: 'unknown',
|
|
413
|
+
objectGeneration: 'unknown',
|
|
414
|
+
functionTools: 'unknown',
|
|
358
415
|
},
|
|
359
416
|
'Qwen/Qwen2-7B-Instruct': {
|
|
360
|
-
|
|
417
|
+
image: false,
|
|
361
418
|
objectGeneration: true,
|
|
362
|
-
|
|
363
|
-
reasoning: { support: 'unknown' },
|
|
364
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
419
|
+
functionTools: false,
|
|
365
420
|
},
|
|
366
421
|
'Qwen/Qwen2.5-72B-Instruct': {
|
|
367
|
-
|
|
422
|
+
image: false,
|
|
368
423
|
objectGeneration: true,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
424
|
+
functionTools: ['streaming'],
|
|
425
|
+
},
|
|
426
|
+
'Qwen/Qwen2.5-7B-Instruct': {
|
|
427
|
+
image: 'unknown',
|
|
428
|
+
objectGeneration: 'unknown',
|
|
429
|
+
functionTools: 'unknown',
|
|
372
430
|
},
|
|
373
431
|
'Qwen/Qwen2.5-Coder-32B-Instruct': {
|
|
374
|
-
|
|
432
|
+
image: false,
|
|
375
433
|
objectGeneration: true,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
434
|
+
functionTools: false,
|
|
435
|
+
},
|
|
436
|
+
'Qwen/Qwen2.5-Coder-7B': {
|
|
437
|
+
image: 'unknown',
|
|
438
|
+
objectGeneration: 'unknown',
|
|
439
|
+
functionTools: 'unknown',
|
|
379
440
|
},
|
|
380
441
|
'Qwen/QwQ-32B-Preview': {
|
|
381
|
-
|
|
442
|
+
image: false,
|
|
382
443
|
objectGeneration: true,
|
|
383
|
-
|
|
384
|
-
reasoning: { support: 'unknown' },
|
|
385
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
444
|
+
functionTools: false,
|
|
386
445
|
},
|
|
387
|
-
'
|
|
388
|
-
|
|
389
|
-
objectGeneration:
|
|
390
|
-
|
|
391
|
-
reasoning: { support: 'unknown' },
|
|
392
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
446
|
+
'Sao10K/L3-70B-Euryale-v2.1': {
|
|
447
|
+
image: 'unknown',
|
|
448
|
+
objectGeneration: 'unknown',
|
|
449
|
+
functionTools: 'unknown',
|
|
393
450
|
},
|
|
394
|
-
'
|
|
395
|
-
|
|
396
|
-
objectGeneration:
|
|
397
|
-
|
|
398
|
-
reasoning: { support: 'unknown' },
|
|
399
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
451
|
+
'Sao10K/L3-8B-Lunaris-v1': {
|
|
452
|
+
image: 'unknown',
|
|
453
|
+
objectGeneration: 'unknown',
|
|
454
|
+
functionTools: 'unknown',
|
|
400
455
|
},
|
|
401
|
-
'
|
|
402
|
-
|
|
403
|
-
objectGeneration:
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
(typeof languageModelIds)[number],
|
|
411
|
-
NonNullable<ModelCapabilities['language']>
|
|
412
|
-
>
|
|
413
|
-
>;
|
|
414
|
-
const unknownLanguageCapabilities: NonNullable<ModelCapabilities['language']> =
|
|
415
|
-
{
|
|
416
|
-
inputs: { image: 'unknown', audio: 'unknown' },
|
|
417
|
-
objectGeneration: 'unknown',
|
|
418
|
-
tools: { usage: 'unknown', streaming: 'unknown' },
|
|
419
|
-
reasoning: { support: 'unknown' },
|
|
420
|
-
sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
|
|
421
|
-
};
|
|
422
|
-
export function getDeepInfraLanguageModelEntry(modelId: string) {
|
|
456
|
+
'Sao10K/L3.1-70B-Euryale-v2.2': {
|
|
457
|
+
image: 'unknown',
|
|
458
|
+
objectGeneration: 'unknown',
|
|
459
|
+
functionTools: 'unknown',
|
|
460
|
+
},
|
|
461
|
+
} satisfies Record<string, DeepInfraLanguageModelRow>;
|
|
462
|
+
|
|
463
|
+
/** Maps a matrix row to its entry. Nothing here inspects the model ID. */
|
|
464
|
+
function createLanguageModelEntry(row: DeepInfraLanguageModelRow) {
|
|
423
465
|
const entry = {
|
|
424
466
|
capabilities: {
|
|
425
467
|
language: {
|
|
426
|
-
|
|
427
|
-
|
|
468
|
+
inputs: { image: row.image, audio: 'unknown' },
|
|
469
|
+
objectGeneration: row.objectGeneration,
|
|
470
|
+
tools: toolCapabilities(row.functionTools),
|
|
471
|
+
reasoning: { support: 'unknown' },
|
|
472
|
+
sampling: {
|
|
473
|
+
temperature: 'unknown',
|
|
474
|
+
topP: 'unknown',
|
|
475
|
+
logprobs: 'unknown',
|
|
476
|
+
},
|
|
428
477
|
structuredOutput: { jsonSchema: true },
|
|
429
478
|
},
|
|
430
479
|
},
|
|
@@ -439,20 +488,125 @@ export function getDeepInfraLanguageModelEntry(modelId: string) {
|
|
|
439
488
|
} as const;
|
|
440
489
|
return entry satisfies ModelEntry;
|
|
441
490
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
'
|
|
452
|
-
'
|
|
491
|
+
|
|
492
|
+
const listedLanguageModelEntries = Object.fromEntries(
|
|
493
|
+
Object.entries<DeepInfraLanguageModelRow>(languageModelDefinitions).map(
|
|
494
|
+
([modelId, row]) => [modelId, createLanguageModelEntry(row)],
|
|
495
|
+
),
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
/** Row for every language model ID that is not listed in the matrix. */
|
|
499
|
+
const unlistedLanguageModelRow: DeepInfraLanguageModelRow = {
|
|
500
|
+
image: 'unknown',
|
|
501
|
+
objectGeneration: 'unknown',
|
|
502
|
+
functionTools: 'unknown',
|
|
453
503
|
};
|
|
454
|
-
|
|
455
|
-
|
|
504
|
+
|
|
505
|
+
export function getDeepInfraLanguageModelEntry(modelId: string) {
|
|
506
|
+
return Object.prototype.hasOwnProperty.call(
|
|
507
|
+
listedLanguageModelEntries,
|
|
508
|
+
modelId,
|
|
509
|
+
)
|
|
510
|
+
? listedLanguageModelEntries[modelId]
|
|
511
|
+
: createLanguageModelEntry(unlistedLanguageModelRow);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// Image models
|
|
515
|
+
|
|
516
|
+
/** One row of the image model matrix. Nothing is derived from the model ID. */
|
|
517
|
+
export type DeepInfraImageModelRow = {
|
|
518
|
+
/** Listed in the image model ID type. It does not change a request. */
|
|
519
|
+
inModelIdType: boolean;
|
|
520
|
+
fileInput: boolean | 'unknown';
|
|
521
|
+
maskInput: boolean | 'unknown';
|
|
522
|
+
/**
|
|
523
|
+
* How the output size is given, for the generated documentation.
|
|
524
|
+
* `'unknown'`: not documented.
|
|
525
|
+
*/
|
|
526
|
+
dimensionSpecification: 'Size' | 'Aspect Ratio' | 'unknown';
|
|
527
|
+
/** Notes for the generated documentation. `false`: none. */
|
|
528
|
+
notes: string | false;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Image model matrix: model IDs by capability. To add a model, add a row and
|
|
533
|
+
* fill in every column.
|
|
534
|
+
*/
|
|
535
|
+
const imageModelDefinitions = {
|
|
536
|
+
'stabilityai/sd3.5': {
|
|
537
|
+
inModelIdType: true,
|
|
538
|
+
fileInput: true,
|
|
539
|
+
maskInput: true,
|
|
540
|
+
dimensionSpecification: 'Aspect Ratio',
|
|
541
|
+
notes: 'Premium quality base model, 8B parameters',
|
|
542
|
+
},
|
|
543
|
+
'black-forest-labs/FLUX-1.1-pro': {
|
|
544
|
+
inModelIdType: true,
|
|
545
|
+
fileInput: true,
|
|
546
|
+
maskInput: true,
|
|
547
|
+
dimensionSpecification: 'Size',
|
|
548
|
+
notes: 'Latest state-of-art model with superior prompt following',
|
|
549
|
+
},
|
|
550
|
+
'black-forest-labs/FLUX-1-schnell': {
|
|
551
|
+
inModelIdType: true,
|
|
552
|
+
fileInput: true,
|
|
553
|
+
maskInput: true,
|
|
554
|
+
dimensionSpecification: 'Size',
|
|
555
|
+
notes: 'Fast generation in 1-4 steps',
|
|
556
|
+
},
|
|
557
|
+
'black-forest-labs/FLUX-1-dev': {
|
|
558
|
+
inModelIdType: true,
|
|
559
|
+
fileInput: true,
|
|
560
|
+
maskInput: true,
|
|
561
|
+
dimensionSpecification: 'Size',
|
|
562
|
+
notes: 'Optimized for anatomical accuracy',
|
|
563
|
+
},
|
|
564
|
+
'black-forest-labs/FLUX-pro': {
|
|
565
|
+
inModelIdType: true,
|
|
566
|
+
fileInput: true,
|
|
567
|
+
maskInput: true,
|
|
568
|
+
dimensionSpecification: 'Size',
|
|
569
|
+
notes: 'Flagship Flux model',
|
|
570
|
+
},
|
|
571
|
+
'black-forest-labs/FLUX.1-Kontext-dev': {
|
|
572
|
+
inModelIdType: true,
|
|
573
|
+
fileInput: true,
|
|
574
|
+
maskInput: true,
|
|
575
|
+
dimensionSpecification: 'Size',
|
|
576
|
+
notes: 'Image editing and transformation model',
|
|
577
|
+
},
|
|
578
|
+
'black-forest-labs/FLUX.1-Kontext-pro': {
|
|
579
|
+
inModelIdType: true,
|
|
580
|
+
fileInput: true,
|
|
581
|
+
maskInput: true,
|
|
582
|
+
dimensionSpecification: 'Size',
|
|
583
|
+
notes: 'Professional image editing and transformation',
|
|
584
|
+
},
|
|
585
|
+
'stabilityai/sd3.5-medium': {
|
|
586
|
+
inModelIdType: true,
|
|
587
|
+
fileInput: true,
|
|
588
|
+
maskInput: true,
|
|
589
|
+
dimensionSpecification: 'Aspect Ratio',
|
|
590
|
+
notes: 'Balanced 2.5B parameter model',
|
|
591
|
+
},
|
|
592
|
+
'stabilityai/sdxl-turbo': {
|
|
593
|
+
inModelIdType: true,
|
|
594
|
+
fileInput: true,
|
|
595
|
+
maskInput: true,
|
|
596
|
+
dimensionSpecification: 'Aspect Ratio',
|
|
597
|
+
notes: 'Optimized for fast generation',
|
|
598
|
+
},
|
|
599
|
+
'Qwen/Qwen-Image-Edit': {
|
|
600
|
+
inModelIdType: false,
|
|
601
|
+
fileInput: true,
|
|
602
|
+
maskInput: true,
|
|
603
|
+
dimensionSpecification: 'unknown',
|
|
604
|
+
notes: false,
|
|
605
|
+
},
|
|
606
|
+
} as const satisfies Record<string, DeepInfraImageModelRow>;
|
|
607
|
+
|
|
608
|
+
/** Maps a matrix row to its entry. Nothing here inspects the model ID. */
|
|
609
|
+
function createImageModelEntry(row: DeepInfraImageModelRow) {
|
|
456
610
|
return {
|
|
457
611
|
capabilities: {
|
|
458
612
|
image: {
|
|
@@ -460,10 +614,13 @@ export function getDeepInfraImageModelEntry(modelId: string) {
|
|
|
460
614
|
description:
|
|
461
615
|
'Explicit size or aspect ratio; accepted dimensions depend on the model.',
|
|
462
616
|
},
|
|
463
|
-
fileInput,
|
|
464
|
-
maskInput:
|
|
617
|
+
fileInput: row.fileInput,
|
|
618
|
+
maskInput: row.maskInput,
|
|
465
619
|
maxImagesPerCall: 1,
|
|
466
|
-
...
|
|
620
|
+
...(row.dimensionSpecification !== 'unknown'
|
|
621
|
+
? { dimensionSpecification: row.dimensionSpecification }
|
|
622
|
+
: {}),
|
|
623
|
+
...(row.notes !== false ? { notes: row.notes } : {}),
|
|
467
624
|
},
|
|
468
625
|
},
|
|
469
626
|
providerOptions: {
|
|
@@ -476,66 +633,162 @@ export function getDeepInfraImageModelEntry(modelId: string) {
|
|
|
476
633
|
},
|
|
477
634
|
} satisfies ModelEntry;
|
|
478
635
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
'
|
|
484
|
-
'
|
|
485
|
-
'
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
636
|
+
|
|
637
|
+
/** Row for every image model ID that is not listed in the matrix. */
|
|
638
|
+
const unlistedImageModelRow: DeepInfraImageModelRow = {
|
|
639
|
+
inModelIdType: false,
|
|
640
|
+
fileInput: 'unknown',
|
|
641
|
+
maskInput: 'unknown',
|
|
642
|
+
dimensionSpecification: 'unknown',
|
|
643
|
+
notes: false,
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export function getDeepInfraImageModelEntry(modelId: string) {
|
|
647
|
+
return createImageModelEntry(
|
|
648
|
+
Object.prototype.hasOwnProperty.call(imageModelDefinitions, modelId)
|
|
649
|
+
? imageModelDefinitions[modelId as keyof typeof imageModelDefinitions]
|
|
650
|
+
: unlistedImageModelRow,
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// Embedding models
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* One row of the embedding model matrix. Nothing is derived from the model
|
|
658
|
+
* ID.
|
|
659
|
+
*/
|
|
660
|
+
export type DeepInfraEmbeddingModelRow = {
|
|
661
|
+
defaultDimensions: number;
|
|
662
|
+
/** Maximum input tokens. */
|
|
663
|
+
maxTokens: number;
|
|
496
664
|
};
|
|
497
|
-
|
|
498
|
-
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Embedding model matrix: model IDs by capability. To add a model, add a row
|
|
668
|
+
* and fill in every column.
|
|
669
|
+
*/
|
|
670
|
+
const embeddingModelDefinitions = {
|
|
671
|
+
'BAAI/bge-base-en-v1.5': {
|
|
672
|
+
defaultDimensions: 768,
|
|
673
|
+
maxTokens: 512,
|
|
674
|
+
},
|
|
675
|
+
'BAAI/bge-large-en-v1.5': {
|
|
676
|
+
defaultDimensions: 1024,
|
|
677
|
+
maxTokens: 512,
|
|
678
|
+
},
|
|
679
|
+
'BAAI/bge-m3': {
|
|
680
|
+
defaultDimensions: 1024,
|
|
681
|
+
maxTokens: 8192,
|
|
682
|
+
},
|
|
683
|
+
'intfloat/e5-base-v2': {
|
|
684
|
+
defaultDimensions: 768,
|
|
685
|
+
maxTokens: 512,
|
|
686
|
+
},
|
|
687
|
+
'intfloat/e5-large-v2': {
|
|
688
|
+
defaultDimensions: 1024,
|
|
689
|
+
maxTokens: 512,
|
|
690
|
+
},
|
|
691
|
+
'intfloat/multilingual-e5-large': {
|
|
692
|
+
defaultDimensions: 1024,
|
|
693
|
+
maxTokens: 512,
|
|
694
|
+
},
|
|
695
|
+
'sentence-transformers/all-MiniLM-L12-v2': {
|
|
696
|
+
defaultDimensions: 384,
|
|
697
|
+
maxTokens: 256,
|
|
698
|
+
},
|
|
699
|
+
'sentence-transformers/all-MiniLM-L6-v2': {
|
|
700
|
+
defaultDimensions: 384,
|
|
701
|
+
maxTokens: 256,
|
|
702
|
+
},
|
|
703
|
+
'sentence-transformers/all-mpnet-base-v2': {
|
|
704
|
+
defaultDimensions: 768,
|
|
705
|
+
maxTokens: 384,
|
|
706
|
+
},
|
|
707
|
+
'sentence-transformers/clip-ViT-B-32': {
|
|
708
|
+
defaultDimensions: 512,
|
|
709
|
+
maxTokens: 77,
|
|
710
|
+
},
|
|
711
|
+
'sentence-transformers/clip-ViT-B-32-multilingual-v1': {
|
|
712
|
+
defaultDimensions: 512,
|
|
713
|
+
maxTokens: 77,
|
|
714
|
+
},
|
|
715
|
+
'sentence-transformers/multi-qa-mpnet-base-dot-v1': {
|
|
716
|
+
defaultDimensions: 768,
|
|
717
|
+
maxTokens: 512,
|
|
718
|
+
},
|
|
719
|
+
'sentence-transformers/paraphrase-MiniLM-L6-v2': {
|
|
720
|
+
defaultDimensions: 384,
|
|
721
|
+
maxTokens: 128,
|
|
722
|
+
},
|
|
723
|
+
'shibing624/text2vec-base-chinese': {
|
|
724
|
+
defaultDimensions: 768,
|
|
725
|
+
maxTokens: 512,
|
|
726
|
+
},
|
|
727
|
+
'thenlper/gte-base': {
|
|
728
|
+
defaultDimensions: 768,
|
|
729
|
+
maxTokens: 512,
|
|
730
|
+
},
|
|
731
|
+
'thenlper/gte-large': {
|
|
732
|
+
defaultDimensions: 1024,
|
|
733
|
+
maxTokens: 512,
|
|
734
|
+
},
|
|
735
|
+
} satisfies Record<string, DeepInfraEmbeddingModelRow>;
|
|
736
|
+
|
|
737
|
+
const embeddingProviderOptions = Object.fromEntries(
|
|
738
|
+
Object.keys(deepInfraProviderOptions.embedding).map(key => [
|
|
739
|
+
key,
|
|
740
|
+
'unknown' as const,
|
|
741
|
+
]),
|
|
742
|
+
);
|
|
743
|
+
|
|
744
|
+
/** Maps a matrix row to its entry. Nothing here inspects the model ID. */
|
|
745
|
+
function createEmbeddingModelEntry(row: DeepInfraEmbeddingModelRow) {
|
|
499
746
|
return {
|
|
500
747
|
capabilities: {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
customDimensions: 'unknown' as const,
|
|
507
|
-
},
|
|
508
|
-
}
|
|
509
|
-
: {}),
|
|
510
|
-
},
|
|
511
|
-
providerOptions: {
|
|
512
|
-
embedding: Object.fromEntries(
|
|
513
|
-
Object.keys(deepInfraProviderOptions.embedding).map(key => [
|
|
514
|
-
key,
|
|
515
|
-
'unknown' as const,
|
|
516
|
-
]),
|
|
517
|
-
),
|
|
748
|
+
embedding: {
|
|
749
|
+
defaultDimensions: row.defaultDimensions,
|
|
750
|
+
...{ maxTokens: row.maxTokens },
|
|
751
|
+
customDimensions: 'unknown' as const,
|
|
752
|
+
},
|
|
518
753
|
},
|
|
754
|
+
providerOptions: { embedding: embeddingProviderOptions },
|
|
519
755
|
} satisfies ModelEntry;
|
|
520
756
|
}
|
|
757
|
+
|
|
758
|
+
export function getDeepInfraEmbeddingModelEntry(modelId: string): ModelEntry {
|
|
759
|
+
return Object.prototype.hasOwnProperty.call(
|
|
760
|
+
embeddingModelDefinitions,
|
|
761
|
+
modelId,
|
|
762
|
+
)
|
|
763
|
+
? createEmbeddingModelEntry(
|
|
764
|
+
embeddingModelDefinitions[
|
|
765
|
+
modelId as keyof typeof embeddingModelDefinitions
|
|
766
|
+
],
|
|
767
|
+
)
|
|
768
|
+
: // Unlisted model IDs declare no embedding capabilities.
|
|
769
|
+
{
|
|
770
|
+
capabilities: {},
|
|
771
|
+
providerOptions: { embedding: embeddingProviderOptions },
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
|
|
521
775
|
export const deepInfraModelCatalog = Object.fromEntries([
|
|
522
|
-
...
|
|
523
|
-
|
|
776
|
+
...Object.entries(listedLanguageModelEntries),
|
|
777
|
+
...Object.keys(imageModelDefinitions).map(
|
|
778
|
+
id => [id, getDeepInfraImageModelEntry(id)] as const,
|
|
524
779
|
),
|
|
525
|
-
...
|
|
526
|
-
...embeddingModelIds.map(
|
|
780
|
+
...Object.keys(embeddingModelDefinitions).map(
|
|
527
781
|
id => [id, getDeepInfraEmbeddingModelEntry(id)] as const,
|
|
528
782
|
),
|
|
529
783
|
]);
|
|
530
784
|
|
|
531
|
-
// This editing model is also recognized by the adapter's file-input policy.
|
|
532
|
-
deepInfraModelCatalog['Qwen/Qwen-Image-Edit'] = getDeepInfraImageModelEntry(
|
|
533
|
-
'Qwen/Qwen-Image-Edit',
|
|
534
|
-
);
|
|
535
|
-
|
|
536
785
|
/** Known model IDs, derived from the declarations used to build the catalog. */
|
|
537
786
|
export type DeepInfraModelIds = {
|
|
538
|
-
language:
|
|
539
|
-
embedding:
|
|
540
|
-
image:
|
|
787
|
+
language: keyof typeof languageModelDefinitions;
|
|
788
|
+
embedding: keyof typeof embeddingModelDefinitions;
|
|
789
|
+
image: {
|
|
790
|
+
[ModelId in keyof typeof imageModelDefinitions]: (typeof imageModelDefinitions)[ModelId]['inModelIdType'] extends true
|
|
791
|
+
? ModelId
|
|
792
|
+
: never;
|
|
793
|
+
}[keyof typeof imageModelDefinitions];
|
|
541
794
|
};
|