@ai-sdk/google-vertex 5.0.146 → 5.0.148

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/anthropic/edge/index.d.ts +561 -88
  3. package/dist/anthropic/edge/index.d.ts.map +1 -1
  4. package/dist/anthropic/edge/index.js +1 -1
  5. package/dist/anthropic/index.d.ts +561 -88
  6. package/dist/anthropic/index.d.ts.map +1 -1
  7. package/dist/edge/index.d.ts +561 -88
  8. package/dist/edge/index.d.ts.map +1 -1
  9. package/dist/edge/index.js +671 -359
  10. package/dist/edge/index.js.map +1 -1
  11. package/dist/index.d.ts +561 -88
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +671 -359
  14. package/dist/index.js.map +1 -1
  15. package/dist/maas/edge/index.d.ts +561 -88
  16. package/dist/maas/edge/index.d.ts.map +1 -1
  17. package/dist/maas/edge/index.js +365 -18
  18. package/dist/maas/edge/index.js.map +1 -1
  19. package/dist/maas/index.d.ts +561 -88
  20. package/dist/maas/index.d.ts.map +1 -1
  21. package/dist/maas/index.js +364 -17
  22. package/dist/maas/index.js.map +1 -1
  23. package/dist/xai/edge/index.d.ts +561 -88
  24. package/dist/xai/edge/index.d.ts.map +1 -1
  25. package/dist/xai/edge/index.js +1 -1
  26. package/dist/xai/index.d.ts +561 -88
  27. package/dist/xai/index.d.ts.map +1 -1
  28. package/package.json +5 -5
  29. package/src/gemini-transcription/google-vertex-gemini-transcription-model.ts +1 -1
  30. package/src/google-vertex-embedding-model.ts +1 -1
  31. package/src/google-vertex-image-model.ts +1 -1
  32. package/src/google-vertex-model-catalog.ts +213 -436
  33. package/src/google-vertex-model-matrix.ts +799 -0
  34. package/src/google-vertex-provider-base.ts +1 -1
  35. package/src/maas/google-vertex-maas-provider.ts +1 -1
  36. package/src/google-vertex-model-catalog-config.ts +0 -42
