feat(settings): honor AI_PROVIDER / OPENAI_MODEL / ANTHROPIC_MODEL / MINIMAX_MODEL env overrides#77
Open
rafaelreis-r wants to merge 1 commit intoviperrcrypto:mainfrom
Open
Conversation
…MINIMAX_MODEL env overrides Self-hosted deployments behind a compatible proxy (llama-swap, LiteLLM, Cloudflare AI Gateway, etc.) often need a model name that isn't in the upstream allow-list, and don't want a misclick in /settings to silently route requests to the wrong provider. Make four env vars win over the DB-stored values: - AI_PROVIDER — anthropic | openai | minimax - ANTHROPIC_MODEL — overrides anthropicModel - OPENAI_MODEL — overrides openaiModel (escapes the model allow-list) - MINIMAX_MODEL — overrides minimaxModel When the env var is set, the cache lookup is skipped, so the override takes effect on every request without needing a process restart. This is a behavior addition — existing users without the env vars set see no change.
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
Self-hosted deployments behind a compatible proxy (llama-swap, LiteLLM, Cloudflare AI Gateway, etc.) often need a model name that isn't in the upstream allow-list, and don't want a misclick in `/settings` to silently route requests to the wrong provider.
This PR makes four env vars win over the DB-stored values:
When the env var is set, the cache lookup is skipped so the override takes effect immediately.
Test plan
🤖 Generated with Claude Code