@ai-sdk/huggingface 2.0.0-beta.5 → 2.0.0-beta.58

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 CHANGED
@@ -1,5 +1,488 @@
1
1
  # @ai-sdk/huggingface
2
2
 
3
+ ## 2.0.0-beta.58
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0416e3e]
8
+ - @ai-sdk/provider@4.0.0-beta.20
9
+ - @ai-sdk/openai-compatible@3.0.0-beta.58
10
+ - @ai-sdk/provider-utils@5.0.0-beta.50
11
+
12
+ ## 2.0.0-beta.57
13
+
14
+ ### Patch Changes
15
+
16
+ - b8396f0: trigger initial beta release
17
+ - Updated dependencies [b8396f0]
18
+ - @ai-sdk/openai-compatible@3.0.0-beta.57
19
+ - @ai-sdk/provider-utils@5.0.0-beta.49
20
+ - @ai-sdk/provider@4.0.0-beta.19
21
+
22
+ ## 2.0.0-canary.56
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [aeda373]
27
+ - Updated dependencies [375fdd7]
28
+ - Updated dependencies [b4507d5]
29
+ - @ai-sdk/provider-utils@5.0.0-canary.48
30
+ - @ai-sdk/openai-compatible@3.0.0-canary.56
31
+
32
+ ## 2.0.0-canary.55
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [bae5e2b]
37
+ - @ai-sdk/provider-utils@5.0.0-canary.47
38
+ - @ai-sdk/openai-compatible@3.0.0-canary.55
39
+
40
+ ## 2.0.0-canary.54
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [ce769dd]
45
+ - @ai-sdk/provider@4.0.0-canary.18
46
+ - @ai-sdk/openai-compatible@3.0.0-canary.54
47
+ - @ai-sdk/provider-utils@5.0.0-canary.46
48
+
49
+ ## 2.0.0-canary.53
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies [ee798eb]
54
+ - Updated dependencies [daf6637]
55
+ - @ai-sdk/provider-utils@5.0.0-canary.45
56
+ - @ai-sdk/openai-compatible@3.0.0-canary.53
57
+
58
+ ## 2.0.0-canary.52
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [6c93e36]
63
+ - Updated dependencies [f617ac2]
64
+ - @ai-sdk/provider-utils@5.0.0-canary.44
65
+ - @ai-sdk/openai-compatible@3.0.0-canary.52
66
+
67
+ ## 2.0.0-canary.51
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [9f1e1ba]
72
+ - @ai-sdk/openai-compatible@3.0.0-canary.51
73
+
74
+ ## 2.0.0-canary.50
75
+
76
+ ### Patch Changes
77
+
78
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
79
+ - Updated dependencies [7fc6bd6]
80
+ - @ai-sdk/openai-compatible@3.0.0-canary.50
81
+ - @ai-sdk/provider-utils@5.0.0-canary.43
82
+ - @ai-sdk/provider@4.0.0-canary.17
83
+
84
+ ## 2.0.0-canary.49
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [a6617c5]
89
+ - @ai-sdk/provider-utils@5.0.0-canary.42
90
+ - @ai-sdk/openai-compatible@3.0.0-canary.49
91
+
92
+ ## 2.0.0-canary.48
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [28dfa06]
97
+ - Updated dependencies [e93fa91]
98
+ - @ai-sdk/provider-utils@5.0.0-canary.41
99
+ - @ai-sdk/openai-compatible@3.0.0-canary.48
100
+
101
+ ## 2.0.0-canary.47
102
+
103
+ ### Patch Changes
104
+
105
+ - Updated dependencies [a7de9c9]
106
+ - @ai-sdk/provider-utils@5.0.0-canary.40
107
+ - @ai-sdk/openai-compatible@3.0.0-canary.47
108
+
109
+ ## 2.0.0-canary.46
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [105f95b]
114
+ - @ai-sdk/provider-utils@5.0.0-canary.39
115
+ - @ai-sdk/openai-compatible@3.0.0-canary.46
116
+
117
+ ## 2.0.0-canary.45
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [ca446f8]
122
+ - @ai-sdk/provider-utils@5.0.0-canary.38
123
+ - @ai-sdk/openai-compatible@3.0.0-canary.45
124
+
125
+ ## 2.0.0-canary.44
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [d848405]
130
+ - @ai-sdk/provider-utils@5.0.0-canary.37
131
+ - @ai-sdk/openai-compatible@3.0.0-canary.44
132
+
133
+ ## 2.0.0-canary.43
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [ca39020]
138
+ - @ai-sdk/provider-utils@5.0.0-canary.36
139
+ - @ai-sdk/openai-compatible@3.0.0-canary.43
140
+
141
+ ## 2.0.0-canary.42
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies [f634bac]
146
+ - @ai-sdk/provider-utils@5.0.0-canary.35
147
+ - @ai-sdk/openai-compatible@3.0.0-canary.42
148
+
149
+ ## 2.0.0-canary.41
150
+
151
+ ### Patch Changes
152
+
153
+ - Updated dependencies [69254e0]
154
+ - Updated dependencies [3015fc3]
155
+ - @ai-sdk/provider-utils@5.0.0-canary.34
156
+ - @ai-sdk/openai-compatible@3.0.0-canary.41
157
+
158
+ ## 2.0.0-canary.40
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [2427d88]
163
+ - @ai-sdk/provider-utils@5.0.0-canary.33
164
+ - @ai-sdk/openai-compatible@3.0.0-canary.40
165
+
166
+ ## 2.0.0-canary.39
167
+
168
+ ### Patch Changes
169
+
170
+ - Updated dependencies [5463d0d]
171
+ - @ai-sdk/provider-utils@5.0.0-canary.32
172
+ - @ai-sdk/provider@4.0.0-canary.16
173
+ - @ai-sdk/openai-compatible@3.0.0-canary.39
174
+
175
+ ## 2.0.0-canary.38
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [cd9c311]
180
+ - @ai-sdk/openai-compatible@3.0.0-canary.38
181
+
182
+ ## 2.0.0-canary.37
183
+
184
+ ### Patch Changes
185
+
186
+ - 0c4c275: trigger initial canary release
187
+ - Updated dependencies [0c4c275]
188
+ - @ai-sdk/openai-compatible@3.0.0-canary.37
189
+ - @ai-sdk/provider-utils@5.0.0-canary.31
190
+ - @ai-sdk/provider@4.0.0-canary.15
191
+
192
+ ## 2.0.0-beta.36
193
+
194
+ ### Patch Changes
195
+
196
+ - Updated dependencies [e59c955]
197
+ - @ai-sdk/openai-compatible@3.0.0-beta.36
198
+
199
+ ## 2.0.0-beta.35
200
+
201
+ ### Major Changes
202
+
203
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
204
+
205
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
206
+
207
+ ### Patch Changes
208
+
209
+ - Updated dependencies [08d2129]
210
+ - Updated dependencies [04e9009]
211
+ - @ai-sdk/provider-utils@5.0.0-beta.30
212
+ - @ai-sdk/openai-compatible@3.0.0-beta.35
213
+
214
+ ## 2.0.0-beta.34
215
+
216
+ ### Patch Changes
217
+
218
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
219
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
220
+ - Updated dependencies [9bd6512]
221
+ - Updated dependencies [258c093]
222
+ - Updated dependencies [b6783da]
223
+ - @ai-sdk/openai-compatible@3.0.0-beta.34
224
+ - @ai-sdk/provider-utils@5.0.0-beta.29
225
+ - @ai-sdk/provider@4.0.0-beta.14
226
+
227
+ ## 2.0.0-beta.33
228
+
229
+ ### Patch Changes
230
+
231
+ - 9f0e36c: trigger release for all packages after provenance setup
232
+ - Updated dependencies [9f0e36c]
233
+ - @ai-sdk/openai-compatible@3.0.0-beta.33
234
+ - @ai-sdk/provider@4.0.0-beta.13
235
+ - @ai-sdk/provider-utils@5.0.0-beta.28
236
+
237
+ ## 2.0.0-beta.32
238
+
239
+ ### Patch Changes
240
+
241
+ - Updated dependencies [ab81968]
242
+ - Updated dependencies [785fe16]
243
+ - Updated dependencies [67df0a0]
244
+ - Updated dependencies [befb78c]
245
+ - Updated dependencies [0458559]
246
+ - Updated dependencies [58a2ad7]
247
+ - Updated dependencies [5852c0a]
248
+ - Updated dependencies [fc92055]
249
+ - @ai-sdk/openai-compatible@3.0.0-beta.32
250
+ - @ai-sdk/provider-utils@5.0.0-beta.27
251
+
252
+ ## 2.0.0-beta.31
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [2e98477]
257
+ - Updated dependencies [bfb756d]
258
+ - @ai-sdk/provider-utils@5.0.0-beta.26
259
+ - @ai-sdk/openai-compatible@3.0.0-beta.31
260
+
261
+ ## 2.0.0-beta.30
262
+
263
+ ### Patch Changes
264
+
265
+ - Updated dependencies [eea8d98]
266
+ - @ai-sdk/provider-utils@5.0.0-beta.25
267
+ - @ai-sdk/openai-compatible@3.0.0-beta.30
268
+
269
+ ## 2.0.0-beta.29
270
+
271
+ ### Patch Changes
272
+
273
+ - Updated dependencies [f807e45]
274
+ - @ai-sdk/provider-utils@5.0.0-beta.24
275
+ - @ai-sdk/openai-compatible@3.0.0-beta.29
276
+
277
+ ## 2.0.0-beta.28
278
+
279
+ ### Patch Changes
280
+
281
+ - Updated dependencies [350ea38]
282
+ - @ai-sdk/provider-utils@5.0.0-beta.23
283
+ - @ai-sdk/openai-compatible@3.0.0-beta.28
284
+
285
+ ## 2.0.0-beta.27
286
+
287
+ ### Patch Changes
288
+
289
+ - Updated dependencies [083947b]
290
+ - @ai-sdk/provider-utils@5.0.0-beta.22
291
+ - @ai-sdk/openai-compatible@3.0.0-beta.27
292
+
293
+ ## 2.0.0-beta.26
294
+
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies [add1126]
298
+ - @ai-sdk/provider-utils@5.0.0-beta.21
299
+ - @ai-sdk/openai-compatible@3.0.0-beta.26
300
+
301
+ ## 2.0.0-beta.25
302
+
303
+ ### Patch Changes
304
+
305
+ - b3976a2: Add workflow serialization support to all provider models.
306
+
307
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
308
+
309
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
310
+
311
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
312
+
313
+ - Updated dependencies [b3976a2]
314
+ - Updated dependencies [ff5eba1]
315
+ - @ai-sdk/provider-utils@5.0.0-beta.20
316
+ - @ai-sdk/openai-compatible@3.0.0-beta.25
317
+ - @ai-sdk/provider@4.0.0-beta.12
318
+
319
+ ## 2.0.0-beta.24
320
+
321
+ ### Major Changes
322
+
323
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies [ef992f8]
328
+ - @ai-sdk/openai-compatible@3.0.0-beta.24
329
+ - @ai-sdk/provider@4.0.0-beta.11
330
+ - @ai-sdk/provider-utils@5.0.0-beta.19
331
+
332
+ ## 2.0.0-beta.23
333
+
334
+ ### Patch Changes
335
+
336
+ - Updated dependencies [90e2d8a]
337
+ - @ai-sdk/openai-compatible@3.0.0-beta.23
338
+ - @ai-sdk/provider-utils@5.0.0-beta.18
339
+
340
+ ## 2.0.0-beta.22
341
+
342
+ ### Patch Changes
343
+
344
+ - Updated dependencies [3ae1786]
345
+ - @ai-sdk/provider-utils@5.0.0-beta.17
346
+ - @ai-sdk/openai-compatible@3.0.0-beta.22
347
+
348
+ ## 2.0.0-beta.21
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies [176466a]
353
+ - @ai-sdk/provider@4.0.0-beta.10
354
+ - @ai-sdk/openai-compatible@3.0.0-beta.21
355
+ - @ai-sdk/provider-utils@5.0.0-beta.16
356
+
357
+ ## 2.0.0-beta.20
358
+
359
+ ### Patch Changes
360
+
361
+ - Updated dependencies [e311194]
362
+ - @ai-sdk/provider@4.0.0-beta.9
363
+ - @ai-sdk/openai-compatible@3.0.0-beta.20
364
+ - @ai-sdk/provider-utils@5.0.0-beta.15
365
+
366
+ ## 2.0.0-beta.19
367
+
368
+ ### Patch Changes
369
+
370
+ - Updated dependencies [34bd95d]
371
+ - Updated dependencies [008271d]
372
+ - @ai-sdk/provider@4.0.0-beta.8
373
+ - @ai-sdk/openai-compatible@3.0.0-beta.19
374
+ - @ai-sdk/provider-utils@5.0.0-beta.14
375
+
376
+ ## 2.0.0-beta.18
377
+
378
+ ### Patch Changes
379
+
380
+ - Updated dependencies [b0c2869]
381
+ - Updated dependencies [7e26e81]
382
+ - @ai-sdk/provider-utils@5.0.0-beta.13
383
+ - @ai-sdk/openai-compatible@3.0.0-beta.18
384
+
385
+ ## 2.0.0-beta.17
386
+
387
+ ### Patch Changes
388
+
389
+ - Updated dependencies [816ff67]
390
+ - @ai-sdk/openai-compatible@3.0.0-beta.17
391
+
392
+ ## 2.0.0-beta.16
393
+
394
+ ### Patch Changes
395
+
396
+ - Updated dependencies [46d1149]
397
+ - @ai-sdk/provider-utils@5.0.0-beta.12
398
+ - @ai-sdk/openai-compatible@3.0.0-beta.16
399
+
400
+ ## 2.0.0-beta.15
401
+
402
+ ### Patch Changes
403
+
404
+ - Updated dependencies [6fd51c0]
405
+ - @ai-sdk/provider-utils@5.0.0-beta.11
406
+ - @ai-sdk/provider@4.0.0-beta.7
407
+ - @ai-sdk/openai-compatible@3.0.0-beta.15
408
+
409
+ ## 2.0.0-beta.14
410
+
411
+ ### Patch Changes
412
+
413
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
414
+ - Updated dependencies [c29a26f]
415
+ - @ai-sdk/openai-compatible@3.0.0-beta.14
416
+ - @ai-sdk/provider-utils@5.0.0-beta.10
417
+ - @ai-sdk/provider@4.0.0-beta.6
418
+
419
+ ## 2.0.0-beta.13
420
+
421
+ ### Patch Changes
422
+
423
+ - 38fc777: Add AI Gateway hint to provider READMEs
424
+ - Updated dependencies [38fc777]
425
+ - @ai-sdk/openai-compatible@3.0.0-beta.13
426
+
427
+ ## 2.0.0-beta.12
428
+
429
+ ### Patch Changes
430
+
431
+ - Updated dependencies [2e17091]
432
+ - @ai-sdk/provider-utils@5.0.0-beta.9
433
+ - @ai-sdk/openai-compatible@3.0.0-beta.12
434
+
435
+ ## 2.0.0-beta.11
436
+
437
+ ### Patch Changes
438
+
439
+ - Updated dependencies [986c6fd]
440
+ - Updated dependencies [493295c]
441
+ - @ai-sdk/provider-utils@5.0.0-beta.8
442
+ - @ai-sdk/openai-compatible@3.0.0-beta.11
443
+
444
+ ## 2.0.0-beta.10
445
+
446
+ ### Patch Changes
447
+
448
+ - Updated dependencies [1f509d4]
449
+ - @ai-sdk/provider-utils@5.0.0-beta.7
450
+ - @ai-sdk/provider@4.0.0-beta.5
451
+ - @ai-sdk/openai-compatible@3.0.0-beta.10
452
+
453
+ ## 2.0.0-beta.9
454
+
455
+ ### Patch Changes
456
+
457
+ - Updated dependencies [74d520f]
458
+ - @ai-sdk/openai-compatible@3.0.0-beta.9
459
+
460
+ ## 2.0.0-beta.8
461
+
462
+ ### Patch Changes
463
+
464
+ - Updated dependencies [3887c70]
465
+ - @ai-sdk/provider-utils@5.0.0-beta.6
466
+ - @ai-sdk/provider@4.0.0-beta.4
467
+ - @ai-sdk/openai-compatible@3.0.0-beta.8
468
+
469
+ ## 2.0.0-beta.7
470
+
471
+ ### Patch Changes
472
+
473
+ - Updated dependencies [776b617]
474
+ - @ai-sdk/provider-utils@5.0.0-beta.5
475
+ - @ai-sdk/provider@4.0.0-beta.3
476
+ - @ai-sdk/openai-compatible@3.0.0-beta.7
477
+
478
+ ## 2.0.0-beta.6
479
+
480
+ ### Patch Changes
481
+
482
+ - Updated dependencies [61753c3]
483
+ - @ai-sdk/provider-utils@5.0.0-beta.4
484
+ - @ai-sdk/openai-compatible@3.0.0-beta.6
485
+
3
486
  ## 2.0.0-beta.5
