@ai-sdk/huggingface 2.0.0-beta.3 → 2.0.0-beta.30

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,248 @@
1
1
  # @ai-sdk/huggingface
2
2
 
3
+ ## 2.0.0-beta.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [eea8d98]
8
+ - @ai-sdk/provider-utils@5.0.0-beta.25
9
+ - @ai-sdk/openai-compatible@3.0.0-beta.30
10
+
11
+ ## 2.0.0-beta.29
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [f807e45]
16
+ - @ai-sdk/provider-utils@5.0.0-beta.24
17
+ - @ai-sdk/openai-compatible@3.0.0-beta.29
18
+
19
+ ## 2.0.0-beta.28
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [350ea38]
24
+ - @ai-sdk/provider-utils@5.0.0-beta.23
25
+ - @ai-sdk/openai-compatible@3.0.0-beta.28
26
+
27
+ ## 2.0.0-beta.27
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [083947b]
32
+ - @ai-sdk/provider-utils@5.0.0-beta.22
33
+ - @ai-sdk/openai-compatible@3.0.0-beta.27
34
+
35
+ ## 2.0.0-beta.26
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [add1126]
40
+ - @ai-sdk/provider-utils@5.0.0-beta.21
41
+ - @ai-sdk/openai-compatible@3.0.0-beta.26
42
+
43
+ ## 2.0.0-beta.25
44
+
45
+ ### Patch Changes
46
+
47
+ - b3976a2: Add workflow serialization support to all provider models.
48
+
49
+ **`@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.
50
+
51
+ **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.
52
+
53
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
54
+
55
+ - Updated dependencies [b3976a2]
56
+ - Updated dependencies [ff5eba1]
57
+ - @ai-sdk/provider-utils@5.0.0-beta.20
58
+ - @ai-sdk/openai-compatible@3.0.0-beta.25
59
+ - @ai-sdk/provider@4.0.0-beta.12
60
+
61
+ ## 2.0.0-beta.24
62
+
63
+ ### Major Changes
64
+
65
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [ef992f8]
70
+ - @ai-sdk/openai-compatible@3.0.0-beta.24
71
+ - @ai-sdk/provider@4.0.0-beta.11
72
+ - @ai-sdk/provider-utils@5.0.0-beta.19
73
+
74
+ ## 2.0.0-beta.23
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [90e2d8a]
79
+ - @ai-sdk/openai-compatible@3.0.0-beta.23
80
+ - @ai-sdk/provider-utils@5.0.0-beta.18
81
+
82
+ ## 2.0.0-beta.22
83
+
84
+ ### Patch Changes
85
+
86
+ - Updated dependencies [3ae1786]
87
+ - @ai-sdk/provider-utils@5.0.0-beta.17
88
+ - @ai-sdk/openai-compatible@3.0.0-beta.22
89
+
90
+ ## 2.0.0-beta.21
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [176466a]
95
+ - @ai-sdk/provider@4.0.0-beta.10
96
+ - @ai-sdk/openai-compatible@3.0.0-beta.21
97
+ - @ai-sdk/provider-utils@5.0.0-beta.16
98
+
99
+ ## 2.0.0-beta.20
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies [e311194]
104
+ - @ai-sdk/provider@4.0.0-beta.9
105
+ - @ai-sdk/openai-compatible@3.0.0-beta.20
106
+ - @ai-sdk/provider-utils@5.0.0-beta.15
107
+
108
+ ## 2.0.0-beta.19
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies [34bd95d]
113
+ - Updated dependencies [008271d]
114
+ - @ai-sdk/provider@4.0.0-beta.8
115
+ - @ai-sdk/openai-compatible@3.0.0-beta.19
116
+ - @ai-sdk/provider-utils@5.0.0-beta.14
117
+
118
+ ## 2.0.0-beta.18
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [b0c2869]
123
+ - Updated dependencies [7e26e81]
124
+ - @ai-sdk/provider-utils@5.0.0-beta.13
125
+ - @ai-sdk/openai-compatible@3.0.0-beta.18
126
+
127
+ ## 2.0.0-beta.17
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [816ff67]
132
+ - @ai-sdk/openai-compatible@3.0.0-beta.17
133
+
134
+ ## 2.0.0-beta.16
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [46d1149]
139
+ - @ai-sdk/provider-utils@5.0.0-beta.12
140
+ - @ai-sdk/openai-compatible@3.0.0-beta.16
141
+
142
+ ## 2.0.0-beta.15
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [6fd51c0]
147
+ - @ai-sdk/provider-utils@5.0.0-beta.11
148
+ - @ai-sdk/provider@4.0.0-beta.7
149
+ - @ai-sdk/openai-compatible@3.0.0-beta.15
150
+
151
+ ## 2.0.0-beta.14
152
+
153
+ ### Patch Changes
154
+
155
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
156
+ - Updated dependencies [c29a26f]
157
+ - @ai-sdk/openai-compatible@3.0.0-beta.14
158
+ - @ai-sdk/provider-utils@5.0.0-beta.10
159
+ - @ai-sdk/provider@4.0.0-beta.6
160
+
161
+ ## 2.0.0-beta.13
162
+
163
+ ### Patch Changes
164
+
165
+ - 38fc777: Add AI Gateway hint to provider READMEs
166
+ - Updated dependencies [38fc777]
167
+ - @ai-sdk/openai-compatible@3.0.0-beta.13
168
+
169
+ ## 2.0.0-beta.12
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [2e17091]
174
+ - @ai-sdk/provider-utils@5.0.0-beta.9
175
+ - @ai-sdk/openai-compatible@3.0.0-beta.12
176
+
177
+ ## 2.0.0-beta.11
178
+
179
+ ### Patch Changes
180
+
181
+ - Updated dependencies [986c6fd]
182
+ - Updated dependencies [493295c]
183
+ - @ai-sdk/provider-utils@5.0.0-beta.8
184
+ - @ai-sdk/openai-compatible@3.0.0-beta.11
185
+
186
+ ## 2.0.0-beta.10
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies [1f509d4]
191
+ - @ai-sdk/provider-utils@5.0.0-beta.7
192
+ - @ai-sdk/provider@4.0.0-beta.5
193
+ - @ai-sdk/openai-compatible@3.0.0-beta.10
194
+
195
+ ## 2.0.0-beta.9
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [74d520f]
200
+ - @ai-sdk/openai-compatible@3.0.0-beta.9
201
+
202
+ ## 2.0.0-beta.8
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [3887c70]
207
+ - @ai-sdk/provider-utils@5.0.0-beta.6
208
+ - @ai-sdk/provider@4.0.0-beta.4
209
+ - @ai-sdk/openai-compatible@3.0.0-beta.8
210
+
211
+ ## 2.0.0-beta.7
212
+
213
+ ### Patch Changes
214
+
215
+ - Updated dependencies [776b617]
216
+ - @ai-sdk/provider-utils@5.0.0-beta.5
217
+ - @ai-sdk/provider@4.0.0-beta.3
218
+ - @ai-sdk/openai-compatible@3.0.0-beta.7
219
+
220
+ ## 2.0.0-beta.6
221
+
222
+ ### Patch Changes
223
+
224
+ - Updated dependencies [61753c3]
225
+ - @ai-sdk/provider-utils@5.0.0-beta.4
226
+ - @ai-sdk/openai-compatible@3.0.0-beta.6
227
+
228
+ ## 2.0.0-beta.5
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies [f7d4f01]
233
+ - @ai-sdk/provider-utils@5.0.0-beta.3
234
+ - @ai-sdk/provider@4.0.0-beta.2
235
+ - @ai-sdk/openai-compatible@3.0.0-beta.5
236
+
237
+ ## 2.0.0-beta.4
238
+
239
+ ### Patch Changes
240
+
241
+ - Updated dependencies [5c2a5a2]
242
+ - @ai-sdk/provider@4.0.0-beta.1
243
+ - @ai-sdk/openai-compatible@3.0.0-beta.4
244
+ - @ai-sdk/provider-utils@5.0.0-beta.2
245
+
3
246
  ## 2.0.0-beta.3
4
247
 
5
248
  ### Patch Changes
@@ -339,13 +582,13 @@
339
582
  Before
340
583
 
341
584
  ```ts
342
- model.textEmbeddingModel('my-model-id');
585
+ model.textEmbeddingModel("my-model-id");
343
586
  ```
344
587
 
345
588
  After
346
589
 
347
590
  ```ts
348
- model.embeddingModel('my-model-id');
591
+ model.embeddingModel("my-model-id");
349
592
  ```
350
593
 
351
594
  - 95f65c2: chore: use import \* from zod/v4
@@ -571,13 +814,13 @@
571
814
  Before
572
815
 
573
816
  ```ts
574
- model.textEmbeddingModel('my-model-id');
817
+ model.textEmbeddingModel("my-model-id");
575
818
  ```
576
819
 
577
820
  After
578
821
 
579
822
  ```ts
580
- model.embeddingModel('my-model-id');
823
+ model.embeddingModel("my-model-id");
581
824
  ```
582
825
 
583
826
  - 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
  */