Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(go): add support for multiple model versions #1575

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hugoaguirre
Copy link
Contributor

@hugoaguirre hugoaguirre commented Dec 26, 2024

Adding the support for multiple model versions and grouping the versions in the model metadata.

Gemini models being rendered in Dev UI frontpage

image

Model versions being grouped in the Dev UI

image

Playing around with gemini-1.5-flash-8b-latest

image

Checking raw request

image

Checklist (if applicable):

@hugoaguirre hugoaguirre changed the title feature(go): create model references with dynamic config feature(go): add support for multiple model versions Jan 4, 2025
@hugoaguirre hugoaguirre requested a review from pavelgj January 4, 2025 04:43
@hugoaguirre hugoaguirre marked this pull request as ready for review January 4, 2025 04:43
@hugoaguirre hugoaguirre requested a review from apascal07 January 4, 2025 04:43
@hugoaguirre
Copy link
Contributor Author

Hi @pavelgj, @apascal07

Let me know your opinion about this approach.
I wanted to keep the model definition as it previously was because I think it was very simple and verbose.

The only changes added were:

  • Rewrote how the known models are defined in the plugins (adding a new struct named: ai.ModelDetails that encapsulates the model capabilities and its versions)
  • ai.ModelMetadata was updated to add model versions so they can be grouped together

Comment on lines +51 to +69
"gemini-1.0-pro": {
Versions: []string{"gemini-pro", "gemini-1.0-pro-latest", "gemini-1.0-pro-001"},
Caps: gemini.BasicText,
},

"gemini-1.5-flash": {
Versions: []string{"gemini-1.5-flash-latest", "gemini-1.5-flash-001", "gemini-1.5-flash-002"},
Caps: gemini.Multimodal,
},

"gemini-1.5-pro": {
Versions: []string{"gemini-1.5-pro-latest", "gemini-1.5-pro-001", "gemini-1.5-pro-002"},
Caps: gemini.Multimodal,
},

"gemini-1.5-flash-8b": {
Versions: []string{"gemini-1.5-flash-8b-latest", "gemini-1.5-flash-8b-001"},
Caps: gemini.Multimodal,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this hardcoded strings of the version management can become a bit complicated to maintain, and since we are using the same ones in googleai and vertexai, I think it would be good to have in some constants file, maybe in the genkit package or another new one, so that it is used here and in vertexai

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation @alonsopec89.

I was looking at how things were implemented in Genkit JS and plugins are in charge of defining the models they use regardless if more plugins are using the same models. e.g. js vertex and js googleai.

About placing these model definitions in genkit package... my understanding is that Genkit should be model-agnostic so I believe that's the reason behind why plugins are defining their models on their packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Go] Add support for model versions (e.g. gemini-1.5-flash-8b for gemini-1.5-flash, etc)
2 participants