feat(config): make API base URLs and model names configurable via env#46
Draft
subashrijal5 wants to merge 1 commit into
Draft
feat(config): make API base URLs and model names configurable via env#46subashrijal5 wants to merge 1 commit into
subashrijal5 wants to merge 1 commit into
Conversation
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
Makes the Anthropic and OpenAI API base URLs configurable via environment
variables (with sensible defaults), and reworks model-name resolution so each
provider has its own configurable model name. This unblocks using proxies,
gateways, or self-hosted/OpenAI-compatible endpoints without code changes.
Changes
anthropic_base_urlandopenai_base_urlto
AppConfig, sourced fromANTHROPIC_BASE_URL/OPENAI_BASE_URLanddefaulting to the official endpoints (
https://api.anthropic.com,https://api.openai.com/v1).with a
_default_model_name()resolver driven byAI_PROVIDER, readingGEMINI_MODEL/OPENAI_MODEL/ANTHROPIC_MODEL. Fixes a gap where theclaudeprovider had no model env var and silently fell back to the Geminidefault.
permitted
gpt-4.1-nano, which conflicts with custom/gateway endpoints).OpenAI and Claude now just require a non-empty model name; the Gemini
whitelist is unchanged.
.env.example.Defaults / backwards compatibility
All new variables are optional and fall back to the previous behavior, so
existing Gemini-based setups are unaffected.
Notes
These values are now available on
get_config(), but no Anthropic/OpenAIclient is wired into the generation pipeline yet — the active path remains
Gemini. This PR is the config groundwork for that future wiring.