4
487
 
5
488
  ### Patch Changes
@@ -357,13 +840,13 @@
357
840
  Before
358
841
 
359
842
  ```ts
360
- model.textEmbeddingModel('my-model-id');
843
+ model.textEmbeddingModel("my-model-id");
361
844
  ```
362
845
 
363
846
  After
364
847
 
365
848
  ```ts
366
- model.embeddingModel('my-model-id');
849
+ model.embeddingModel("my-model-id");
367
850
  ```
368
851
 
369
852
  - 95f65c2: chore: use import \* from zod/v4
@@ -589,13 +1072,13 @@
589
1072
  Before
590
1073
 
591
1074
  ```ts
592
- model.textEmbeddingModel('my-model-id');
1075
+ model.textEmbeddingModel("my-model-id");
593
1076
  ```
594
1077
 
595
1078
  After
596
1079
 
597
1080
  ```ts
598
- model.embeddingModel('my-model-id');
1081
+ model.embeddingModel("my-model-id");
599
1082
  ```
600
1083
 
601
1084
  - Updated dependencies [8d9e8ad]
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The **[Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers/index)** for the [Vercel AI SDK](https://ai-sdk.dev/docs) contains language model support for thousands of models through multiple inference providers via the Hugging Face router API.
4
4
 
5
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Hugging Face (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
6
+
5
7
  ## Setup
6
8
 
7
9
  The Hugging Face provider is available in the `@ai-sdk/huggingface` module. You can install it with:
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
1
+ import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  export { OpenAICompatibleErrorData as HuggingFaceErrorData } from '@ai-sdk/openai-compatible';
4
4
 
@@ -29,19 +29,19 @@ interface HuggingFaceProviderSettings {
29
29
  fetch?: FetchFunction;
30
30
  generateId?: () => string;
31
31
  }
32
- interface HuggingFaceProvider extends ProviderV3 {
32
+ interface HuggingFaceProvider extends ProviderV4 {
33
33
  /**
34
34
  * Creates a Hugging Face responses model for text generation.
35
35
  */
36
- (modelId: HuggingFaceResponsesModelId): LanguageModelV3;
36
+ (modelId: HuggingFaceResponsesModelId): LanguageModelV4;
37
37
  /**
38
38
  * Creates a Hugging Face responses model for text generation.
39
39
  */
40
- languageModel(modelId: HuggingFaceResponsesModelId): LanguageModelV3;
40
+ languageModel(modelId: HuggingFaceResponsesModelId): LanguageModelV4;
41
41
  /**
42
42
  * Creates a Hugging Face responses model for text generation.
43
43
  */
44
- responses(modelId: HuggingFaceResponsesModelId): LanguageModelV3;
44
+ responses(modelId: HuggingFaceResponsesModelId): LanguageModelV4;
45
45
  /**
46
46
  * @deprecated Use `embeddingModel` instead.
47
47
  */
@@ -54,6 +54,8 @@ declare function createHuggingFace(options?: HuggingFaceProviderSettings): Huggi
54
54
  /**
55
55
  * Default Hugging Face provider instance.
56
56
  */
57
- declare const huggingface: HuggingFaceProvider;
57
+ declare const huggingFace: HuggingFaceProvider;
58
58
 
59
- export { type HuggingFaceProvider, type HuggingFaceProviderSettings, type HuggingFaceResponsesModelId, type HuggingFaceResponsesSettings, createHuggingFace, huggingface };
59
+ declare const VERSION: string;
60
+
61
+ export { type HuggingFaceProvider, type HuggingFaceProviderSettings, type HuggingFaceResponsesModelId, type HuggingFaceResponsesSettings, VERSION, createHuggingFace, huggingFace, huggingFace as huggingface };