Add Vertex AI routing support (#753)

* add Vertex AI routing support

* include Vertex smokes in action CI
This commit is contained in:
Colin McDonnell
2026-05-20 16:49:08 +00:00
committed by pullfrog[bot]
parent 09344a9ec9
commit c43ed65c3b
15 changed files with 532 additions and 47 deletions
+15
View File
@@ -3,6 +3,7 @@ import {
getModelEnvVars,
getModelProvider,
isBedrockAnthropicId,
isVertexAnthropicId,
modelAliases,
parseModel,
providers,
@@ -258,6 +259,20 @@ describe("isBedrockAnthropicId", () => {
});
});
describe("isVertexAnthropicId", () => {
it("matches Claude Vertex IDs by anchored prefix", () => {
expect(isVertexAnthropicId("claude-opus-4-1@20250805")).toBe(true);
});
it("rejects Gemini IDs", () => {
expect(isVertexAnthropicId("gemini-2.5-pro")).toBe(false);
});
it("ignores Anthropic substrings outside the prefix", () => {
expect(isVertexAnthropicId("publishers/anthropic/models/claude-opus-4-1")).toBe(false);
});
});
describe("providers registry", () => {
it("every provider has envVars", () => {
for (const [key, config] of Object.entries(providers)) {