feat: add GCP Vertex AI as LLM provider#35
Draft
thejacket wants to merge 1 commit intoocrbase-hq:mainfrom
Draft
Conversation
Support Vertex AI alongside OpenRouter for all LLM features (extraction, schema generation, JSON repair, health check). Users choose via LLM_PROVIDER env var and can select specific models via LLM_MODEL. Vertex routes Claude models through @ai-sdk/google-vertex/anthropic and Gemini models through @ai-sdk/google-vertex. Also ignore agent skill directories in oxlint config to fix pre-existing lint noise from untracked files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LLM_PROVIDERenv var (openrouter|vertex)LLM_MODELfor both providers@ai-sdk/google-vertex/anthropic, Gemini through@ai-sdk/google-vertexWhy
Self-hosting users on GCP need direct Vertex AI access for:
Compliance — VPC Service Controls, HIPAA, SOC 2 (data never leaves GCP, no third-party proxy sees your documents or extracted data).
Lower latency — direct API call to Vertex AI in your region, no extra hop through OpenRouter's proxy.
Lower cost — no 5% BYOK markup that OpenRouter charges on top of model pricing.
Zero-secret auth — With OpenRouter, you manage and rotate API keys manually, pass them through env vars, and risk them leaking in logs or config. Vertex AI uses Application Default Credentials (ADC), which means:
gcloud auth application-default loginonce and the SDK picks up your credentials.The only config needed is
LLM_PROVIDER=vertexandGOOGLE_VERTEX_PROJECT=your-project. No API keys to generate, store, rotate, or worry about leaking.Demo
Configuration
Test plan
bun check-typespassesLLM_PROVIDER=openrouter(or unset) — existing behavior unchangedLLM_PROVIDER=vertexwith Gemini model — extraction and schema generation workLLM_PROVIDER=vertexwith Claude model — routes through Anthropic Vertex providerllmProvidercolumn populated in job records