@ai-sdk/fireworks 3.0.88 → 3.0.89

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.
@@ -0,0 +1,497 @@
1
+ import type {
2
+ OpenAICompatibleLanguageModelChatOptions,
3
+ OpenAICompatibleLanguageModelCompletionOptions,
4
+ OpenAICompatibleEmbeddingModelOptions,
5
+ } from '@ai-sdk/openai-compatible';
6
+ import type {
7
+ ModelCapabilities,
8
+ ModelEntry,
9
+ ProviderOptionDefinition,
10
+ ProviderOptionDefinitions,
11
+ } from '@ai-sdk/provider';
12
+ import type { FireworksLanguageModelOptions } from './fireworks-chat-options';
13
+ import type { FireworksEmbeddingModelOptions } from './fireworks-embedding-options';
14
+ import type { FireworksImageModelOptions } from './fireworks-image-model-options';
15
+ import type { FireworksImageModelId } from './fireworks-image-options';
16
+ const compatiblelanguageProviderOptions = {
17
+ user: {
18
+ description:
19
+ 'A unique identifier representing your end-user, which can help providers to\nmonitor and detect abuse.',
20
+ },
21
+ reasoningEffort: {
22
+ description:
23
+ 'Reasoning effort for reasoning models. Defaults to `medium`.\n\nSet to `null` to send `"reasoning_effort": null`, for providers that treat\nan explicit `null` differently from an omitted field.',
24
+ },
25
+ textVerbosity: {
26
+ description:
27
+ 'Controls the verbosity of the generated text. Defaults to `medium`.',
28
+ },
29
+ strictJsonSchema: {
30
+ description:
31
+ 'Whether to use strict JSON schema validation.\nWhen true, the model uses constrained decoding to guarantee schema compliance.\nOnly used when the provider supports structured outputs and a schema is provided.',
32
+ },
33
+ echo: { description: 'Echo back the prompt in addition to the completion.' },
34
+ logitBias: {
35
+ description:
36
+ 'Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in\nthe GPT tokenizer) to an associated bias value from -100 to 100.',
37
+ },
38
+ suffix: {
39
+ description: 'The suffix that comes after a completion of inserted text.',
40
+ },
41
+ } satisfies Record<
42
+ | keyof OpenAICompatibleLanguageModelChatOptions
43
+ | keyof OpenAICompatibleLanguageModelCompletionOptions,
44
+ ProviderOptionDefinition
45
+ >;
46
+
47
+ const compatibleembeddingProviderOptions = {
48
+ dimensions: {
49
+ description:
50
+ 'The number of dimensions the resulting output embeddings should have.\nOnly supported in text-embedding-3 and later models.',
51
+ },
52
+ user: {
53
+ description:
54
+ 'A unique identifier representing your end-user, which can help providers to\nmonitor and detect abuse.',
55
+ },
56
+ } satisfies Record<
57
+ keyof OpenAICompatibleEmbeddingModelOptions,
58
+ ProviderOptionDefinition
59
+ >;
60
+
61
+ /** Known options accepted under providerOptions; open-ended extension keys remain undeclared. */
62
+ export const fireworksProviderOptions = {
63
+ language: {
64
+ ...compatiblelanguageProviderOptions,
65
+ promptCacheKey: {
66
+ description:
67
+ 'A stable key for routing requests with shared prompt prefixes to the same prompt cache.',
68
+ },
69
+ serviceTier: {
70
+ description:
71
+ 'Use Fireworks Priority serving path for higher reliability during peak traffic.',
72
+ },
73
+ thinking: { description: 'thinking' },
74
+ reasoningHistory: { description: 'reasoningHistory' },
75
+ } satisfies Record<
76
+ keyof FireworksLanguageModelOptions,
77
+ ProviderOptionDefinition
78
+ >,
79
+ embedding: {
80
+ ...compatibleembeddingProviderOptions,
81
+ } satisfies Record<
82
+ keyof FireworksEmbeddingModelOptions,
83
+ ProviderOptionDefinition
84
+ >,
85
+ image: {
86
+ guidance_scale: {
87
+ description:
88
+ 'Classifier-free guidance scale for the image diffusion process.',
89
+ },
90
+ num_inference_steps: {
91
+ description:
92
+ 'Number of denoising steps for the image generation process.',
93
+ },
94
+ output_format: { description: 'Desired output image format.' },
95
+ webhook_url: {
96
+ description:
97
+ 'URL to receive webhook notifications for async Kontext requests.',
98
+ },
99
+ webhook_secret: {
100
+ description: 'Secret for webhook signature verification.',
101
+ },
102
+ prompt_upsampling: {
103
+ description:
104
+ 'Whether Fireworks should automatically modify the prompt for more creative generation.',
105
+ },
106
+ safety_tolerance: {
107
+ description: 'Moderation tolerance level for inputs and outputs.',
108
+ },
109
+ cfg_scale: {
110
+ description: 'Guidance scale for legacy image_generation models.',
111
+ },
112
+ steps: {
113
+ description:
114
+ 'Number of generation steps for legacy image_generation models.',
115
+ },
116
+ } satisfies Record<
117
+ keyof FireworksImageModelOptions,
118
+ ProviderOptionDefinition
119
+ >,
120
+ } as const satisfies ProviderOptionDefinitions;
121
+
122
+ const languageModelIds = [
123
+ 'accounts/fireworks/models/deepseek-v3',
124
+ 'accounts/fireworks/models/llama-v3p3-70b-instruct',
125
+ 'accounts/fireworks/models/llama-v3p2-3b-instruct',
126
+ 'accounts/fireworks/models/llama-v3p1-405b-instruct',
127
+ 'accounts/fireworks/models/llama-v3p1-8b-instruct',
128
+ 'accounts/fireworks/models/mixtral-8x7b-instruct',
129
+ 'accounts/fireworks/models/mixtral-8x22b-instruct',
130
+ 'accounts/fireworks/models/mixtral-8x7b-instruct-hf',
131
+ 'accounts/fireworks/models/qwen2p5-coder-32b-instruct',
132
+ 'accounts/fireworks/models/qwen2p5-72b-instruct',
133
+ 'accounts/fireworks/models/qwen-qwq-32b-preview',
134
+ 'accounts/fireworks/models/qwen2-vl-72b-instruct',
135
+ 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct',
136
+ 'accounts/fireworks/models/qwq-32b',
137
+ 'accounts/fireworks/models/yi-large',
138
+ 'accounts/fireworks/models/kimi-k2-instruct',
139
+ 'accounts/fireworks/models/kimi-k2-thinking',
140
+ 'accounts/fireworks/models/kimi-k2p6',
141
+ 'accounts/fireworks/models/minimax-m2',
142
+ 'accounts/fireworks/models/llama-v3-8b-instruct',
143
+ 'accounts/fireworks/models/llama-v2-34b-code',
144
+ ] as const;
145
+ const embeddingModelIds = ['nomic-ai/nomic-embed-text-v1.5'] as const;
146
+ const imageModelIds = [
147
+ 'accounts/fireworks/models/flux-1-dev-fp8',
148
+ 'accounts/fireworks/models/flux-1-schnell-fp8',
149
+ 'accounts/fireworks/models/flux-kontext-pro',
150
+ 'accounts/fireworks/models/flux-kontext-max',
151
+ 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic',
152
+ 'accounts/fireworks/models/japanese-stable-diffusion-xl',
153
+ 'accounts/fireworks/models/playground-v2-1024px-aesthetic',
154
+ 'accounts/fireworks/models/SSD-1B',
155
+ 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0',
156
+ ] as const;
157
+ const documentedLanguageCapabilities: Record<
158
+ string,
159
+ NonNullable<ModelCapabilities['language']>
160
+ > = {
161
+ 'accounts/fireworks/models/firefunction-v1': {
162
+ inputs: { image: false, audio: 'unknown' },
163
+ objectGeneration: true,
164
+ tools: { usage: true, streaming: true },
165
+ reasoning: { support: 'unknown' },
166
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
167
+ },
168
+ 'accounts/fireworks/models/deepseek-r1': {
169
+ inputs: { image: false, audio: 'unknown' },
170
+ objectGeneration: true,
171
+ tools: { usage: false, streaming: false },
172
+ reasoning: { support: 'unknown' },
173
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
174
+ },
175
+ 'accounts/fireworks/models/deepseek-v3': {
176
+ inputs: { image: false, audio: 'unknown' },
177
+ objectGeneration: true,
178
+ tools: { usage: true, streaming: false },
179
+ reasoning: { support: 'unknown' },
180
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
181
+ },
182
+ 'accounts/fireworks/models/llama-v3p1-405b-instruct': {
183
+ inputs: { image: false, audio: 'unknown' },
184
+ objectGeneration: true,
185
+ tools: { usage: true, streaming: true },
186
+ reasoning: { support: 'unknown' },
187
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
188
+ },
189
+ 'accounts/fireworks/models/llama-v3p1-8b-instruct': {
190
+ inputs: { image: false, audio: 'unknown' },
191
+ objectGeneration: true,
192
+ tools: { usage: true, streaming: false },
193
+ reasoning: { support: 'unknown' },
194
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
195
+ },
196
+ 'accounts/fireworks/models/llama-v3p2-3b-instruct': {
197
+ inputs: { image: false, audio: 'unknown' },
198
+ objectGeneration: true,
199
+ tools: { usage: true, streaming: false },
200
+ reasoning: { support: 'unknown' },
201
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
202
+ },
203
+ 'accounts/fireworks/models/llama-v3p3-70b-instruct': {
204
+ inputs: { image: false, audio: 'unknown' },
205
+ objectGeneration: true,
206
+ tools: { usage: true, streaming: false },
207
+ reasoning: { support: 'unknown' },
208
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
209
+ },
210
+ 'accounts/fireworks/models/mixtral-8x7b-instruct': {
211
+ inputs: { image: false, audio: 'unknown' },
212
+ objectGeneration: true,
213
+ tools: { usage: true, streaming: false },
214
+ reasoning: { support: 'unknown' },
215
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
216
+ },
217
+ 'accounts/fireworks/models/mixtral-8x7b-instruct-hf': {
218
+ inputs: { image: false, audio: 'unknown' },
219
+ objectGeneration: true,
220
+ tools: { usage: true, streaming: false },
221
+ reasoning: { support: 'unknown' },
222
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
223
+ },
224
+ 'accounts/fireworks/models/mixtral-8x22b-instruct': {
225
+ inputs: { image: false, audio: 'unknown' },
226
+ objectGeneration: true,
227
+ tools: { usage: true, streaming: false },
228
+ reasoning: { support: 'unknown' },
229
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
230
+ },
231
+ 'accounts/fireworks/models/qwen2p5-coder-32b-instruct': {
232
+ inputs: { image: false, audio: 'unknown' },
233
+ objectGeneration: true,
234
+ tools: { usage: true, streaming: false },
235
+ reasoning: { support: 'unknown' },
236
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
237
+ },
238
+ 'accounts/fireworks/models/qwen2p5-72b-instruct': {
239
+ inputs: { image: false, audio: 'unknown' },
240
+ objectGeneration: true,
241
+ tools: { usage: true, streaming: false },
242
+ reasoning: { support: 'unknown' },
243
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
244
+ },
245
+ 'accounts/fireworks/models/qwen-qwq-32b-preview': {
246
+ inputs: { image: false, audio: 'unknown' },
247
+ objectGeneration: true,
248
+ tools: { usage: false, streaming: false },
249
+ reasoning: { support: 'unknown' },
250
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
251
+ },
252
+ 'accounts/fireworks/models/qwen2-vl-72b-instruct': {
253
+ inputs: { image: true, audio: 'unknown' },
254
+ objectGeneration: true,
255
+ tools: { usage: false, streaming: false },
256
+ reasoning: { support: 'unknown' },
257
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
258
+ },
259
+ 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct': {
260
+ inputs: { image: true, audio: 'unknown' },
261
+ objectGeneration: true,
262
+ tools: { usage: true, streaming: false },
263
+ reasoning: { support: 'unknown' },
264
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
265
+ },
266
+ 'accounts/fireworks/models/qwq-32b': {
267
+ inputs: { image: false, audio: 'unknown' },
268
+ objectGeneration: true,
269
+ tools: { usage: false, streaming: false },
270
+ reasoning: { support: 'unknown' },
271
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
272
+ },
273
+ 'accounts/fireworks/models/yi-large': {
274
+ inputs: { image: false, audio: 'unknown' },
275
+ objectGeneration: true,
276
+ tools: { usage: true, streaming: false },
277
+ reasoning: { support: 'unknown' },
278
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
279
+ },
280
+ 'accounts/fireworks/models/kimi-k2-instruct': {
281
+ inputs: { image: false, audio: 'unknown' },
282
+ objectGeneration: true,
283
+ tools: { usage: true, streaming: false },
284
+ reasoning: { support: 'unknown' },
285
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
286
+ },
287
+ 'accounts/fireworks/models/kimi-k2-thinking': {
288
+ inputs: { image: false, audio: 'unknown' },
289
+ objectGeneration: true,
290
+ tools: { usage: true, streaming: false },
291
+ reasoning: { support: 'unknown' },
292
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
293
+ },
294
+ 'accounts/fireworks/models/kimi-k2p6': {
295
+ inputs: { image: true, audio: 'unknown' },
296
+ objectGeneration: true,
297
+ tools: { usage: true, streaming: false },
298
+ reasoning: { support: 'unknown' },
299
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
300
+ },
301
+ 'accounts/fireworks/models/minimax-m2': {
302
+ inputs: { image: false, audio: 'unknown' },
303
+ objectGeneration: true,
304
+ tools: { usage: true, streaming: false },
305
+ reasoning: { support: 'unknown' },
306
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
307
+ },
308
+ };
309
+ const unknownLanguageCapabilities: NonNullable<ModelCapabilities['language']> =
310
+ {
311
+ inputs: { image: 'unknown', audio: 'unknown' },
312
+ objectGeneration: 'unknown',
313
+ tools: { usage: 'unknown', streaming: 'unknown' },
314
+ reasoning: { support: 'unknown' },
315
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
316
+ };
317
+
318
+ // Model families that always reason and reject reasoning effort 'none'.
319
+ const modelsWithoutNoneReasoningEffort = /^(?:gpt-oss|glm-5p3|muse-spark)/;
320
+
321
+ // Model families that reject reasoning effort 'minimal'.
322
+ const modelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;
323
+
324
+ /**
325
+ * Fireworks accepts every reasoning effort for most models, so reasoning
326
+ * values are sent directly, except to model families known to reject them.
327
+ */
328
+ function getFireworksReasoningEffortMap(modelId: string) {
329
+ const modelName = modelId.slice(modelId.lastIndexOf('/') + 1);
330
+
331
+ return {
332
+ ...(!modelsWithoutNoneReasoningEffort.test(modelName) && {
333
+ none: 'none' as const,
334
+ }),
335
+ ...(!modelsWithoutMinimalReasoningEffort.test(modelName) && {
336
+ minimal: 'minimal' as const,
337
+ }),
338
+ low: 'low' as const,
339
+ medium: 'medium' as const,
340
+ high: 'high' as const,
341
+ xhigh: 'xhigh' as const,
342
+ max: 'max' as const,
343
+ };
344
+ }
345
+
346
+ export function getFireworksLanguageModelEntry(modelId: string) {
347
+ const effortMap = getFireworksReasoningEffortMap(modelId);
348
+ const entry = {
349
+ capabilities: {
350
+ language: {
351
+ ...(documentedLanguageCapabilities[modelId] ??
352
+ unknownLanguageCapabilities),
353
+ reasoning: { support: 'unknown', efforts: Object.values(effortMap) },
354
+ structuredOutput: { jsonSchema: true },
355
+ },
356
+ },
357
+ providerOptions: {
358
+ language: Object.fromEntries(
359
+ Object.keys(fireworksProviderOptions.language).map(key => [
360
+ key,
361
+ 'unknown' as const,
362
+ ]),
363
+ ),
364
+ },
365
+ requestConfig: { language: { reasoningEffortMap: effortMap } },
366
+ } as const;
367
+ return entry satisfies ModelEntry<{
368
+ language: { reasoningEffortMap: typeof effortMap };
369
+ }>;
370
+ }
371
+ interface FireworksImageModelBackendConfig {
372
+ urlFormat: 'workflows' | 'workflows_async' | 'image_generation';
373
+ supportsSize?: boolean;
374
+ supportsEditing?: boolean;
375
+ }
376
+
377
+ const modelToBackendConfig: Partial<
378
+ Record<FireworksImageModelId, FireworksImageModelBackendConfig>
379
+ > = {
380
+ 'accounts/fireworks/models/flux-1-dev-fp8': {
381
+ urlFormat: 'workflows',
382
+ },
383
+ 'accounts/fireworks/models/flux-1-schnell-fp8': {
384
+ urlFormat: 'workflows',
385
+ },
386
+ 'accounts/fireworks/models/flux-kontext-pro': {
387
+ urlFormat: 'workflows_async',
388
+ supportsEditing: true,
389
+ },
390
+ 'accounts/fireworks/models/flux-kontext-max': {
391
+ urlFormat: 'workflows_async',
392
+ supportsEditing: true,
393
+ },
394
+ 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic': {
395
+ urlFormat: 'image_generation',
396
+ supportsSize: true,
397
+ },
398
+ 'accounts/fireworks/models/japanese-stable-diffusion-xl': {
399
+ urlFormat: 'image_generation',
400
+ supportsSize: true,
401
+ },
402
+ 'accounts/fireworks/models/playground-v2-1024px-aesthetic': {
403
+ urlFormat: 'image_generation',
404
+ supportsSize: true,
405
+ },
406
+ 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0': {
407
+ urlFormat: 'image_generation',
408
+ supportsSize: true,
409
+ },
410
+ 'accounts/fireworks/models/SSD-1B': {
411
+ urlFormat: 'image_generation',
412
+ supportsSize: true,
413
+ },
414
+ };
415
+
416
+ export function getFireworksImageModelEntry(modelId: string) {
417
+ const config = modelToBackendConfig[modelId];
418
+ const fileInput =
419
+ config == null ? 'unknown' : config.supportsEditing === true;
420
+ const entry = {
421
+ capabilities: {
422
+ image: {
423
+ sizes: {
424
+ description: config?.supportsSize
425
+ ? 'Explicit width and height.'
426
+ : 'Aspect ratio; explicit sizes are not supported.',
427
+ },
428
+ fileInput,
429
+ maskInput: config == null ? 'unknown' : false,
430
+ maxImagesPerCall: 1,
431
+ size: config?.supportsSize === true,
432
+ },
433
+ },
434
+ providerOptions: {
435
+ image: Object.fromEntries(
436
+ Object.keys(fireworksProviderOptions.image).map(key => [
437
+ key,
438
+ 'unknown' as const,
439
+ ]),
440
+ ),
441
+ },
442
+ requestConfig: { image: { urlFormat: config?.urlFormat ?? 'workflows' } },
443
+ } as const;
444
+ return entry satisfies ModelEntry<{
445
+ image: { urlFormat: FireworksImageModelBackendConfig['urlFormat'] };
446
+ }>;
447
+ }
448
+ export function getFireworksEmbeddingModelEntry(modelId: string) {
449
+ return {
450
+ capabilities: {
451
+ ...(modelId === 'nomic-ai/nomic-embed-text-v1.5'
452
+ ? {
453
+ embedding: {
454
+ defaultDimensions: 768,
455
+ ...{ maxTokens: 8192 },
456
+ customDimensions: 'unknown' as const,
457
+ },
458
+ }
459
+ : {}),
460
+ },
461
+ providerOptions: {
462
+ embedding: Object.fromEntries(
463
+ Object.keys(fireworksProviderOptions.embedding).map(key => [
464
+ key,
465
+ 'unknown' as const,
466
+ ]),
467
+ ),
468
+ },
469
+ } satisfies ModelEntry;
470
+ }
471
+ export const fireworksModelCatalog = Object.fromEntries([
472
+ ...languageModelIds.map(
473
+ id => [id, getFireworksLanguageModelEntry(id)] as const,
474
+ ),
475
+ ...imageModelIds.map(id => [id, getFireworksImageModelEntry(id)] as const),
476
+ ...embeddingModelIds.map(
477
+ id => [id, getFireworksEmbeddingModelEntry(id)] as const,
478
+ ),
479
+ ]);
480
+
481
+ Object.assign(
482
+ fireworksModelCatalog,
483
+ Object.fromEntries(
484
+ Object.keys(documentedLanguageCapabilities).map(id => [
485
+ id,
486
+ getFireworksLanguageModelEntry(id),
487
+ ]),
488
+ ),
489
+ );
490
+
491
+ export const fireworksStabilityModelCatalog = Object.fromEntries(
492
+ [
493
+ 'accounts/stability/models/sd3-turbo',
494
+ 'accounts/stability/models/sd3-medium',
495
+ 'accounts/stability/models/sd3',
496
+ ].map(id => [id, getFireworksImageModelEntry(id)]),
497
+ );
@@ -1,3 +1,4 @@
1
+ import { getFireworksLanguageModelEntry } from './fireworks-model-catalog';
1
2
  import {
2
3
  OpenAICompatibleChatLanguageModel,
3
4
  OpenAICompatibleCompletionLanguageModel,
@@ -152,11 +153,15 @@ export function createFireworks(
152
153
  ...getCommonModelConfig('chat'),
153
154
  includeUsage: true,
154
155
  errorStructure: fireworksErrorStructure,
155
- supportsStructuredOutputs: true,
156
+ supportsStructuredOutputs:
157
+ getFireworksLanguageModelEntry(modelId).capabilities.language
158
+ .structuredOutput.jsonSchema,
156
159
  mapReasoning: ({ reasoning, warnings }) =>
157
160
  mapReasoningToProviderEffort({
158
161
  reasoning,
159
- effortMap: getFireworksReasoningEffortMap(modelId),
162
+ effortMap:
163
+ getFireworksLanguageModelEntry(modelId).requestConfig.language
164
+ .reasoningEffortMap,
160
165
  warnings,
161
166
  }),
162
167
  transformRequestBody: args => {
@@ -232,31 +237,3 @@ export function createFireworks(
232
237
  }
233
238
 
234
239
  export const fireworks = createFireworks();
235
-
236
- // Model families that always reason and reject reasoning effort 'none'.
237
- const modelsWithoutNoneReasoningEffort = /^(?:gpt-oss|glm-5p3|muse-spark)/;
238
-
239
- // Model families that reject reasoning effort 'minimal'.
240
- const modelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;
241
-
242
- /**
243
- * Fireworks accepts every reasoning effort for most models, so reasoning
244
- * values are sent directly, except to model families known to reject them.
245
- */
246
- function getFireworksReasoningEffortMap(modelId: string) {
247
- const modelName = modelId.slice(modelId.lastIndexOf('/') + 1);
248
-
249
- return {
250
- ...(!modelsWithoutNoneReasoningEffort.test(modelName) && {
251
- none: 'none' as const,
252
- }),
253
- ...(!modelsWithoutMinimalReasoningEffort.test(modelName) && {
254
- minimal: 'minimal' as const,
255
- }),
256
- low: 'low' as const,
257
- medium: 'medium' as const,
258
- high: 'high' as const,
259
- xhigh: 'xhigh' as const,
260
- max: 'max' as const,
261
- };
262
- }