From 4510ffff9d7ce10557ae18642982456ed981f10c Mon Sep 17 00:00:00 2001 From: huangjeff5 <64040981+huangjeff5@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:09:39 -0500 Subject: [PATCH] feat(js): add llama-3.2 support to model garden plugin (#969) --- js/plugins/vertexai/src/index.ts | 2 ++ js/plugins/vertexai/src/model_garden.ts | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/js/plugins/vertexai/src/index.ts b/js/plugins/vertexai/src/index.ts index 81cb22eb7..a0b599026 100644 --- a/js/plugins/vertexai/src/index.ts +++ b/js/plugins/vertexai/src/index.ts @@ -66,6 +66,7 @@ import { SUPPORTED_OPENAI_FORMAT_MODELS, llama3, llama31, + llama32, modelGardenOpenaiCompatibleModel, } from './model_garden.js'; import { @@ -104,6 +105,7 @@ export { imagen3Fast, llama3, llama31, + llama32, textEmbedding004, textEmbeddingGecko, textEmbeddingGecko001, diff --git a/js/plugins/vertexai/src/model_garden.ts b/js/plugins/vertexai/src/model_garden.ts index 96b569426..3d493fb79 100644 --- a/js/plugins/vertexai/src/model_garden.ts +++ b/js/plugins/vertexai/src/model_garden.ts @@ -29,6 +29,23 @@ export const ModelGardenModelConfigSchema = OpenAIConfigSchema.extend({ location: z.string().optional(), }); +export const llama32 = modelRef({ + name: 'vertexai/llama-3.2', + info: { + label: 'Llama 3.2', + supports: { + multiturn: true, + tools: true, + media: true, + systemRole: true, + output: ['text', 'json'], + }, + versions: ['meta/llama-3.2-90b-vision-instruct-maas'], + }, + configSchema: ModelGardenModelConfigSchema, + version: 'meta/llama-3.2-90b-vision-instruct-maas', +}); + export const llama31 = modelRef({ name: 'vertexai/llama-3.1', info: { @@ -72,6 +89,7 @@ export const llama3 = modelRef({ export const SUPPORTED_OPENAI_FORMAT_MODELS = { 'llama3-405b': llama3, 'llama-3.1': llama31, + 'llama-3.2': llama32, }; export function modelGardenOpenaiCompatibleModel( @@ -87,7 +105,6 @@ export function modelGardenOpenaiCompatibleModel( baseUrlTemplate = 'https://{location}-aiplatform.googleapis.com/v1beta1/projects/{projectId}/locations/{location}/endpoints/openapi'; } - const clientFactory = async ( request: GenerateRequest ): Promise => {