@@ -1,7 +1,28 @@
1
1
  import {
2
- getGoogleVertexRequestConfig as requestConfig,
2
+ anthropicModelDefinitions,
3
+ embeddingModelDefinitions,
4
+ findRow,
5
+ getGoogleVertexRequestConfig,
6
+ getUnlistedImageModelRow,
7
+ imageModelDefinitions,
8
+ languageModelDefinitions,
9
+ listedLanguageRequestConfig,
10
+ maasModelDefinitions,
11
+ speechModelDefinitions,
12
+ transcriptionModelDefinitions,
13
+ videoModelDefinitions,
14
+ xaiModelDefinitions,
15
+ type GoogleVertexAnthropicModelRow,
16
+ type GoogleVertexEmbeddingModelRow,
17
+ type GoogleVertexImageModelRow,
18
+ type GoogleVertexLanguageModelRow,
19
+ type GoogleVertexMaasModelRow,
20
+ type GoogleVertexSpeechModelRow,
21
+ type GoogleVertexTranscriptionModelRow,
22
+ type GoogleVertexVideoModelRow,
23
+ type GoogleVertexXaiModelRow,
3
24
  type VertexRequestConfig,
4
- } from './google-vertex-model-catalog-config';
25
+ } from './google-vertex-model-matrix';
5
26
  import type {
6
27
  ModelEntry,
7
28
  ProviderOptionDefinition,
@@ -15,95 +36,6 @@ import type { GoogleVertexEmbeddingModelOptions } from './google-vertex-embeddin
15
36
  import type { GoogleVertexTranscriptionModelOptions } from './google-vertex-transcription-model-options';
16
37
  import type { GoogleVertexTranscriptionModelGeminiOptions } from './gemini-transcription/google-vertex-gemini-transcription-model-options';
17
38
  import type { GoogleVertexSpeechModelOptions } from './google-vertex-speech-model-options';
18
- const documentedImageDetails: Record<
19
- string,
20
- { imageGeneration: boolean; aspectRatios: readonly string[] }
21
- > = {
22
- 'gemini-nano-banana-2.1': {
23
- imageGeneration: true,
24
- aspectRatios: [
25
- '1:1',
26
- '2:3',
27
- '3:2',
28
- '3:4',
29
- '4:3',
30
- '4:5',
31
- '5:4',
32
- '9:16',
33
- '16:9',
34
- '21:9',
35
- '1:8',
36
- '8:1',
37
- '1:4',
38
- '4:1',
39
- ],
40
- },
41
- 'gemini-3.1-flash-image-preview': {
42
- imageGeneration: true,
43
- aspectRatios: [
44
- '1:1',
45
- '2:3',
46
- '3:2',
47
- '3:4',
48
- '4:3',
49
- '4:5',
50
- '5:4',
51
- '9:16',
52
- '16:9',
53
- '21:9',
54
- ],
55
- },
56
- 'gemini-3-pro-image-preview': {
57
- imageGeneration: true,
58
- aspectRatios: [
59
- '1:1',
60
- '2:3',
61
- '3:2',
62
- '3:4',
63
- '4:3',
64
- '4:5',
65
- '5:4',
66
- '9:16',
67
- '16:9',
68
- '21:9',
69
- ],
70
- },
71
- 'gemini-2.5-flash-image': {
72
- imageGeneration: true,
73
- aspectRatios: [
74
- '1:1',
75
- '2:3',
76
- '3:2',
77
- '3:4',
78
- '4:3',
79
- '4:5',
80
- '5:4',
81
- '9:16',
82
- '16:9',
83
- '21:9',
84
- ],
85
- },
86
- };
87
- const documentedTranscriptionDetails: Record<
88
- string,
89
- { wordTimestampDescription: string; languageDetectionDescription: string }
90
- > = {
91
- chirp_2: {
92
- wordTimestampDescription:
93
- 'Available with a potential quality and speed tradeoff',
94
- languageDetectionDescription: "Auto detection with `['auto']`",
95
- },
96
- chirp_3: {
97
- wordTimestampDescription:
98
- 'Available with a potential transcription quality tradeoff',
99
- languageDetectionDescription: "Auto detection with `['auto']`",
100
- },
101
- telephony: {
102
- wordTimestampDescription: 'Available',
103
- languageDetectionDescription:
104
- 'Explicit supported language codes, with alternative language detection support',
105
- },
106
- };
107
39
 
108
40
  export const googleVertexProviderOptions = {
109
41
  language: googleProviderOptions.language,
@@ -167,31 +99,49 @@ export const googleVertexProviderOptions = {
167
99
  },
168
100
  } as const satisfies ProviderOptionDefinitions;
169
101
 
102
+ /*
103
+ * The builders that turn a row of a model matrix into a catalog entry, and
104
+ * the catalogs built from them. The matrices are in
105
+ * `google-vertex-model-matrix.ts`. Nothing here inspects the model ID.
106
+ */
107
+
170
108
  type VertexEntry = ModelEntry<VertexRequestConfig>;
171
109
 
172
- function languageEntry(modelId: string): VertexEntry {
173
- const entry = getGoogleLanguageModelEntry(modelId);
110
+ /**
111
+ * Vertex AI restrictions on a Google language model. They hold for every
112
+ * model, so they are applied here instead of being a column.
113
+ */
114
+ const vertexLanguageProviderOptionOverrides = { serviceTier: false } as const;
115
+
116
+ function createLanguageModelEntry(
117
+ row: GoogleVertexLanguageModelRow,
118
+ ): VertexEntry {
119
+ const google = getGoogleLanguageModelEntry(row.googleModelId);
174
120
  return {
175
- capabilities: { language: entry.capabilities.language },
121
+ capabilities: { language: google.capabilities.language },
176
122
  providerOptions: {
177
- language: { ...entry.providerOptions.language, serviceTier: false },
123
+ language: {
124
+ ...google.providerOptions.language,
125
+ ...vertexLanguageProviderOptionOverrides,
126
+ },
178
127
  },
179
- requestConfig: { language: requestConfig(modelId).language },
128
+ requestConfig: { language: listedLanguageRequestConfig },
180
129
  };
181
130
  }
182
131
 
183
- export function getGoogleVertexImageModelEntry(modelId: string): VertexEntry {
184
- const known = imageModelIds.some(id => id === modelId);
132
+ function createImageModelEntry(row: GoogleVertexImageModelRow): VertexEntry {
185
133
  return {
186
134
  capabilities: {
187
135
  image: {
188
136
  sizes: {
189
137
  description: 'Use aspectRatio; the size option is unsupported.',
190
138
  },
191
- fileInput: known ? true : 'unknown',
192
- maskInput: known ? false : 'unknown',
139
+ fileInput: row.documented ? true : 'unknown',
140
+ maskInput: row.documented ? false : 'unknown',
193
141
  maxImagesPerCall: 1,
194
- ...documentedImageDetails[modelId],
142
+ ...(row.documented
143
+ ? { imageGeneration: true, aspectRatios: row.aspectRatios }
144
+ : {}),
195
145
  },
196
146
  },
197
147
  providerOptions: {
@@ -207,23 +157,22 @@ export function getGoogleVertexImageModelEntry(modelId: string): VertexEntry {
207
157
  ]),
208
158
  ),
209
159
  },
210
- requestConfig: { image: requestConfig(modelId).image },
160
+ requestConfig: { image: { gemini: row.api === 'gemini' } },
211
161
  };
212
162
  }
213
163
 
214
- function embeddingEntry(modelId: string): VertexEntry {
215
- const gemini = modelId.startsWith('gemini-embedding-');
164
+ function createEmbeddingModelEntry(
165
+ row: GoogleVertexEmbeddingModelRow,
166
+ ): VertexEntry {
216
167
  return {
217
168
  capabilities: {
218
169
  embedding: {
219
- defaultDimensions: gemini ? 3072 : 768,
170
+ defaultDimensions: row.defaultDimensions,
220
171
  customDimensions: 'unknown',
221
172
  ...{
222
- maxEmbeddingsPerCall:
223
- requestConfig(modelId).embedding!.maxEmbeddingsPerCall,
173
+ maxEmbeddingsPerCall: row.maxEmbeddingsPerCall,
224
174
  supportsParallelCalls: true,
225
- multimodal:
226
- requestConfig(modelId).embedding!.endpoint === 'embedContent',
175
+ multimodal: row.multimodal,
227
176
  },
228
177
  },
229
178
  },
@@ -235,63 +184,16 @@ function embeddingEntry(modelId: string): VertexEntry {
235
184
  autoTruncate: true,
236
185
  },
237
186
  },
238
- requestConfig: { embedding: requestConfig(modelId).embedding },
239
- };
240
- }
241
-
242
- function speechEntry(modelId: string): VertexEntry {
243
- const chirp = requestConfig(modelId).speech?.api === 'cloud-tts';
244
- return {
245
- capabilities: {
246
- speech: { instructions: !chirp, ...{ multiSpeaker: !chirp } },
247
- },
248
- providerOptions: {
249
- speech: {
250
- multiSpeakerVoiceConfig: chirp ? false : true,
251
- speechMetadata: chirp
252
- ? false
253
- : { condition: 'Requires Gemini 3.8 TTS.' },
254
- turns: chirp ? false : { condition: 'Requires Gemini 3.8 TTS.' },
255
- },
256
- },
257
- requestConfig: { speech: requestConfig(modelId).speech },
258
- };
259
- }
260
-
261
- function transcriptionEntry(modelId: string): VertexEntry {
262
- const config = requestConfig(modelId).transcription!;
263
- const gemini = config.api === 'gemini';
264
- return {
265
- capabilities: {
266
- transcription: {
267
- transcription: !config.live,
268
- streaming: config.live,
269
- duration: gemini ? false : true,
270
- segments: config.live
271
- ? false
272
- : { condition: 'Requires word timestamps.' },
273
- language: true,
274
- ...documentedTranscriptionDetails[modelId],
275
- },
276
- },
277
- providerOptions: {
278
- transcription: {
279
- languageCodes: true,
280
- enableAutomaticPunctuation: !gemini,
281
- enableWordTimeOffsets: !gemini,
282
- region: !gemini,
283
- customVocabulary: gemini,
284
- wordTimestamp: gemini,
285
- diarization: gemini,
286
- mode: gemini,
187
+ requestConfig: {
188
+ embedding: {
189
+ endpoint: row.endpoint,
190
+ maxEmbeddingsPerCall: row.maxEmbeddingsPerCall,
287
191
  },
288
192
  },
289
- requestConfig: { transcription: config },
290
193
  };
291
194
  }
292
195
 
293
- function videoEntry(modelId: string): VertexEntry {
294
- const veo3 = modelId.startsWith('veo-3');
196
+ function createVideoModelEntry(row: GoogleVertexVideoModelRow): VertexEntry {
295
197
  return {
296
198
  capabilities: {
297
199
  video: {
@@ -307,7 +209,7 @@ function videoEntry(modelId: string): VertexEntry {
307
209
  },
308
210
  referenceVideo: false,
309
211
  },
310
- generateAudio: veo3,
212
+ generateAudio: row.generateAudio,
311
213
  aspectRatio: true,
312
214
  resolution: true,
313
215
  duration: true,
@@ -322,7 +224,7 @@ function videoEntry(modelId: string): VertexEntry {
322
224
  pollTimeoutMs: true,
323
225
  personGeneration: true,
324
226
  negativePrompt: true,
325
- generateAudio: veo3,
227
+ generateAudio: row.generateAudio,
326
228
  gcsOutputDirectory: true,
327
229
  referenceImages: {
328
230
  condition: 'Requires a Veo model supporting reference images.',
@@ -332,117 +234,91 @@ function videoEntry(modelId: string): VertexEntry {
332
234
  };
333
235
  }
334
236
 
335
- const languageModelIds = [
336
- 'gemini-nano-banana-2.1',
337
- 'gemini-4-argon',
338
- 'gemini-4-carbon',
339
- 'gemini-4-hydrogen',
340
- 'gemini-4-neon',
341
- 'gemini-3.8-flash',
342
- 'gemini-3.7-flash',
343
- 'gemini-3.6-flash',
344
- 'gemini-3.5-flash',
345
- 'gemini-3.5-flash-lite',
346
- 'gemini-2.5-pro',
347
- 'gemini-2.5-flash',
348
- 'gemini-2.5-flash-lite',
349
- 'gemini-2.0-flash-lite',
350
- 'gemini-2.0-flash',
351
- 'gemini-2.0-flash-001',
352
- 'gemini-1.5-flash',
353
- 'gemini-1.5-flash-001',
354
- 'gemini-1.5-flash-002',
355
- 'gemini-1.5-pro',
356
- 'gemini-1.5-pro-001',
357
- 'gemini-1.5-pro-002',
358
- 'gemini-1.0-pro-001',
359
- 'gemini-1.0-pro-vision-001',
360
- 'gemini-1.0-pro',
361
- 'gemini-1.0-pro-002',
362
- 'gemini-2.0-flash-lite-preview-02-05',
363
- 'gemini-2.5-flash-preview-09-2025',
364
- 'gemini-3-pro-preview',
365
- 'gemini-3-pro-image-preview',
366
- 'gemini-3-flash-preview',
367
- 'gemini-3.1-pro-preview',
368
- 'gemini-3.1-flash-image-preview',
369
- 'gemini-3.1-flash-lite-preview',
370
- 'gemini-2.0-pro-exp-02-05',
371
- 'gemini-2.0-flash-exp',
372
- ] as const;
373
-
374
- const imageModelIds = [
375
- 'gemini-2.5-flash-image',
376
- 'gemini-3-pro-image-preview',
377
- 'gemini-3.1-flash-image-preview',
378
- 'gemini-nano-banana-2.1',
379
- ] as const;
380
-
381
- const embeddingModelIds = [
382
- 'textembedding-gecko',
383
- 'textembedding-gecko@001',
384
- 'textembedding-gecko@003',
385
- 'textembedding-gecko-multilingual',
386
- 'textembedding-gecko-multilingual@001',
387
- 'text-multilingual-embedding-002',
388
- 'text-embedding-004',
389
- 'text-embedding-005',
390
- 'gemini-embedding-001',
391
- 'gemini-embedding-2',
392
- 'gemini-embedding-2-preview',
393
- ] as const;
394
-
395
- const videoModelIds = [
396
- 'veo-2.0-generate-preview',
397
- 'veo-2.0-generate-exp',
398
- 'veo-2.0-generate-001',
399
- 'veo-3.0-generate-001',
400
- 'veo-3.0-fast-generate-001',
401
- 'veo-3.0-generate-preview',
402
- 'veo-3.0-fast-generate-preview',
403
- 'veo-3.1-generate-001',
404
- 'veo-3.1-fast-generate-001',
405
- 'veo-3.1-generate-preview',
406
- 'veo-3.1-fast-generate-preview',
407
- ] as const;
408
-
409
- const speechModelIds = [
410
- 'gemini-2.5-flash-tts',
411
- 'gemini-2.5-pro-tts',
412
- 'gemini-2.5-flash-lite-preview-tts',
413
- 'gemini-3.1-flash-tts-preview',
414
- 'chirp-3-hd',
415
- ] as const;
237
+ function createSpeechModelEntry(row: GoogleVertexSpeechModelRow): VertexEntry {
238
+ return {
239
+ capabilities: {
240
+ speech: {
241
+ instructions: row.instructions,
242
+ ...{ multiSpeaker: row.multiSpeaker },
243
+ },
244
+ },
245
+ providerOptions: {
246
+ speech: {
247
+ multiSpeakerVoiceConfig: row.multiSpeaker,
248
+ speechMetadata: row.speechMetadata,
249
+ turns: row.turns,
250
+ },
251
+ },
252
+ requestConfig: { speech: { api: row.api } },
253
+ };
254
+ }
416
255
 
417
- const transcriptionModelIds = ['chirp_2', 'chirp_3', 'telephony'] as const;
256
+ function createTranscriptionModelEntry(
257
+ row: GoogleVertexTranscriptionModelRow,
258
+ ): VertexEntry {
259
+ const gemini = row.api === 'gemini';
260
+ return {
261
+ capabilities: {
262
+ transcription: {
263
+ transcription: row.mode === 'batch',
264
+ streaming: row.mode === 'live',
265
+ duration: row.duration,
266
+ segments: row.segments,
267
+ language: true,
268
+ ...(row.wordTimestamps != null
269
+ ? { wordTimestampDescription: row.wordTimestamps }
270
+ : {}),
271
+ ...(row.languageDetection != null
272
+ ? { languageDetectionDescription: row.languageDetection }
273
+ : {}),
274
+ },
275
+ },
276
+ providerOptions: {
277
+ transcription: {
278
+ // Cloud Speech-to-Text options
279
+ languageCodes: true,
280
+ enableAutomaticPunctuation: !gemini,
281
+ enableWordTimeOffsets: !gemini,
282
+ region: !gemini,
283
+ // Gemini options
284
+ customVocabulary: gemini,
285
+ wordTimestamp: gemini,
286
+ diarization: gemini,
287
+ mode: gemini,
288
+ },
289
+ },
290
+ requestConfig: {
291
+ transcription: { api: row.api, live: row.mode === 'live' },
292
+ },
293
+ };
294
+ }
418
295
 
419
- const geminiTranscriptionModelIds = [
420
- 'gemini-3.5-transcribe',
421
- 'gemini-3.5-transcribe-live',
422
- ] as const;
296
+ // Vertex AI model catalog (Google models)
423
297
 
424
298
  const entries: [string, VertexEntry][] = [
425
- ...languageModelIds.map((id): [string, VertexEntry] => [
426
- id,
427
- languageEntry(id),
428
- ]),
429
- ...imageModelIds.map((id): [string, VertexEntry] => [
430
- id,
431
- getGoogleVertexImageModelEntry(id),
432
- ]),
433
- ...embeddingModelIds.map((id): [string, VertexEntry] => [
434
- id,
435
- embeddingEntry(id),
436
- ]),
437
- ...videoModelIds.map((id): [string, VertexEntry] => [id, videoEntry(id)]),
438
- ...speechModelIds.map((id): [string, VertexEntry] => [id, speechEntry(id)]),
439
- ...transcriptionModelIds.map((id): [string, VertexEntry] => [
299
+ ...Object.entries<GoogleVertexLanguageModelRow>(languageModelDefinitions).map(
300
+ ([id, row]): [string, VertexEntry] => [id, createLanguageModelEntry(row)],
301
+ ),
302
+ ...Object.entries<GoogleVertexImageModelRow>(imageModelDefinitions).map(
303
+ ([id, row]): [string, VertexEntry] => [id, createImageModelEntry(row)],
304
+ ),
305
+ ...Object.entries<GoogleVertexEmbeddingModelRow>(
306
+ embeddingModelDefinitions,
307
+ ).map(([id, row]): [string, VertexEntry] => [
440
308
  id,
441
- transcriptionEntry(id),
309
+ createEmbeddingModelEntry(row),
442
310
  ]),
443
- ...geminiTranscriptionModelIds.map((id): [string, VertexEntry] => [
311
+ ...Object.entries<GoogleVertexVideoModelRow>(videoModelDefinitions).map(
312
+ ([id, row]): [string, VertexEntry] => [id, createVideoModelEntry(row)],
313
+ ),
314
+ ...Object.entries<GoogleVertexSpeechModelRow>(speechModelDefinitions).map(
315
+ ([id, row]): [string, VertexEntry] => [id, createSpeechModelEntry(row)],
316
+ ),
317
+ ...Object.entries<GoogleVertexTranscriptionModelRow>(
318
+ transcriptionModelDefinitions,
319
+ ).map(([id, row]): [string, VertexEntry] => [
444
320
  id,
445
- transcriptionEntry(id),
321
+ createTranscriptionModelEntry(row),
446
322
  ]),
447
323
  ];
448
324
 
@@ -461,185 +337,86 @@ export const googleVertexModelCatalog: Readonly<Record<string, VertexEntry>> =
461
337
  return catalog;
462
338
  }, {});
463
339
 
464
- const vertexAnthropicModels = {
465
- 'claude-fable-5-1': {
466
- image: true,
467
- objectGeneration: true,
468
- tools: true,
469
- streaming: true,
470
- computerUse: true,
471
- },
472
- 'claude-fable-5-2': {
473
- image: true,
474
- objectGeneration: true,
475
- tools: true,
476
- streaming: true,
477
- computerUse: true,
478
- },
479
- 'claude-3-7-sonnet@20250219': {
480
- image: true,
481
- objectGeneration: true,
482
- tools: true,
483
- streaming: true,
484
- computerUse: true,
485
- },
486
- 'claude-3-5-sonnet-v2@20241022': {
487
- image: true,
488
- objectGeneration: true,
489
- tools: true,
490
- streaming: true,
491
- computerUse: true,
492
- },
493
- 'claude-3-5-sonnet@20240620': {
494
- image: true,
495
- objectGeneration: true,
496
- tools: true,
497
- streaming: true,
498
- computerUse: false,
499
- },
500
- 'claude-3-5-haiku@20241022': {
501
- image: false,
502
- objectGeneration: true,
503
- tools: true,
504
- streaming: true,
505
- computerUse: false,
506
- },
507
- 'claude-3-sonnet@20240229': {
508
- image: true,
509
- objectGeneration: true,
510
- tools: true,
511
- streaming: true,
512
- computerUse: false,
513
- },
514
- 'claude-3-haiku@20240307': {
515
- image: true,
516
- objectGeneration: true,
517
- tools: true,
518
- streaming: true,
519
- computerUse: false,
520
- },
521
- 'claude-3-opus@20240229': {
522
- image: true,
523
- objectGeneration: true,
524
- tools: true,
525
- streaming: true,
526
- computerUse: false,
527
- },
528
- // Known IDs without declared capabilities retain the custom-model fallback.
529
- 'claude-fable-5': undefined,
530
- 'claude-haiku-5-5': undefined,
531
- 'claude-opus-4-1@20250805': undefined,
532
- 'claude-opus-4-5@20251101': undefined,
533
- 'claude-opus-4-6': undefined,
534
- 'claude-opus-4-7': undefined,
535
- 'claude-opus-4-8': undefined,
536
- 'claude-opus-4@20250514': undefined,
537
- 'claude-opus-5': undefined,
538
- 'claude-opus-5-5': undefined,
539
- 'claude-sonnet-4-5@20250929': undefined,
540
- 'claude-sonnet-4-6': undefined,
541
- 'claude-sonnet-4@20250514': undefined,
542
- 'claude-sonnet-5': undefined,
543
- 'claude-sonnet-5-5': undefined,
544
- };
545
340
  export const googleVertexAnthropicModelCatalog = Object.fromEntries(
546
- Object.entries(vertexAnthropicModels).flatMap(([id, support]) => {
547
- if (support == null) return [];
548
- const entry = {
549
- capabilities: {
550
- language: {
551
- inputs: { image: support.image, audio: false },
552
- objectGeneration: support.objectGeneration,
553
- tools: {
554
- usage: support.tools,
555
- streaming: support.streaming,
556
- computerUse: support.computerUse,
557
- },
558
- reasoning: { support: 'unknown' },
559
- sampling: {
560
- temperature: 'unknown',
561
- topP: 'unknown',
562
- logprobs: false,
341
+ Object.entries<GoogleVertexAnthropicModelRow>(anthropicModelDefinitions)
342
+ .filter(([, row]) => row.documented)
343
+ .map(([id, row]) => {
344
+ const entry = {
345
+ capabilities: {
346
+ language: {
347
+ inputs: { image: row.image, audio: false },
348
+ objectGeneration: row.objectGeneration,
349
+ tools: {
350
+ usage: row.tools,
351
+ streaming: row.toolStreaming,
352
+ computerUse: row.computerUse,
353
+ },
354
+ reasoning: { support: 'unknown' },
355
+ sampling: {
356
+ temperature: 'unknown',
357
+ topP: 'unknown',
358
+ logprobs: false,
359
+ },
563
360
  },
564
361
  },
565
- },
566
- } as const;
567
- return [[id, entry satisfies ModelEntry]];
568
- }),
362
+ } as const;
363
+ return [id, entry satisfies ModelEntry];
364
+ }),
569
365
  );
570
- const vertexXaiModels = {
571
- 'xai/grok-4.20-reasoning': { reasoning: true },
572
- 'xai/grok-4.20-non-reasoning': { reasoning: false },
573
- 'xai/grok-4.1-fast-reasoning': { reasoning: true },
574
- 'xai/grok-4.1-fast-non-reasoning': { reasoning: false },
575
- };
366
+
576
367
  export const googleVertexXaiModelCatalog = Object.fromEntries(
577
- Object.entries(vertexXaiModels).map(([id, support]) => {
578
- const entry = {
579
- capabilities: {
580
- language: {
581
- inputs: { image: 'unknown', audio: 'unknown' },
582
- objectGeneration: 'unknown',
583
- tools: { usage: 'unknown', streaming: 'unknown' },
584
- reasoning: { support: support.reasoning },
585
- sampling: {
586
- temperature: 'unknown',
587
- topP: 'unknown',
588
- logprobs: 'unknown',
368
+ Object.entries<GoogleVertexXaiModelRow>(xaiModelDefinitions).map(
369
+ ([id, row]) => {
370
+ const entry = {
371
+ capabilities: {
372
+ language: {
373
+ inputs: { image: 'unknown', audio: 'unknown' },
374
+ objectGeneration: 'unknown',
375
+ tools: { usage: 'unknown', streaming: 'unknown' },
376
+ reasoning: { support: row.reasoning },
377
+ sampling: {
378
+ temperature: 'unknown',
379
+ topP: 'unknown',
380
+ logprobs: 'unknown',
381
+ },
589
382
  },
590
383
  },
591
- },
592
- } as const;
593
- return [id, entry satisfies ModelEntry];
594
- }),
384
+ } as const;
385
+ return [id, entry satisfies ModelEntry];
386
+ },
387
+ ),
595
388
  );
596
- const vertexMaasModels = {
597
- 'deepseek-ai/deepseek-r1-0528-maas': { publisher: 'DeepSeek' },
598
- 'deepseek-ai/deepseek-v3.1-maas': { publisher: 'DeepSeek' },
599
- 'deepseek-ai/deepseek-v3.2-maas': { publisher: 'DeepSeek' },
600
- 'openai/gpt-oss-120b-maas': { publisher: 'OpenAI' },
601
- 'openai/gpt-oss-20b-maas': { publisher: 'OpenAI' },
602
- 'meta/llama-4-maverick-17b-128e-instruct-maas': { publisher: 'Meta' },
603
- 'meta/llama-4-scout-17b-16e-instruct-maas': { publisher: 'Meta' },
604
- 'minimax/minimax-m2-maas': { publisher: 'MiniMax' },
605
- 'qwen/qwen3-coder-480b-a35b-instruct-maas': { publisher: 'Qwen' },
606
- 'qwen/qwen3-next-80b-a3b-instruct-maas': { publisher: 'Qwen' },
607
- 'qwen/qwen3-next-80b-a3b-thinking-maas': { publisher: 'Qwen' },
608
- 'moonshotai/kimi-k2-thinking-maas': { publisher: 'Moonshot' },
609
- };
389
+
610
390
  export const googleVertexMaasModelCatalog = Object.fromEntries(
611
- Object.entries(vertexMaasModels).map(([id, support]) => {
612
- const entry = {
613
- capabilities: {
614
- language: {
615
- inputs: { image: 'unknown', audio: 'unknown' },
616
- objectGeneration: 'unknown',
617
- tools: { usage: 'unknown', streaming: 'unknown' },
618
- reasoning: { support: 'unknown' },
619
- sampling: {
620
- temperature: 'unknown',
621
- topP: 'unknown',
622
- logprobs: 'unknown',
391
+ Object.entries<GoogleVertexMaasModelRow>(maasModelDefinitions).map(
392
+ ([id, row]) => {
393
+ const entry = {
394
+ capabilities: {
395
+ language: {
396
+ inputs: { image: 'unknown', audio: 'unknown' },
397
+ objectGeneration: 'unknown',
398
+ tools: { usage: 'unknown', streaming: 'unknown' },
399
+ reasoning: { support: 'unknown' },
400
+ sampling: {
401
+ temperature: 'unknown',
402
+ topP: 'unknown',
403
+ logprobs: 'unknown',
404
+ },
405
+ publisher: row.publisher,
623
406
  },
624
- publisher: support.publisher,
625
407
  },
626
- },
627
- requestConfig: requestConfig(id),
628
- } as const;
629
- return [id, entry satisfies ModelEntry<VertexRequestConfig>];
630
- }),
408
+ requestConfig: getGoogleVertexRequestConfig(id),
409
+ } as const;
410
+ return [id, entry satisfies ModelEntry<VertexRequestConfig>];
411
+ },
412
+ ),
631
413
  );
632
414
 
633
- /** Known model IDs, derived from the declarations used to build the catalog. */
634
- export type GoogleVertexModelIds = {
635
- language: (typeof languageModelIds)[number];
636
- image: (typeof imageModelIds)[number];
637
- embedding: (typeof embeddingModelIds)[number];
638
- video: (typeof videoModelIds)[number];
639
- speech: (typeof speechModelIds)[number];
640
- transcription: (typeof transcriptionModelIds)[number];
641
- geminiTranscription: (typeof geminiTranscriptionModelIds)[number];
642
- anthropic: keyof typeof vertexAnthropicModels;
643
- xai: keyof typeof vertexXaiModels;
644
- maas: keyof typeof vertexMaasModels;
645
- };
415
+ export function getGoogleVertexImageModelEntry(modelId: string): VertexEntry {
416
+ return createImageModelEntry(
417
+ findRow<GoogleVertexImageModelRow>(imageModelDefinitions, modelId) ??
418
+ getUnlistedImageModelRow(modelId),
419
+ );
420
+ }
421
+
422
+ export type { GoogleVertexModelIds } from './google-vertex-model-matrix';