Skip to content

feat: add Google Vertex AI provider support#29

Merged
akshaydeo merged 1 commit intomainfrom
05-06-feat_vertex_ai_provider_added
May 12, 2025
Merged

feat: add Google Vertex AI provider support#29
akshaydeo merged 1 commit intomainfrom
05-06-feat_vertex_ai_provider_added

Conversation

@Pratham-Mishra04
Copy link
Copy Markdown
Collaborator

Add Google Vertex AI Provider Support

This PR adds support for Google Vertex AI as a new provider in Bifrost, allowing users to access Google's AI models like Gemini and third-party models hosted on Vertex AI.

Key changes:

  • Implemented a new VertexProvider that supports chat completion with Google's models
  • Added authentication via Google Cloud credentials
  • Created region-specific model routing for Vertex AI endpoints
  • Refactored provider code to extract common request preparation logic
  • Added support for both OpenAI-style and Anthropic-style models on Vertex
  • Enhanced error handling and debugging for all providers

The implementation uses Google's OAuth2 authentication and doesn't require API keys like other providers, instead using service account credentials. The PR also updates the gitignore to exclude credential files for security.

Copy link
Copy Markdown
Collaborator Author

Pratham-Mishra04 commented May 6, 2025

Comment thread core/tests/account.go Outdated
Comment thread core/schemas/provider.go
@@ -36,7 +36,7 @@ type MetaConfig interface {
// GetSecretAccessKey returns the secret access key for authentication
GetSecretAccessKey() *string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you think now converting API key should be an interface{}/Generic based struct and it returns based on which provider its calling? cc @danpiths

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we don't have to keep on adding new methods to this interface and bloat it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i'm sorry i didn't get the should be an interface{}/Generic based struct

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The problem here is - every extra field we add to the config, we have to add a new method like GetSecretAccessKey, GetServiceAccountAccessKey.

Better we keep overall MetaConfig as map[string]interface{} and parse it to specific type in corresponding providers

@akshaydeo akshaydeo marked this pull request as ready for review May 7, 2025 12:05
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 05-06-feat_vertex_ai_provider_added branch from 3693c51 to 59cc5d1 Compare May 9, 2025 12:51
@Pratham-Mishra04 Pratham-Mishra04 requested a review from akshaydeo May 9, 2025 12:52
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 05-06-feat_vertex_ai_provider_added branch from 59cc5d1 to 2dc0a0d Compare May 12, 2025 08:45
Copy link
Copy Markdown
Contributor

akshaydeo commented May 12, 2025

Merge activity

  • May 12, 3:38 PM GMT+5:30: A user started a stack merge that includes this pull request via Graphite.
  • May 12, 3:39 PM GMT+5:30: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo merged commit 4ecb21a into main May 12, 2025
1 check passed
@Pratham-Mishra04 Pratham-Mishra04 deleted the 05-06-feat_vertex_ai_provider_added branch May 13, 2025 20:07
akshaydeo added a commit that referenced this pull request Nov 17, 2025
# Add Google Vertex AI Provider Support

This PR adds support for Google Vertex AI as a new provider in Bifrost, allowing users to access Google's AI models like Gemini and third-party models hosted on Vertex AI.

Key changes:
- Implemented a new `VertexProvider` that supports chat completion with Google's models
- Added authentication via Google Cloud credentials
- Created region-specific model routing for Vertex AI endpoints
- Refactored provider code to extract common request preparation logic
- Added support for both OpenAI-style and Anthropic-style models on Vertex
- Enhanced error handling and debugging for all providers

The implementation uses Google's OAuth2 authentication and doesn't require API keys like other providers, instead using service account credentials. The PR also updates the gitignore to exclude credential files for security.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants