Skip to content

Commit

Permalink
feat(js): add llama-3.2 support to model garden plugin (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjeff5 authored Sep 26, 2024
1 parent 49c0352 commit 4510fff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions js/plugins/vertexai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import {
SUPPORTED_OPENAI_FORMAT_MODELS,
llama3,
llama31,
llama32,
modelGardenOpenaiCompatibleModel,
} from './model_garden.js';
import {
Expand Down Expand Up @@ -104,6 +105,7 @@ export {
imagen3Fast,
llama3,
llama31,
llama32,
textEmbedding004,
textEmbeddingGecko,
textEmbeddingGecko001,
Expand Down
19 changes: 18 additions & 1 deletion js/plugins/vertexai/src/model_garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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(
Expand All @@ -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<typeof ModelGardenModelConfigSchema>
): Promise<OpenAI> => {
Expand Down

0 comments on commit 4510fff

Please sign in to comment.