-
Notifications
You must be signed in to change notification settings - Fork 32
Feature Request: Add Google VertexAI Provider Support #19
Description
Overview
Add support for Google VertexAI models as a new provider in the Hub. This will allow users to route their LLM requests to Google's models like Gemini through our unified API interface.
Background
Currently, Hub supports OpenAI, Anthropic, and Azure OpenAI providers (see src/providers/mod.rs). Adding Google VertexAI support will expand the available model options and give users more flexibility in choosing their LLM providers.
Technical Details
New Provider Implementation
Create a new provider implementation in src/providers/vertexai/ following the existing provider pattern. Reference implementation can be found here
Required Components
-
Create a new module structure:
src/providers/vertexai/mod.rssrc/providers/vertexai/provider.rssrc/providers/vertexai/models.rs
-
Implement the Provider trait with the following methods (support streaming, non-streaming, tools, functions, multi modality etc...)
chat_completionscompletionsembeddings
-
Add necessary request/response models for VertexAI API in
models.rs -
Update the provider registry to include VertexAI
Configuration
- Add a new provider section:
providers:
key: vertexai
type: vertexai
project_id: "<your-gcp-project-id>"
location: "<your-gcp-region>"
credentials_path: "/path/to/service-account.json" # Optional- Update the configuration example to include VertexAI settings.
Requirements
- Implement authentication using Google Cloud credentials
- Support both API key and service account authentication methods
- Handle proper error mapping from Google API responses to our status codes
- Implement proper request/response mapping for all endpoints
- Add comprehensive tests for the new provider
- Update documentation to include VertexAI setup instructions
Resources
Definition of Done
- Implementation of VertexAI provider
- Unit tests with good coverage
- Integration tests with actual API calls (using test credentials)
- Documentation updates
- Example configuration
- Successful chat completion, completion, and embedding requests
- Error handling and proper status code mapping
- PR review and approval
Additional Notes
- Feel free to ask questions in the issue comments
- We recommend creating a draft PR early to get feedback during implementation
- Make sure to follow the existing code style and patterns
- Don't commit any actual API keys or credentials