Problem
The SDK's public evaluator config (BaseEvaluatorConfig, and BatchConfig) only supports modelOverride: { provider: OpenAI | Google | Anthropic, model } — i.e. the three built-in API-key adapters. There's no way to route the evaluators through a custom provider.
Our setup uses Google Vertex AI (service-account auth via @ai-sdk/google-vertex), not the Google AI Studio API key that @ai-sdk/google expects, and we don't use OpenAI. So today we cannot run the evaluators on our existing (Vertex) LLM path — the only option we have a credential for is direct Anthropic, which also pulls in a different @ai-sdk/anthropic major than the rest of our app.
Internally the package already has exactly the right abstraction: ProviderConfig has customProvider?: LLMProvider, and createProvider({ type: 'custom', customProvider }) honors it — but customProvider isn't surfaced on BaseEvaluatorConfig/BatchConfig, and createConfiguredProvider only builds openai/google/anthropic types.
Proposed change
Surface the existing customProvider on the public config:
- Add
customProvider?: LLMProvider to BaseEvaluatorConfig (and BatchConfig).
- In
createConfiguredProvider, if config.customProvider is set, return it (skipping the API-key/modelOverride validation that assumes a built-in provider).
This is fully backward-compatible (opt-in) and lets consumers run every evaluator (including the multi-stage ones) through any AI-SDK model they already have wired — Vertex, Bedrock, a gateway, etc. — with no new keys.
Happy to open a PR if you're open to it. Thanks for the SDK!
Problem
The SDK's public evaluator config (
BaseEvaluatorConfig, andBatchConfig) only supportsmodelOverride: { provider: OpenAI | Google | Anthropic, model }— i.e. the three built-in API-key adapters. There's no way to route the evaluators through a custom provider.Our setup uses Google Vertex AI (service-account auth via
@ai-sdk/google-vertex), not the Google AI Studio API key that@ai-sdk/googleexpects, and we don't use OpenAI. So today we cannot run the evaluators on our existing (Vertex) LLM path — the only option we have a credential for is direct Anthropic, which also pulls in a different@ai-sdk/anthropicmajor than the rest of our app.Internally the package already has exactly the right abstraction:
ProviderConfighascustomProvider?: LLMProvider, andcreateProvider({ type: 'custom', customProvider })honors it — butcustomProviderisn't surfaced onBaseEvaluatorConfig/BatchConfig, andcreateConfiguredProvideronly buildsopenai/google/anthropictypes.Proposed change
Surface the existing
customProvideron the public config:customProvider?: LLMProvidertoBaseEvaluatorConfig(andBatchConfig).createConfiguredProvider, ifconfig.customProvideris set, return it (skipping the API-key/modelOverridevalidation that assumes a built-in provider).This is fully backward-compatible (opt-in) and lets consumers run every evaluator (including the multi-stage ones) through any AI-SDK model they already have wired — Vertex, Bedrock, a gateway, etc. — with no new keys.
Happy to open a PR if you're open to it. Thanks for the SDK!