@ai-sdk/replicate 3.0.0-beta.8 → 3.0.0-canary.33

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,221 @@
1
1
  # @ai-sdk/replicate
2
2
 
3
+ ## 3.0.0-canary.33
4
+
5
+ ### Patch Changes
6
+
7
+ - 0c4c275: trigger initial canary release
8
+ - Updated dependencies [0c4c275]
9
+ - @ai-sdk/provider-utils@5.0.0-canary.31
10
+ - @ai-sdk/provider@4.0.0-canary.15
11
+
12
+ ## 3.0.0-beta.32
13
+
14
+ ### Major Changes
15
+
16
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
17
+
18
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [08d2129]
23
+ - @ai-sdk/provider-utils@5.0.0-beta.30
24
+
25
+ ## 3.0.0-beta.31
26
+
27
+ ### Patch Changes
28
+
29
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
30
+ - Updated dependencies [9bd6512]
31
+ - Updated dependencies [258c093]
32
+ - Updated dependencies [b6783da]
33
+ - @ai-sdk/provider-utils@5.0.0-beta.29
34
+ - @ai-sdk/provider@4.0.0-beta.14
35
+
36
+ ## 3.0.0-beta.30
37
+
38
+ ### Patch Changes
39
+
40
+ - 9f0e36c: trigger release for all packages after provenance setup
41
+ - Updated dependencies [9f0e36c]
42
+ - @ai-sdk/provider@4.0.0-beta.13
43
+ - @ai-sdk/provider-utils@5.0.0-beta.28
44
+
45
+ ## 3.0.0-beta.29
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [785fe16]
50
+ - Updated dependencies [67df0a0]
51
+ - Updated dependencies [befb78c]
52
+ - Updated dependencies [0458559]
53
+ - Updated dependencies [5852c0a]
54
+ - Updated dependencies [fc92055]
55
+ - @ai-sdk/provider-utils@5.0.0-beta.27
56
+
57
+ ## 3.0.0-beta.28
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [2e98477]
62
+ - @ai-sdk/provider-utils@5.0.0-beta.26
63
+
64
+ ## 3.0.0-beta.27
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies [eea8d98]
69
+ - @ai-sdk/provider-utils@5.0.0-beta.25
70
+
71
+ ## 3.0.0-beta.26
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [f807e45]
76
+ - @ai-sdk/provider-utils@5.0.0-beta.24
77
+
78
+ ## 3.0.0-beta.25
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [350ea38]
83
+ - @ai-sdk/provider-utils@5.0.0-beta.23
84
+
85
+ ## 3.0.0-beta.24
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies [083947b]
90
+ - @ai-sdk/provider-utils@5.0.0-beta.22
91
+
92
+ ## 3.0.0-beta.23
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [add1126]
97
+ - @ai-sdk/provider-utils@5.0.0-beta.21
98
+
99
+ ## 3.0.0-beta.22
100
+
101
+ ### Patch Changes
102
+
103
+ - b3976a2: Add workflow serialization support to all provider models.
104
+
105
+ **`@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.
106
+
107
+ **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.
108
+
109
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
110
+
111
+ - Updated dependencies [b3976a2]
112
+ - Updated dependencies [ff5eba1]
113
+ - @ai-sdk/provider-utils@5.0.0-beta.20
114
+ - @ai-sdk/provider@4.0.0-beta.12
115
+
116
+ ## 3.0.0-beta.21
117
+
118
+ ### Major Changes
119
+
120
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [ef992f8]
125
+ - @ai-sdk/provider@4.0.0-beta.11
126
+ - @ai-sdk/provider-utils@5.0.0-beta.19
127
+
128
+ ## 3.0.0-beta.20
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [90e2d8a]
133
+ - @ai-sdk/provider-utils@5.0.0-beta.18
134
+
135
+ ## 3.0.0-beta.19
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [3ae1786]
140
+ - @ai-sdk/provider-utils@5.0.0-beta.17
141
+
142
+ ## 3.0.0-beta.18
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [176466a]
147
+ - @ai-sdk/provider@4.0.0-beta.10
148
+ - @ai-sdk/provider-utils@5.0.0-beta.16
149
+
150
+ ## 3.0.0-beta.17
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [e311194]
155
+ - @ai-sdk/provider@4.0.0-beta.9
156
+ - @ai-sdk/provider-utils@5.0.0-beta.15
157
+
158
+ ## 3.0.0-beta.16
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [34bd95d]
163
+ - Updated dependencies [008271d]
164
+ - @ai-sdk/provider@4.0.0-beta.8
165
+ - @ai-sdk/provider-utils@5.0.0-beta.14
166
+
167
+ ## 3.0.0-beta.15
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [b0c2869]
172
+ - Updated dependencies [7e26e81]
173
+ - @ai-sdk/provider-utils@5.0.0-beta.13
174
+
175
+ ## 3.0.0-beta.14
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [46d1149]
180
+ - @ai-sdk/provider-utils@5.0.0-beta.12
181
+
182
+ ## 3.0.0-beta.13
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [6fd51c0]
187
+ - @ai-sdk/provider-utils@5.0.0-beta.11
188
+ - @ai-sdk/provider@4.0.0-beta.7
189
+
190
+ ## 3.0.0-beta.12
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [c29a26f]
195
+ - @ai-sdk/provider-utils@5.0.0-beta.10
196
+ - @ai-sdk/provider@4.0.0-beta.6
197
+
198
+ ## 3.0.0-beta.11
199
+
200
+ ### Patch Changes
201
+
202
+ - 38fc777: Add AI Gateway hint to provider READMEs
203
+
204
+ ## 3.0.0-beta.10
205
+
206
+ ### Patch Changes
207
+
208
+ - Updated dependencies [2e17091]
209
+ - @ai-sdk/provider-utils@5.0.0-beta.9
210
+
211
+ ## 3.0.0-beta.9
212
+
213
+ ### Patch Changes
214
+
215
+ - Updated dependencies [986c6fd]
216
+ - Updated dependencies [493295c]
217
+ - @ai-sdk/provider-utils@5.0.0-beta.8
218
+
3
219
  ## 3.0.0-beta.8
4
220
 
5
221
  ### Patch Changes
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The **[Replicate provider](https://ai-sdk.dev/providers/ai-sdk-providers/replicate)** for the [AI SDK](https://ai-sdk.dev/docs) contains image model support for the Replicate API.
4
4
 
5
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Replicate (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 Replicate provider is available in the `@ai-sdk/replicate` module. You can install it with
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import * as _ai_sdk_provider from '@ai-sdk/provider';
1
2
  import { ImageModelV4, ProviderV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
2
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
4
+ import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
4
5
 
5
6
  type ReplicateImageModelId = 'black-forest-labs/flux-1.1-pro' | 'black-forest-labs/flux-1.1-pro-ultra' | 'black-forest-labs/flux-dev' | 'black-forest-labs/flux-pro' | 'black-forest-labs/flux-schnell' | 'bytedance/sdxl-lightning-4step' | 'fofr/aura-flow' | 'fofr/latent-consistency-model' | 'fofr/realvisxl-v3-multi-controlnet-lora' | 'fofr/sdxl-emoji' | 'fofr/sdxl-multi-controlnet-lora' | 'ideogram-ai/ideogram-v2' | 'ideogram-ai/ideogram-v2-turbo' | 'lucataco/dreamshaper-xl-turbo' | 'lucataco/open-dalle-v1.1' | 'lucataco/realvisxl-v2.0' | 'lucataco/realvisxl2-lcm' | 'luma/photon' | 'luma/photon-flash' | 'nvidia/sana' | 'playgroundai/playground-v2.5-1024px-aesthetic' | 'recraft-ai/recraft-v3' | 'recraft-ai/recraft-v3-svg' | 'stability-ai/stable-diffusion-3.5-large' | 'stability-ai/stable-diffusion-3.5-large-turbo' | 'stability-ai/stable-diffusion-3.5-medium' | 'tstramer/material-diffusion' | 'black-forest-labs/flux-fill-pro' | 'black-forest-labs/flux-fill-dev' | 'black-forest-labs/flux-2-pro' | 'black-forest-labs/flux-2-dev' | (string & {});
6
7
 
@@ -20,27 +21,17 @@ declare class ReplicateImageModel implements ImageModelV4 {
20
21
  get maxImagesPerCall(): number;
21
22
  get provider(): string;
22
23
  private get isFlux2Model();
24
+ static [WORKFLOW_SERIALIZE](model: ReplicateImageModel): {
25
+ modelId: string;
26
+ config: _ai_sdk_provider.JSONObject;
27
+ };
28
+ static [WORKFLOW_DESERIALIZE](options: {
29
+ modelId: ReplicateImageModelId;
30
+ config: ReplicateImageModelConfig;
31
+ }): ReplicateImageModel;
23
32
  constructor(modelId: ReplicateImageModelId, config: ReplicateImageModelConfig);
24
33
  doGenerate({ prompt, n, aspectRatio, size, seed, providerOptions, headers, abortSignal, files, mask, }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
25
34
  }
26
- /**
27
- * Provider options schema for Replicate image generation.
28
- *
29
- * Note: Different Replicate models support different parameters.
30
- * This schema includes common parameters, but you can pass any
31
- * model-specific parameters through the passthrough.
32
- */
33
- declare const replicateImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
34
- [x: string]: unknown;
35
- maxWaitTimeInSeconds?: number | null | undefined;
36
- guidance_scale?: number | null | undefined;
37
- num_inference_steps?: number | null | undefined;
38
- negative_prompt?: string | null | undefined;
39
- output_format?: "png" | "jpg" | "webp" | null | undefined;
40
- output_quality?: number | null | undefined;
41
- strength?: number | null | undefined;
42
- }>;
43
- type ReplicateImageModelOptions = InferSchema<typeof replicateImageModelOptionsSchema>;
44
35
 
45
36
  type ReplicateVideoModelId = 'minimax/video-01' | 'minimax/video-01:6c1e4171-288a-4ca2-a738-894f0e87699d' | 'stability-ai/stable-video-diffusion:3f0457e4619daac51203dedb472816fd4af51f3149fa7a9e0b5ffcf1b8172438' | (string & {});
46
37
 
@@ -96,6 +87,25 @@ declare function createReplicate(options?: ReplicateProviderSettings): Replicate
96
87
  */
97
88
  declare const replicate: ReplicateProvider;
98
89
 
90
+ /**
91
+ * Provider options schema for Replicate image generation.
92
+ *
93
+ * Note: Different Replicate models support different parameters.
94
+ * This schema includes common parameters, but you can pass any
95
+ * model-specific parameters through the passthrough.
96
+ */
97
+ declare const replicateImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
98
+ [x: string]: unknown;
99
+ maxWaitTimeInSeconds?: number | null | undefined;
100
+ guidance_scale?: number | null | undefined;
101
+ num_inference_steps?: number | null | undefined;
102
+ negative_prompt?: string | null | undefined;
103
+ output_format?: "png" | "jpg" | "webp" | null | undefined;
104
+ output_quality?: number | null | undefined;
105
+ strength?: number | null | undefined;
106
+ }>;
107
+ type ReplicateImageModelOptions = InferSchema<typeof replicateImageModelOptionsSchema>;
108
+
99
109
  type ReplicateVideoModelOptions = {
100
110
  pollIntervalMs?: number | null;
101
111
  pollTimeoutMs?: number | null;