Custom provider option add #62
Open
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.
Add Support for Custom OpenAI-Compatible Providers
Description
This PR adds the ability to use any OpenAI-compatible API provider with Dexter, including providers like Groq, Together AI, OpenRouter or self deployed models using vLLM or llama.cpp
Previously, Dexter only supported hardcoded providers (OpenAI, Anthropic, Google, xAI, Ollama). Now users can configure custom providers through an interactive CLI flow without modifying code.
Changes
Core Implementation
src/utils/config.ts: AddedCustomProviderConfiginterface and functions to save/load custom provider configurationssrc/model/llm.ts: Addedcustom:prefix handler that loads provider settings from config and creates ChatOpenAI client with custom base URLsrc/utils/env.ts: Added custom provider to provider registrysrc/components/CustomProviderPrompt.tsx: New component - interactive 4-step wizard for configuring custom providerssrc/components/ModelSelector.tsx: Added "Custom (OpenAI-compatible)" option to provider listsrc/hooks/useModelSelection.ts: Addedcustom_provider_configstate andhandleCustomProviderSubmithandlersrc/cli.tsx: Added rendering for custom provider configuration screenUser Experience
/modelcommand.dexter/settings.jsonConfiguration Storage
Custom provider settings are stored locally in
.dexter/settings.json:{ "provider": "custom", "modelId": "custom:mixtral-8x7b-32768", "customProviderConfig": { "name": "Groq", "baseUrl": "https://api.groq.com/openai/v1", "apiKey": "gsk_...", "modelId": "mixtral-8x7b-32768" } }Related Issues
Closes #49