@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.
@@ -4,71 +4,12 @@ import type {
4
4
  OpenAICompatibleEmbeddingModelOptions,
5
5
  } from '@ai-sdk/openai-compatible';
6
6
  import type {
7
- ModelCapabilities,
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
- const languageModelIds = [
137
- '01-ai/Yi-34B-Chat',
138
- 'Austism/chronos-hermes-13b-v2',
139
- 'bigcode/starcoder2-15b-instruct-v0.1',
140
- 'bigcode/starcoder2-15b',
141
- 'codellama/CodeLlama-34b-Instruct-hf',
142
- 'codellama/CodeLlama-70b-Instruct-hf',
143
- 'cognitivecomputations/dolphin-2.6-mixtral-8x7b',
144
- 'cognitivecomputations/dolphin-2.9.1-llama-3-70b',
145
- 'databricks/dbrx-instruct',
146
- 'deepinfra/airoboros-70b',
147
- 'deepseek-ai/DeepSeek-V3',
148
- 'deepseek-ai/DeepSeek-R1',
149
- 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
150
- 'deepseek-ai/DeepSeek-R1-Turbo',
151
- 'google/codegemma-7b-it',
152
- 'google/gemma-1.1-7b-it',
153
- 'google/gemma-2-27b-it',
154
- 'google/gemma-2-9b-it',
155
- 'Gryphe/MythoMax-L2-13b-turbo',
156
- 'Gryphe/MythoMax-L2-13b',
157
- 'HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1',
158
- 'KoboldAI/LLaMA2-13B-Tiefighter',
159
- 'lizpreciatior/lzlv_70b_fp16_hf',
160
- 'mattshumer/Reflection-Llama-3.1-70B',
161
- 'meta-llama/Llama-2-13b-chat-hf',
162
- 'meta-llama/Llama-2-70b-chat-hf',
163
- 'meta-llama/Llama-2-7b-chat-hf',
164
- 'meta-llama/Llama-3.2-11B-Vision-Instruct',
165
- 'meta-llama/Llama-3.2-1B-Instruct',
166
- 'meta-llama/Llama-3.2-3B-Instruct',
167
- 'meta-llama/Llama-3.2-90B-Vision-Instruct',
168
- 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
169
- 'meta-llama/Llama-3.3-70B-Instruct',
170
- 'meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8',
171
- 'meta-llama/Llama-4-Scout-17B-16E-Instruct',
172
- 'meta-llama/Meta-Llama-3-70B-Instruct',
173
- 'meta-llama/Meta-Llama-3-8B-Instruct',
174
- 'meta-llama/Meta-Llama-3.1-405B-Instruct',
175
- 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
176
- 'meta-llama/Meta-Llama-3.1-70B-Instruct',
177
- 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
178
- 'meta-llama/Meta-Llama-3.1-8B-Instruct',
179
- 'microsoft/Phi-3-medium-4k-instruct',
180
- 'microsoft/WizardLM-2-7B',
181
- 'microsoft/WizardLM-2-8x22B',
182
- 'mistralai/Mistral-7B-Instruct-v0.1',
183
- 'mistralai/Mistral-7B-Instruct-v0.2',
184
- 'mistralai/Mistral-7B-Instruct-v0.3',
185
- 'mistralai/Mistral-Nemo-Instruct-2407',
186
- 'mistralai/Mixtral-8x22B-Instruct-v0.1',
187
- 'mistralai/Mixtral-8x22B-v0.1',
188
- 'mistralai/Mixtral-8x7B-Instruct-v0.1',
189
- 'NousResearch/Hermes-3-Llama-3.1-405B',
190
- 'nvidia/Llama-3.1-Nemotron-70B-Instruct',
191
- 'nvidia/Nemotron-4-340B-Instruct',
192
- 'openbmb/MiniCPM-Llama3-V-2_5',
193
- 'openchat/openchat_3.5',
194
- 'openchat/openchat-3.6-8b',
195
- 'Phind/Phind-CodeLlama-34B-v2',
196
- 'Qwen/Qwen2-72B-Instruct',
197
- 'Qwen/Qwen2-7B-Instruct',
198
- 'Qwen/Qwen2.5-72B-Instruct',
199
- 'Qwen/Qwen2.5-7B-Instruct',
200
- 'Qwen/Qwen2.5-Coder-32B-Instruct',
201
- 'Qwen/Qwen2.5-Coder-7B',
202
- 'Qwen/QwQ-32B-Preview',
203
- 'Sao10K/L3-70B-Euryale-v2.1',
204
- 'Sao10K/L3-8B-Lunaris-v1',
205
- 'Sao10K/L3.1-70B-Euryale-v2.2',
206
- ] as const;
207
- const embeddingModelIds = [
208
- 'BAAI/bge-base-en-v1.5',
209
- 'BAAI/bge-large-en-v1.5',
210
- 'BAAI/bge-m3',
211
- 'intfloat/e5-base-v2',
212
- 'intfloat/e5-large-v2',
213
- 'intfloat/multilingual-e5-large',
214
- 'sentence-transformers/all-MiniLM-L12-v2',
215
- 'sentence-transformers/all-MiniLM-L6-v2',
216
- 'sentence-transformers/all-mpnet-base-v2',
217
- 'sentence-transformers/clip-ViT-B-32',
218
- 'sentence-transformers/clip-ViT-B-32-multilingual-v1',
219
- 'sentence-transformers/multi-qa-mpnet-base-dot-v1',
220
- 'sentence-transformers/paraphrase-MiniLM-L6-v2',
221
- 'shibing624/text2vec-base-chinese',
222
- 'thenlper/gte-base',
223
- 'thenlper/gte-large',
224
- ] as const;
225
- const imageModelIds = [
226
- 'stabilityai/sd3.5',
227
- 'black-forest-labs/FLUX-1.1-pro',
228
- 'black-forest-labs/FLUX-1-schnell',
229
- 'black-forest-labs/FLUX-1-dev',
230
- 'black-forest-labs/FLUX-pro',
231
- 'black-forest-labs/FLUX.1-Kontext-dev',
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
- tools: { usage: false, streaming: false },
244
- reasoning: { support: 'unknown' },
245
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
174
+ functionTools: false,
246
175
  },
247
- 'meta-llama/Llama-4-Scout-17B-16E-Instruct': {
248
- inputs: { image: true, audio: 'unknown' },
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
- tools: { usage: false, streaming: false },
251
- reasoning: { support: 'unknown' },
252
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
272
+ image: false,
256
273
  objectGeneration: true,
257
- tools: { usage: true, streaming: true },
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
- inputs: { image: false, audio: 'unknown' },
277
+ image: false,
263
278
  objectGeneration: true,
264
- tools: { usage: true, streaming: true },
265
- reasoning: { support: 'unknown' },
266
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
302
+ image: false,
270
303
  objectGeneration: true,
271
- tools: { usage: true, streaming: true },
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
- inputs: { image: false, audio: 'unknown' },
307
+ image: false,
277
308
  objectGeneration: true,
278
- tools: { usage: true, streaming: true },
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
- inputs: { image: false, audio: 'unknown' },
312
+ image: false,
284
313
  objectGeneration: true,
285
- tools: { usage: true, streaming: true },
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
- inputs: { image: false, audio: 'unknown' },
317
+ image: false,
291
318
  objectGeneration: true,
292
- tools: { usage: true, streaming: false },
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
- inputs: { image: false, audio: 'unknown' },
322
+ image: false,
298
323
  objectGeneration: true,
299
- tools: { usage: true, streaming: true },
300
- reasoning: { support: 'unknown' },
301
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
324
+ functionTools: ['streaming'],
302
325
  },
303
- 'meta-llama/Llama-3.2-11B-Vision-Instruct': {
304
- inputs: { image: true, audio: 'unknown' },
305
- objectGeneration: true,
306
- tools: { usage: false, streaming: false },
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
- 'meta-llama/Llama-3.2-90B-Vision-Instruct': {
311
- inputs: { image: true, audio: 'unknown' },
312
- objectGeneration: true,
313
- tools: { usage: false, streaming: false },
314
- reasoning: { support: 'unknown' },
315
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
372
+ image: false,
319
373
  objectGeneration: true,
320
- tools: { usage: true, streaming: false },
321
- reasoning: { support: 'unknown' },
322
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
374
+ functionTools: [],
323
375
  },
324
- 'deepseek-ai/DeepSeek-V3': {
325
- inputs: { image: false, audio: 'unknown' },
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
- tools: { usage: true, streaming: true },
328
- reasoning: { support: 'unknown' },
329
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
384
+ functionTools: [],
330
385
  },
331
- 'deepseek-ai/DeepSeek-R1': {
332
- inputs: { image: false, audio: 'unknown' },
333
- objectGeneration: false,
334
- tools: { usage: false, streaming: false },
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
- 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B': {
339
- inputs: { image: false, audio: 'unknown' },
340
- objectGeneration: false,
341
- tools: { usage: false, streaming: false },
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
- 'deepseek-ai/DeepSeek-R1-Turbo': {
346
- inputs: { image: false, audio: 'unknown' },
347
- objectGeneration: false,
348
- tools: { usage: false, streaming: false },
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
- 'nvidia/Llama-3.1-Nemotron-70B-Instruct': {
353
- inputs: { image: false, audio: 'unknown' },
354
- objectGeneration: true,
355
- tools: { usage: true, streaming: false },
356
- reasoning: { support: 'unknown' },
357
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
417
+ image: false,
361
418
  objectGeneration: true,
362
- tools: { usage: false, streaming: false },
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
- inputs: { image: false, audio: 'unknown' },
422
+ image: false,
368
423
  objectGeneration: true,
369
- tools: { usage: true, streaming: true },
370
- reasoning: { support: 'unknown' },
371
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
432
+ image: false,
375
433
  objectGeneration: true,
376
- tools: { usage: false, streaming: false },
377
- reasoning: { support: 'unknown' },
378
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
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
- inputs: { image: false, audio: 'unknown' },
442
+ image: false,
382
443
  objectGeneration: true,
383
- tools: { usage: false, streaming: false },
384
- reasoning: { support: 'unknown' },
385
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
444
+ functionTools: false,
386
445
  },
387
- 'google/codegemma-7b-it': {
388
- inputs: { image: false, audio: 'unknown' },
389
- objectGeneration: false,
390
- tools: { usage: false, streaming: false },
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
- 'google/gemma-2-9b-it': {
395
- inputs: { image: false, audio: 'unknown' },
396
- objectGeneration: false,
397
- tools: { usage: false, streaming: false },
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
- 'microsoft/WizardLM-2-8x22B': {
402
- inputs: { image: false, audio: 'unknown' },
403
- objectGeneration: false,
404
- tools: { usage: false, streaming: false },
405
- reasoning: { support: 'unknown' },
406
- sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
407
- },
408
- } satisfies Partial<
409
- Record<
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
- ...(documentedLanguageCapabilities[modelId] ??
427
- unknownLanguageCapabilities),
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
- const imageFileInputSupport: Partial<Record<string, boolean>> = {
443
- 'stabilityai/sd3.5': true,
444
- 'black-forest-labs/FLUX-1.1-pro': true,
445
- 'black-forest-labs/FLUX-1-schnell': true,
446
- 'black-forest-labs/FLUX-1-dev': true,
447
- 'black-forest-labs/FLUX-pro': true,
448
- 'black-forest-labs/FLUX.1-Kontext-dev': true,
449
- 'black-forest-labs/FLUX.1-Kontext-pro': true,
450
- 'Qwen/Qwen-Image-Edit': true,
451
- 'stabilityai/sd3.5-medium': true,
452
- 'stabilityai/sdxl-turbo': true,
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
- export function getDeepInfraImageModelEntry(modelId: string) {
455
- const fileInput = imageFileInputSupport[modelId] ?? 'unknown';
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: fileInput,
617
+ fileInput: row.fileInput,
618
+ maskInput: row.maskInput,
465
619
  maxImagesPerCall: 1,
466
- ...imageDetails[modelId],
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
- const embeddingDimensions: Partial<Record<string, number>> = {
480
- 'BAAI/bge-base-en-v1.5': 768,
481
- 'BAAI/bge-large-en-v1.5': 1024,
482
- 'BAAI/bge-m3': 1024,
483
- 'intfloat/e5-base-v2': 768,
484
- 'intfloat/e5-large-v2': 1024,
485
- 'intfloat/multilingual-e5-large': 1024,
486
- 'sentence-transformers/all-MiniLM-L12-v2': 384,
487
- 'sentence-transformers/all-MiniLM-L6-v2': 384,
488
- 'sentence-transformers/all-mpnet-base-v2': 768,
489
- 'sentence-transformers/clip-ViT-B-32': 512,
490
- 'sentence-transformers/clip-ViT-B-32-multilingual-v1': 512,
491
- 'sentence-transformers/multi-qa-mpnet-base-dot-v1': 768,
492
- 'sentence-transformers/paraphrase-MiniLM-L6-v2': 384,
493
- 'shibing624/text2vec-base-chinese': 768,
494
- 'thenlper/gte-base': 768,
495
- 'thenlper/gte-large': 1024,
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
- export function getDeepInfraEmbeddingModelEntry(modelId: string) {
498
- const dimensions = embeddingDimensions[modelId];
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
- ...(dimensions != null
502
- ? {
503
- embedding: {
504
- defaultDimensions: dimensions,
505
- ...{ maxTokens: embeddingTokenLimits[modelId] },
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
- ...languageModelIds.map(
523
- id => [id, getDeepInfraLanguageModelEntry(id)] as const,
776
+ ...Object.entries(listedLanguageModelEntries),
777
+ ...Object.keys(imageModelDefinitions).map(
778
+ id => [id, getDeepInfraImageModelEntry(id)] as const,
524
779
  ),
525
- ...imageModelIds.map(id => [id, getDeepInfraImageModelEntry(id)] as const),
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: (typeof languageModelIds)[number];
539
- embedding: (typeof embeddingModelIds)[number];
540
- image: (typeof imageModelIds)[number];
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
  };