@ai-sdk/fireworks 3.0.100 → 3.0.102

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/dist/index.js CHANGED
@@ -37,513 +37,535 @@ const fireworksProviderOptions = {
37
37
  steps: { description: "Number of generation steps for legacy image_generation models." }
38
38
  }
39
39
  };
40
- const languageDefinitions = {
41
- "accounts/fireworks/models/deepseek-v3": { endpoints: ["chat"] },
42
- "accounts/fireworks/models/llama-v3p3-70b-instruct": { endpoints: ["chat"] },
43
- "accounts/fireworks/models/llama-v3p2-3b-instruct": { endpoints: ["chat"] },
44
- "accounts/fireworks/models/llama-v3p1-405b-instruct": { endpoints: ["chat"] },
45
- "accounts/fireworks/models/llama-v3p1-8b-instruct": { endpoints: ["chat"] },
46
- "accounts/fireworks/models/mixtral-8x7b-instruct": { endpoints: ["chat"] },
47
- "accounts/fireworks/models/mixtral-8x22b-instruct": { endpoints: ["chat"] },
48
- "accounts/fireworks/models/mixtral-8x7b-instruct-hf": { endpoints: ["chat"] },
49
- "accounts/fireworks/models/qwen2p5-coder-32b-instruct": { endpoints: ["chat"] },
50
- "accounts/fireworks/models/qwen2p5-72b-instruct": { endpoints: ["chat"] },
51
- "accounts/fireworks/models/qwen-qwq-32b-preview": { endpoints: ["chat"] },
52
- "accounts/fireworks/models/qwen2-vl-72b-instruct": { endpoints: ["chat"] },
53
- "accounts/fireworks/models/llama-v3p2-11b-vision-instruct": { endpoints: ["chat"] },
54
- "accounts/fireworks/models/qwq-32b": { endpoints: ["chat"] },
55
- "accounts/fireworks/models/yi-large": { endpoints: ["chat"] },
56
- "accounts/fireworks/models/kimi-k2-instruct": { endpoints: ["chat"] },
57
- "accounts/fireworks/models/kimi-k2-thinking": { endpoints: ["chat"] },
58
- "accounts/fireworks/models/kimi-k2p6": { endpoints: ["chat"] },
59
- "accounts/fireworks/models/minimax-m2": { endpoints: ["chat"] },
60
- "accounts/fireworks/models/llama-v3-8b-instruct": { endpoints: ["completion"] },
61
- "accounts/fireworks/models/llama-v2-34b-code": { endpoints: ["completion"] }
62
- };
63
- const embeddingModelIds = ["nomic-ai/nomic-embed-text-v1.5"];
64
- const imageModelIds = [
65
- "accounts/fireworks/models/flux-1-dev-fp8",
66
- "accounts/fireworks/models/flux-1-schnell-fp8",
67
- "accounts/fireworks/models/flux-kontext-pro",
68
- "accounts/fireworks/models/flux-kontext-max",
69
- "accounts/fireworks/models/playground-v2-5-1024px-aesthetic",
70
- "accounts/fireworks/models/japanese-stable-diffusion-xl",
71
- "accounts/fireworks/models/playground-v2-1024px-aesthetic",
72
- "accounts/fireworks/models/SSD-1B",
73
- "accounts/fireworks/models/stable-diffusion-xl-1024-v1-0"
74
- ];
75
- const documentedLanguageCapabilities = {
76
- "accounts/fireworks/models/firefunction-v1": {
77
- inputs: {
78
- image: false,
79
- audio: "unknown"
80
- },
40
+ /**
41
+ * Language model matrix: model IDs by capability. To add a model, add a row
42
+ * and fill in every column.
43
+ */
44
+ const languageModelDefinitions = {
45
+ "accounts/fireworks/models/deepseek-v3": {
46
+ endpoints: ["chat"],
47
+ image: false,
81
48
  objectGeneration: true,
82
- tools: {
83
- usage: true,
84
- streaming: true
85
- },
86
- reasoning: { support: "unknown" },
87
- sampling: {
88
- temperature: "unknown",
89
- topP: "unknown",
90
- logprobs: "unknown"
91
- }
49
+ functionTools: [],
50
+ reasoningEfforts: [
51
+ "none",
52
+ "minimal",
53
+ "low",
54
+ "medium",
55
+ "high",
56
+ "xhigh",
57
+ "max"
58
+ ]
92
59
  },
93
- "accounts/fireworks/models/deepseek-r1": {
94
- inputs: {
95
- image: false,
96
- audio: "unknown"
97
- },
60
+ "accounts/fireworks/models/llama-v3p3-70b-instruct": {
61
+ endpoints: ["chat"],
62
+ image: false,
98
63
  objectGeneration: true,
99
- tools: {
100
- usage: false,
101
- streaming: false
102
- },
103
- reasoning: { support: "unknown" },
104
- sampling: {
105
- temperature: "unknown",
106
- topP: "unknown",
107
- logprobs: "unknown"
108
- }
64
+ functionTools: [],
65
+ reasoningEfforts: [
66
+ "none",
67
+ "minimal",
68
+ "low",
69
+ "medium",
70
+ "high",
71
+ "xhigh",
72
+ "max"
73
+ ]
109
74
  },
110
- "accounts/fireworks/models/deepseek-v3": {
111
- inputs: {
112
- image: false,
113
- audio: "unknown"
114
- },
75
+ "accounts/fireworks/models/llama-v3p2-3b-instruct": {
76
+ endpoints: ["chat"],
77
+ image: false,
115
78
  objectGeneration: true,
116
- tools: {
117
- usage: true,
118
- streaming: false
119
- },
120
- reasoning: { support: "unknown" },
121
- sampling: {
122
- temperature: "unknown",
123
- topP: "unknown",
124
- logprobs: "unknown"
125
- }
79
+ functionTools: [],
80
+ reasoningEfforts: [
81
+ "none",
82
+ "minimal",
83
+ "low",
84
+ "medium",
85
+ "high",
86
+ "xhigh",
87
+ "max"
88
+ ]
126
89
  },
127
90
  "accounts/fireworks/models/llama-v3p1-405b-instruct": {
128
- inputs: {
129
- image: false,
130
- audio: "unknown"
131
- },
91
+ endpoints: ["chat"],
92
+ image: false,
132
93
  objectGeneration: true,
133
- tools: {
134
- usage: true,
135
- streaming: true
136
- },
137
- reasoning: { support: "unknown" },
138
- sampling: {
139
- temperature: "unknown",
140
- topP: "unknown",
141
- logprobs: "unknown"
142
- }
94
+ functionTools: ["streaming"],
95
+ reasoningEfforts: [
96
+ "none",
97
+ "minimal",
98
+ "low",
99
+ "medium",
100
+ "high",
101
+ "xhigh",
102
+ "max"
103
+ ]
143
104
  },
144
105
  "accounts/fireworks/models/llama-v3p1-8b-instruct": {
145
- inputs: {
146
- image: false,
147
- audio: "unknown"
148
- },
149
- objectGeneration: true,
150
- tools: {
151
- usage: true,
152
- streaming: false
153
- },
154
- reasoning: { support: "unknown" },
155
- sampling: {
156
- temperature: "unknown",
157
- topP: "unknown",
158
- logprobs: "unknown"
159
- }
160
- },
161
- "accounts/fireworks/models/llama-v3p2-3b-instruct": {
162
- inputs: {
163
- image: false,
164
- audio: "unknown"
165
- },
106
+ endpoints: ["chat"],
107
+ image: false,
166
108
  objectGeneration: true,
167
- tools: {
168
- usage: true,
169
- streaming: false
170
- },
171
- reasoning: { support: "unknown" },
172
- sampling: {
173
- temperature: "unknown",
174
- topP: "unknown",
175
- logprobs: "unknown"
176
- }
177
- },
178
- "accounts/fireworks/models/llama-v3p3-70b-instruct": {
179
- inputs: {
180
- image: false,
181
- audio: "unknown"
182
- },
183
- objectGeneration: true,
184
- tools: {
185
- usage: true,
186
- streaming: false
187
- },
188
- reasoning: { support: "unknown" },
189
- sampling: {
190
- temperature: "unknown",
191
- topP: "unknown",
192
- logprobs: "unknown"
193
- }
109
+ functionTools: [],
110
+ reasoningEfforts: [
111
+ "none",
112
+ "minimal",
113
+ "low",
114
+ "medium",
115
+ "high",
116
+ "xhigh",
117
+ "max"
118
+ ]
194
119
  },
195
120
  "accounts/fireworks/models/mixtral-8x7b-instruct": {
196
- inputs: {
197
- image: false,
198
- audio: "unknown"
199
- },
121
+ endpoints: ["chat"],
122
+ image: false,
200
123
  objectGeneration: true,
201
- tools: {
202
- usage: true,
203
- streaming: false
204
- },
205
- reasoning: { support: "unknown" },
206
- sampling: {
207
- temperature: "unknown",
208
- topP: "unknown",
209
- logprobs: "unknown"
210
- }
124
+ functionTools: [],
125
+ reasoningEfforts: [
126
+ "none",
127
+ "minimal",
128
+ "low",
129
+ "medium",
130
+ "high",
131
+ "xhigh",
132
+ "max"
133
+ ]
211
134
  },
212
- "accounts/fireworks/models/mixtral-8x7b-instruct-hf": {
213
- inputs: {
214
- image: false,
215
- audio: "unknown"
216
- },
135
+ "accounts/fireworks/models/mixtral-8x22b-instruct": {
136
+ endpoints: ["chat"],
137
+ image: false,
217
138
  objectGeneration: true,
218
- tools: {
219
- usage: true,
220
- streaming: false
221
- },
222
- reasoning: { support: "unknown" },
223
- sampling: {
224
- temperature: "unknown",
225
- topP: "unknown",
226
- logprobs: "unknown"
227
- }
139
+ functionTools: [],
140
+ reasoningEfforts: [
141
+ "none",
142
+ "minimal",
143
+ "low",
144
+ "medium",
145
+ "high",
146
+ "xhigh",
147
+ "max"
148
+ ]
228
149
  },
229
- "accounts/fireworks/models/mixtral-8x22b-instruct": {
230
- inputs: {
231
- image: false,
232
- audio: "unknown"
233
- },
150
+ "accounts/fireworks/models/mixtral-8x7b-instruct-hf": {
151
+ endpoints: ["chat"],
152
+ image: false,
234
153
  objectGeneration: true,
235
- tools: {
236
- usage: true,
237
- streaming: false
238
- },
239
- reasoning: { support: "unknown" },
240
- sampling: {
241
- temperature: "unknown",
242
- topP: "unknown",
243
- logprobs: "unknown"
244
- }
154
+ functionTools: [],
155
+ reasoningEfforts: [
156
+ "none",
157
+ "minimal",
158
+ "low",
159
+ "medium",
160
+ "high",
161
+ "xhigh",
162
+ "max"
163
+ ]
245
164
  },
246
165
  "accounts/fireworks/models/qwen2p5-coder-32b-instruct": {
247
- inputs: {
248
- image: false,
249
- audio: "unknown"
250
- },
166
+ endpoints: ["chat"],
167
+ image: false,
251
168
  objectGeneration: true,
252
- tools: {
253
- usage: true,
254
- streaming: false
255
- },
256
- reasoning: { support: "unknown" },
257
- sampling: {
258
- temperature: "unknown",
259
- topP: "unknown",
260
- logprobs: "unknown"
261
- }
169
+ functionTools: [],
170
+ reasoningEfforts: [
171
+ "none",
172
+ "minimal",
173
+ "low",
174
+ "medium",
175
+ "high",
176
+ "xhigh",
177
+ "max"
178
+ ]
262
179
  },
263
180
  "accounts/fireworks/models/qwen2p5-72b-instruct": {
264
- inputs: {
265
- image: false,
266
- audio: "unknown"
267
- },
181
+ endpoints: ["chat"],
182
+ image: false,
268
183
  objectGeneration: true,
269
- tools: {
270
- usage: true,
271
- streaming: false
272
- },
273
- reasoning: { support: "unknown" },
274
- sampling: {
275
- temperature: "unknown",
276
- topP: "unknown",
277
- logprobs: "unknown"
278
- }
184
+ functionTools: [],
185
+ reasoningEfforts: [
186
+ "none",
187
+ "minimal",
188
+ "low",
189
+ "medium",
190
+ "high",
191
+ "xhigh",
192
+ "max"
193
+ ]
279
194
  },
280
195
  "accounts/fireworks/models/qwen-qwq-32b-preview": {
281
- inputs: {
282
- image: false,
283
- audio: "unknown"
284
- },
196
+ endpoints: ["chat"],
197
+ image: false,
285
198
  objectGeneration: true,
286
- tools: {
287
- usage: false,
288
- streaming: false
289
- },
290
- reasoning: { support: "unknown" },
291
- sampling: {
292
- temperature: "unknown",
293
- topP: "unknown",
294
- logprobs: "unknown"
295
- }
199
+ functionTools: false,
200
+ reasoningEfforts: [
201
+ "none",
202
+ "minimal",
203
+ "low",
204
+ "medium",
205
+ "high",
206
+ "xhigh",
207
+ "max"
208
+ ]
296
209
  },
297
210
  "accounts/fireworks/models/qwen2-vl-72b-instruct": {
298
- inputs: {
299
- image: true,
300
- audio: "unknown"
301
- },
211
+ endpoints: ["chat"],
212
+ image: true,
302
213
  objectGeneration: true,
303
- tools: {
304
- usage: false,
305
- streaming: false
306
- },
307
- reasoning: { support: "unknown" },
308
- sampling: {
309
- temperature: "unknown",
310
- topP: "unknown",
311
- logprobs: "unknown"
312
- }
214
+ functionTools: false,
215
+ reasoningEfforts: [
216
+ "none",
217
+ "minimal",
218
+ "low",
219
+ "medium",
220
+ "high",
221
+ "xhigh",
222
+ "max"
223
+ ]
313
224
  },
314
225
  "accounts/fireworks/models/llama-v3p2-11b-vision-instruct": {
315
- inputs: {
316
- image: true,
317
- audio: "unknown"
318
- },
226
+ endpoints: ["chat"],
227
+ image: true,
319
228
  objectGeneration: true,
320
- tools: {
321
- usage: true,
322
- streaming: false
323
- },
324
- reasoning: { support: "unknown" },
325
- sampling: {
326
- temperature: "unknown",
327
- topP: "unknown",
328
- logprobs: "unknown"
329
- }
229
+ functionTools: [],
230
+ reasoningEfforts: [
231
+ "none",
232
+ "minimal",
233
+ "low",
234
+ "medium",
235
+ "high",
236
+ "xhigh",
237
+ "max"
238
+ ]
330
239
  },
331
240
  "accounts/fireworks/models/qwq-32b": {
332
- inputs: {
333
- image: false,
334
- audio: "unknown"
335
- },
241
+ endpoints: ["chat"],
242
+ image: false,
336
243
  objectGeneration: true,
337
- tools: {
338
- usage: false,
339
- streaming: false
340
- },
341
- reasoning: { support: "unknown" },
342
- sampling: {
343
- temperature: "unknown",
344
- topP: "unknown",
345
- logprobs: "unknown"
346
- }
244
+ functionTools: false,
245
+ reasoningEfforts: [
246
+ "none",
247
+ "minimal",
248
+ "low",
249
+ "medium",
250
+ "high",
251
+ "xhigh",
252
+ "max"
253
+ ]
347
254
  },
348
255
  "accounts/fireworks/models/yi-large": {
349
- inputs: {
350
- image: false,
351
- audio: "unknown"
352
- },
256
+ endpoints: ["chat"],
257
+ image: false,
353
258
  objectGeneration: true,
354
- tools: {
355
- usage: true,
356
- streaming: false
357
- },
358
- reasoning: { support: "unknown" },
359
- sampling: {
360
- temperature: "unknown",
361
- topP: "unknown",
362
- logprobs: "unknown"
363
- }
259
+ functionTools: [],
260
+ reasoningEfforts: [
261
+ "none",
262
+ "minimal",
263
+ "low",
264
+ "medium",
265
+ "high",
266
+ "xhigh",
267
+ "max"
268
+ ]
364
269
  },
365
270
  "accounts/fireworks/models/kimi-k2-instruct": {
366
- inputs: {
367
- image: false,
368
- audio: "unknown"
369
- },
271
+ endpoints: ["chat"],
272
+ image: false,
370
273
  objectGeneration: true,
371
- tools: {
372
- usage: true,
373
- streaming: false
374
- },
375
- reasoning: { support: "unknown" },
376
- sampling: {
377
- temperature: "unknown",
378
- topP: "unknown",
379
- logprobs: "unknown"
380
- }
274
+ functionTools: [],
275
+ reasoningEfforts: [
276
+ "none",
277
+ "minimal",
278
+ "low",
279
+ "medium",
280
+ "high",
281
+ "xhigh",
282
+ "max"
283
+ ]
381
284
  },
382
285
  "accounts/fireworks/models/kimi-k2-thinking": {
383
- inputs: {
384
- image: false,
385
- audio: "unknown"
386
- },
286
+ endpoints: ["chat"],
287
+ image: false,
387
288
  objectGeneration: true,
388
- tools: {
389
- usage: true,
390
- streaming: false
391
- },
392
- reasoning: { support: "unknown" },
393
- sampling: {
394
- temperature: "unknown",
395
- topP: "unknown",
396
- logprobs: "unknown"
397
- }
289
+ functionTools: [],
290
+ reasoningEfforts: [
291
+ "none",
292
+ "minimal",
293
+ "low",
294
+ "medium",
295
+ "high",
296
+ "xhigh",
297
+ "max"
298
+ ]
398
299
  },
399
300
  "accounts/fireworks/models/kimi-k2p6": {
400
- inputs: {
401
- image: true,
402
- audio: "unknown"
403
- },
301
+ endpoints: ["chat"],
302
+ image: true,
404
303
  objectGeneration: true,
405
- tools: {
406
- usage: true,
407
- streaming: false
408
- },
409
- reasoning: { support: "unknown" },
410
- sampling: {
411
- temperature: "unknown",
412
- topP: "unknown",
413
- logprobs: "unknown"
414
- }
304
+ functionTools: [],
305
+ reasoningEfforts: [
306
+ "none",
307
+ "minimal",
308
+ "low",
309
+ "medium",
310
+ "high",
311
+ "xhigh",
312
+ "max"
313
+ ]
415
314
  },
416
315
  "accounts/fireworks/models/minimax-m2": {
417
- inputs: {
418
- image: false,
419
- audio: "unknown"
420
- },
316
+ endpoints: ["chat"],
317
+ image: false,
421
318
  objectGeneration: true,
422
- tools: {
423
- usage: true,
424
- streaming: false
425
- },
426
- reasoning: { support: "unknown" },
427
- sampling: {
428
- temperature: "unknown",
429
- topP: "unknown",
430
- logprobs: "unknown"
431
- }
432
- }
433
- };
434
- const unknownLanguageCapabilities = {
435
- inputs: {
319
+ functionTools: [],
320
+ reasoningEfforts: [
321
+ "none",
322
+ "minimal",
323
+ "low",
324
+ "medium",
325
+ "high",
326
+ "xhigh",
327
+ "max"
328
+ ]
329
+ },
330
+ "accounts/fireworks/models/llama-v3-8b-instruct": {
331
+ endpoints: ["completion"],
332
+ image: "unknown",
333
+ objectGeneration: "unknown",
334
+ functionTools: "unknown",
335
+ reasoningEfforts: [
336
+ "none",
337
+ "minimal",
338
+ "low",
339
+ "medium",
340
+ "high",
341
+ "xhigh",
342
+ "max"
343
+ ]
344
+ },
345
+ "accounts/fireworks/models/llama-v2-34b-code": {
346
+ endpoints: ["completion"],
436
347
  image: "unknown",
437
- audio: "unknown"
348
+ objectGeneration: "unknown",
349
+ functionTools: "unknown",
350
+ reasoningEfforts: [
351
+ "none",
352
+ "minimal",
353
+ "low",
354
+ "medium",
355
+ "high",
356
+ "xhigh",
357
+ "max"
358
+ ]
438
359
  },
439
- objectGeneration: "unknown",
440
- tools: {
441
- usage: "unknown",
442
- streaming: "unknown"
360
+ "accounts/fireworks/models/firefunction-v1": {
361
+ endpoints: [],
362
+ image: false,
363
+ objectGeneration: true,
364
+ functionTools: ["streaming"],
365
+ reasoningEfforts: [
366
+ "none",
367
+ "minimal",
368
+ "low",
369
+ "medium",
370
+ "high",
371
+ "xhigh",
372
+ "max"
373
+ ]
443
374
  },
444
- reasoning: { support: "unknown" },
445
- sampling: {
446
- temperature: "unknown",
447
- topP: "unknown",
448
- logprobs: "unknown"
375
+ "accounts/fireworks/models/deepseek-r1": {
376
+ endpoints: [],
377
+ image: false,
378
+ objectGeneration: true,
379
+ functionTools: false,
380
+ reasoningEfforts: [
381
+ "none",
382
+ "minimal",
383
+ "low",
384
+ "medium",
385
+ "high",
386
+ "xhigh",
387
+ "max"
388
+ ]
449
389
  }
450
390
  };
451
- const modelsWithoutNoneReasoningEffort = /^(?:gpt-oss|glm-5p3|muse-spark)/;
452
- const modelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;
453
- /**
454
- * Fireworks accepts every reasoning effort for most models, so reasoning
455
- * values are sent directly, except to model families known to reject them.
456
- */
457
- function getFireworksReasoningEffortMap(modelId) {
458
- const modelName = modelId.slice(modelId.lastIndexOf("/") + 1);
459
- return {
460
- ...!modelsWithoutNoneReasoningEffort.test(modelName) && { none: "none" },
461
- ...!modelsWithoutMinimalReasoningEffort.test(modelName) && { minimal: "minimal" },
462
- low: "low",
463
- medium: "medium",
464
- high: "high",
465
- xhigh: "xhigh",
466
- max: "max"
467
- };
468
- }
469
- function getFireworksLanguageModelEntry(modelId) {
470
- const effortMap = getFireworksReasoningEffortMap(modelId);
391
+ /** Maps a matrix row to its entry. Nothing here inspects the model ID. */
392
+ function createLanguageModelEntry(row) {
471
393
  return {
472
394
  capabilities: { language: {
473
- ...documentedLanguageCapabilities[modelId] ?? unknownLanguageCapabilities,
395
+ inputs: {
396
+ image: row.image,
397
+ audio: "unknown"
398
+ },
399
+ objectGeneration: row.objectGeneration,
400
+ tools: {
401
+ usage: row.functionTools === "unknown" ? "unknown" : row.functionTools !== false,
402
+ streaming: row.functionTools === "unknown" ? "unknown" : row.functionTools !== false && row.functionTools.includes("streaming")
403
+ },
474
404
  reasoning: {
475
405
  support: "unknown",
476
- efforts: Object.values(effortMap)
406
+ efforts: [...row.reasoningEfforts]
407
+ },
408
+ sampling: {
409
+ temperature: "unknown",
410
+ topP: "unknown",
411
+ logprobs: "unknown"
477
412
  },
478
413
  structuredOutput: { jsonSchema: true }
479
414
  } },
480
415
  providerOptions: { language: Object.fromEntries(Object.keys(fireworksProviderOptions.language).map((key) => [key, "unknown"])) },
481
- requestConfig: { language: { reasoningEffortMap: effortMap } }
416
+ requestConfig: { language: { reasoningEffortMap: Object.fromEntries(row.reasoningEfforts.map((effort) => [effort, effort])) } }
482
417
  };
483
418
  }
484
- const modelToBackendConfig = {
485
- "accounts/fireworks/models/flux-1-dev-fp8": { urlFormat: "workflows" },
486
- "accounts/fireworks/models/flux-1-schnell-fp8": { urlFormat: "workflows" },
419
+ const listedLanguageModelEntries = Object.fromEntries(Object.entries(languageModelDefinitions).map(([modelId, row]) => [modelId, createLanguageModelEntry(row)]));
420
+ const unlistedModelsWithoutNoneReasoningEffort = /^(?:gpt-oss|glm-5p3|muse-spark)/;
421
+ const unlistedModelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;
422
+ /**
423
+ * Resolves a model ID that is not listed in the matrix to a row. This is the
424
+ * only place that looks at the model ID. Fireworks accepts every reasoning
425
+ * effort for most models, so every effort is sent, except to model families
426
+ * known to reject one.
427
+ */
428
+ function getUnlistedLanguageModelRow(modelId) {
429
+ const modelName = modelId.slice(modelId.lastIndexOf("/") + 1);
430
+ return {
431
+ endpoints: [],
432
+ image: "unknown",
433
+ objectGeneration: "unknown",
434
+ functionTools: "unknown",
435
+ reasoningEfforts: [
436
+ ...unlistedModelsWithoutNoneReasoningEffort.test(modelName) ? [] : ["none"],
437
+ ...unlistedModelsWithoutMinimalReasoningEffort.test(modelName) ? [] : ["minimal"],
438
+ "low",
439
+ "medium",
440
+ "high",
441
+ "xhigh",
442
+ "max"
443
+ ]
444
+ };
445
+ }
446
+ /**
447
+ * Returns the entry of a listed language model ID from its row. Every other
448
+ * model ID uses the fallback for unlisted IDs.
449
+ */
450
+ function getFireworksLanguageModelEntry(modelId) {
451
+ return Object.prototype.hasOwnProperty.call(listedLanguageModelEntries, modelId) ? listedLanguageModelEntries[modelId] : createLanguageModelEntry(getUnlistedLanguageModelRow(modelId));
452
+ }
453
+ /**
454
+ * Image model matrix: model IDs by capability. To add a model, add a row and
455
+ * fill in every column.
456
+ */
457
+ const imageModelDefinitions = {
458
+ "accounts/fireworks/models/flux-1-dev-fp8": {
459
+ urlFormat: "workflows",
460
+ size: false,
461
+ fileInput: false,
462
+ maskInput: false
463
+ },
464
+ "accounts/fireworks/models/flux-1-schnell-fp8": {
465
+ urlFormat: "workflows",
466
+ size: false,
467
+ fileInput: false,
468
+ maskInput: false
469
+ },
487
470
  "accounts/fireworks/models/flux-kontext-pro": {
488
471
  urlFormat: "workflows_async",
489
- supportsEditing: true
472
+ size: false,
473
+ fileInput: true,
474
+ maskInput: false
490
475
  },
491
476
  "accounts/fireworks/models/flux-kontext-max": {
492
477
  urlFormat: "workflows_async",
493
- supportsEditing: true
478
+ size: false,
479
+ fileInput: true,
480
+ maskInput: false
494
481
  },
495
482
  "accounts/fireworks/models/playground-v2-5-1024px-aesthetic": {
496
483
  urlFormat: "image_generation",
497
- supportsSize: true
484
+ size: true,
485
+ fileInput: false,
486
+ maskInput: false
498
487
  },
499
488
  "accounts/fireworks/models/japanese-stable-diffusion-xl": {
500
489
  urlFormat: "image_generation",
501
- supportsSize: true
490
+ size: true,
491
+ fileInput: false,
492
+ maskInput: false
502
493
  },
503
494
  "accounts/fireworks/models/playground-v2-1024px-aesthetic": {
504
495
  urlFormat: "image_generation",
505
- supportsSize: true
496
+ size: true,
497
+ fileInput: false,
498
+ maskInput: false
506
499
  },
507
- "accounts/fireworks/models/stable-diffusion-xl-1024-v1-0": {
500
+ "accounts/fireworks/models/SSD-1B": {
508
501
  urlFormat: "image_generation",
509
- supportsSize: true
502
+ size: true,
503
+ fileInput: false,
504
+ maskInput: false
510
505
  },
511
- "accounts/fireworks/models/SSD-1B": {
506
+ "accounts/fireworks/models/stable-diffusion-xl-1024-v1-0": {
512
507
  urlFormat: "image_generation",
513
- supportsSize: true
508
+ size: true,
509
+ fileInput: false,
510
+ maskInput: false
514
511
  }
515
512
  };
516
- function getFireworksImageModelEntry(modelId) {
517
- const config = modelToBackendConfig[modelId];
518
- const fileInput = config == null ? "unknown" : config.supportsEditing === true;
513
+ /** Maps a matrix row to its entry. Nothing here inspects the model ID. */
514
+ function createImageModelEntry(row) {
519
515
  return {
520
516
  capabilities: { image: {
521
- sizes: { description: config?.supportsSize ? "Explicit width and height." : "Aspect ratio; explicit sizes are not supported." },
522
- fileInput,
523
- maskInput: config == null ? "unknown" : false,
517
+ sizes: { description: row.size ? "Explicit width and height." : "Aspect ratio; explicit sizes are not supported." },
518
+ fileInput: row.fileInput,
519
+ maskInput: row.maskInput,
524
520
  maxImagesPerCall: 1,
525
- size: config?.supportsSize === true
521
+ size: row.size
526
522
  } },
527
523
  providerOptions: { image: Object.fromEntries(Object.keys(fireworksProviderOptions.image).map((key) => [key, "unknown"])) },
528
- requestConfig: { image: { urlFormat: config?.urlFormat ?? "workflows" } }
524
+ requestConfig: { image: { urlFormat: row.urlFormat } }
529
525
  };
530
526
  }
531
- function getFireworksEmbeddingModelEntry(modelId) {
527
+ /** Row for every image model ID that is not listed in the matrix. */
528
+ const unlistedImageModelRow = {
529
+ urlFormat: "workflows",
530
+ size: false,
531
+ fileInput: "unknown",
532
+ maskInput: "unknown"
533
+ };
534
+ function getFireworksImageModelEntry(modelId) {
535
+ return createImageModelEntry(Object.prototype.hasOwnProperty.call(imageModelDefinitions, modelId) ? imageModelDefinitions[modelId] : unlistedImageModelRow);
536
+ }
537
+ /**
538
+ * Embedding model matrix: model IDs by capability. To add a model, add a row
539
+ * and fill in every column.
540
+ */
541
+ const embeddingModelDefinitions = { "nomic-ai/nomic-embed-text-v1.5": {
542
+ defaultDimensions: 768,
543
+ maxTokens: 8192,
544
+ customDimensions: "unknown"
545
+ } };
546
+ const embeddingProviderOptions = Object.fromEntries(Object.keys(fireworksProviderOptions.embedding).map((key) => [key, "unknown"]));
547
+ /** Maps a matrix row to its entry. Nothing here inspects the model ID. */
548
+ function createEmbeddingModelEntry(row) {
532
549
  return {
533
- capabilities: { ...modelId === "nomic-ai/nomic-embed-text-v1.5" ? { embedding: {
534
- defaultDimensions: 768,
535
- maxTokens: 8192,
536
- customDimensions: "unknown"
537
- } } : {} },
538
- providerOptions: { embedding: Object.fromEntries(Object.keys(fireworksProviderOptions.embedding).map((key) => [key, "unknown"])) }
550
+ capabilities: { embedding: {
551
+ defaultDimensions: row.defaultDimensions,
552
+ maxTokens: row.maxTokens,
553
+ customDimensions: row.customDimensions
554
+ } },
555
+ providerOptions: { embedding: embeddingProviderOptions }
539
556
  };
540
557
  }
541
- const fireworksModelCatalog = Object.fromEntries([
542
- ...Object.keys(languageDefinitions).map((id) => [id, getFireworksLanguageModelEntry(id)]),
543
- ...imageModelIds.map((id) => [id, getFireworksImageModelEntry(id)]),
544
- ...embeddingModelIds.map((id) => [id, getFireworksEmbeddingModelEntry(id)])
558
+ function getFireworksEmbeddingModelEntry(modelId) {
559
+ return Object.prototype.hasOwnProperty.call(embeddingModelDefinitions, modelId) ? createEmbeddingModelEntry(embeddingModelDefinitions[modelId]) : {
560
+ capabilities: {},
561
+ providerOptions: { embedding: embeddingProviderOptions }
562
+ };
563
+ }
564
+ Object.fromEntries([
565
+ ...Object.entries(listedLanguageModelEntries),
566
+ ...Object.keys(imageModelDefinitions).map((id) => [id, getFireworksImageModelEntry(id)]),
567
+ ...Object.keys(embeddingModelDefinitions).map((id) => [id, getFireworksEmbeddingModelEntry(id)])
545
568
  ]);
546
- Object.assign(fireworksModelCatalog, Object.fromEntries(Object.keys(documentedLanguageCapabilities).map((id) => [id, getFireworksLanguageModelEntry(id)])));
547
569
  Object.fromEntries([
548
570
  "accounts/stability/models/sd3-turbo",
549
571
  "accounts/stability/models/sd3-medium",
@@ -796,7 +818,7 @@ var FireworksImageModel = class FireworksImageModel {
796
818
  };
797
819
  //#endregion
798
820
  //#region src/version.ts
799
- const VERSION = "3.0.100";
821
+ const VERSION = "3.0.102";
800
822
  //#endregion
801
823
  //#region src/fireworks-provider.ts
802
824
  const fireworksErrorStructure = {