-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add custom model support for Vertex AI provider #5753
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
Conversation
- Add custom model input field to Vertex provider settings UI - Update provider settings schema to include vertexCustomModelId field - Modify useSelectedModel hook to prioritize custom models for Vertex - Update AnthropicVertexHandler to handle custom model names with thinking suffix support - Add comprehensive tests for custom model functionality - Add i18n translations for custom model UI elements Fixes #5751: Users can now input custom Vertex AI model IDs in the correct @ format (e.g., claude-sonnet-4@20250514) to avoid 404 errors
| // For custom models, use default model info as fallback | ||
| const defaultInfo = vertexModels[vertexDefaultModelId] | ||
| return { | ||
| id: customModelId.trim(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom model handling here simply trims and returns the custom ID using fallback info, but it doesn’t strip a ':thinking' suffix as done in AnthropicVertexHandler.getModel. For consistency in UI display (and to avoid potential confusion), consider mirroring that logic.
| id: customModelId.trim(), | |
| id: customModelId.trim().replace(/:thinking$/, ""), |
| <VSCodeTextField | ||
| value={apiConfiguration?.vertexCustomModelId || ""} | ||
| onInput={handleInputChange("vertexCustomModelId")} | ||
| placeholder="claude-sonnet-4@20250514" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new custom model text field looks well-integrated with proper translation keys and placeholder text. If possible, consider externalizing the placeholder example ('claude-sonnet-4@20250514') into a translation key for consistency with internationalization practices.
| placeholder="claude-sonnet-4@20250514" | |
| placeholder={t("settings:placeholders.customModelExample")} |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
Fixes #5751
Summary
This PR adds support for custom model input in the Vertex AI provider settings, allowing users to specify custom model IDs in the correct Vertex format (e.g.,
claude-sonnet-4@20250514) to avoid 404 errors.Changes Made
UI Changes
Backend Changes
vertexSchemato include optionalvertexCustomModelIdfielduseSelectedModelhook to prioritize custom models when providedTesting
Technical Details
Model Format Handling
@separator (e.g.,claude-sonnet-4@20250514):thinkingsuffixValidation
Testing Results
User Experience
Users can now:
claude-sonnet-4@20250514)This resolves the core issue where users were getting 404 errors due to model name format mismatches between the UI suggestions and Vertex AI requirements.
Important
Adds custom model support for Vertex AI provider, allowing users to specify custom model IDs, with updates to UI, backend logic, and comprehensive testing.
claude-sonnet-4@20250514.useSelectedModelhook to prioritize custom models.AnthropicVertexHandlerto handle custom model names with thinking suffix.vertexSchemainprovider-settings.tsto includevertexCustomModelId.getSelectedModelinuseSelectedModel.tsto handle custom models.Vertex.tsxwith placeholder and description.settings.json.AnthropicVertexHandlercustom model functionality inanthropic-vertex.spec.ts.useSelectedModelhook inuseSelectedModel.spec.tsx.This description was created by
for 56c872d. You can customize this summary. It will automatically update as commits are pushed.