feat(llm): support multiple provider instances per type - #180
Open
TriplEight wants to merge 1 commit into
Open
Conversation
TriplEight
force-pushed
the
feat/llm-provider-instances
branch
2 times, most recently
from
August 13, 2026 12:57
310743a to
839af32
Compare
Replace single-instance per-provider settings with a unified llm_provider_instances JSON blob (array order = fallback order). Users can add/remove/reorder provider cards for all four kinds (OpenAI, Google, Mistral, OpenAI-compatible). - lib/llm-providers.ts: instance helpers, blob parse/serialize, legacy migration, resolveInstances, hasConfiguredProvider - models/settings.ts: getLLMSettings reads blob -> LLMConfig[] - forms/settings.ts: single llm_provider_instances field - llm-settings-form.tsx: instance-array state, DnD reorder, add/remove controls, per-card Test - welcome-widget + unsorted page: use hasConfiguredProvider - self-hosted setup: stop pre-filling API keys from env (security) - self-hosted setup: add model name field for openai_compatible
TriplEight
force-pushed
the
feat/llm-provider-instances
branch
from
August 13, 2026 13:45
839af32 to
cfe75fc
Compare
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.
Allows users to add, remove, and reorder multiple LLM provider cards for each of the four provider types (OpenAI, Google, Mistral, OpenAI-compatible). Previously each type supported only a single instance.
How it works
Provider configuration is stored as a single
llm_provider_instancesJSON blob (one Setting row). The array order is the fallback priority order consumed by the existingrequestLLMloop — no changes toai/providers/llmProvider.ts.Each instance:
{id, kind, apiKey, model, baseUrl, maxConcurrency}.kindasprovider.Scope
Self-hosted only. The cloud path in
getLLMSettingsand theisSelfHostedgate are unchanged. No Prisma migration (reuses the Setting table). No changes toai/providers/llmProvider.ts.