Add configurable base URL for OpenAI-compatible providers#55
Merged
bstanga merged 1 commit intopresubmit:mainfrom Dec 13, 2025
Merged
Add configurable base URL for OpenAI-compatible providers#55bstanga merged 1 commit intopresubmit:mainfrom
bstanga merged 1 commit intopresubmit:mainfrom
Conversation
- Add LLM_BASE_URL configuration option (env var or action input) - Pass baseURL to AI SDK provider when configured - Skip model whitelist validation when using custom base URL - Add unit tests for LLM_BASE_URL configuration - Update documentation with usage examples
PR SummaryAdded support for configurable base URLs to enable OpenAI-compatible API providers (e.g., OpenRouter, Anyscale, Together AI) via the Changes
autogenerated by presubmit.ai |
Contributor
|
Thanks! |
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
Adds support for using OpenRouter and other OpenAI-compatible API providers by allowing users to configure a custom base URL via the
LLM_BASE_URLenvironment variable.Why: OpenRouter provides rate limiting and cost controls per API key, which is useful for managing expenses across different projects or workflows.
Changes
LLM_BASE_URLconfig option (environment variable or GitHub Action input)baseURLto AI SDK provider when configuredopenai/gpt-4o-mini)Implementation Notes
When a custom
LLM_BASE_URLis provided, the OpenAI SDK is used regardless of the model name. This works for OpenRouter and other OpenAI-compatible providers, but users should be aware of this assumption.Note
This implementation bypasses the model whitelist when using a custom base URL. This workaround may become unnecessary after PR #43 is merged, which refactors the model configuration system.
Tested here: rubenvanerk#1