Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(ui): hide irrelevant provider settings (#6486)

SivaSubramaniyen0a63f1a334a0
diff --git a/changelog.d/6486.feature.md b/changelog.d/6486.feature.md
new file mode 100644
index 0000000000..d3f2b59ea1
--- /dev/null
+++ b/changelog.d/6486.feature.md
@@ -0,0 +1 @@
+Settings now show only LLM configuration options relevant to the selected provider.
diff --git a/src/local_deep_research/web/static/js/components/settings.js b/src/local_deep_research/web/static/js/components/settings.js
index 89ba19815f..a9cdd29e6f 100644
--- a/src/local_deep_research/web/static/js/components/settings.js
+++ b/src/local_deep_research/web/static/js/components/settings.js
@@ -1525,6 +1525,23 @@
* @returns {Object} - The organized settings
*/
function organizeSettings(settings, tab) {
+ const providerSetting = (
+ settings.find(setting => setting.key === 'llm.provider')
+ || allSettings.find(setting => setting.key === 'llm.provider')
+ );
+
+ const selectedProvider = String(
+ providerSetting?.value || ''
+ ).toLowerCase();
+
+ const providerSettingPrefixes = new Set(
+ Array.isArray(providerSetting?.options)
+ ? providerSetting.options
+ .map(option => String(option?.value || '').toLowerCase())
+ .filter(Boolean)
+ : []
+ );
+
// Create a mapping of types
const typeMap = {
'app': 'Application',
@@ -1626,6 +1643,21 @@
if (!setting.visible) {
return false;
}
+ if (!selectedProvider) {
+ return true;
+ }
+
+ const providerParts = setting.key.split('.');
+ const providerPrefix = providerParts[0];
+ const providerSubKey = providerParts[1];
+
+ if (
+ providerPrefix === 'llm' &&
+ providerSettingPrefixes.has(providerSubKey) &&
+ providerSubKey !== selectedProvider
+ ) {
+ return false;
+ }
// If we're on a specific tab, only show settings for that tab
if (tab !== 'all') {
@@ -3327,6 +3359,16 @@
}
const currentSavingKeys = getCurrentSavingKeys();
+
+ if (currentSavingKeys.includes('llm.provider')) {
+ if (settingsSearch?.value) {
+ handleSearchInput();
+ } else {
+ renderSettingsByTab(activeTab);
+ }
+ setTimeout(initAutoSaveHandlers, 300);
+ }
+
if (savingKeys.length > 0 && currentSavingKeys.length === 0) {
clearOwnedLoadingState();
return;
diff --git a/tests/js/components/settings-dashboard-runtime.test.js b/tests/js/components/settings-dashboard-runtime.test.js
index 20057e87b3..53f1f408b0 100644
--- a/tests/js/components/settings-dashboard-runtime.test.js
+++ b/tests/js/components/settings-dashboard-runtime.test.js
@@ -117,6 +117,42 @@ it('renders aliased policy settings, clears a redacted secret, and recovers from
type: 'LLM',
ui_element: 'select',
value: 'ollama',
+ options: [
+ { value: 'openai', label: 'OpenAI API' },
+ { value: 'anthropic', label: 'Anthropic API' },
+ { value: 'ollama', label: 'Ollama (Local)' },
+ ],
+ }),
+ 'llm.ollama.api_key': setting({
+ category: 'llm_ollama',
+ name: 'Ollama API Key',
+ type: 'LLM',
+ ui_element: 'password',
+ value: '',
+ }),
+
+ 'llm.ollama.url': setting({
+ category: 'llm_ollama',
+ name: 'Ollama URL',
+ type: 'LLM',
+ ui_element: 'text',
+ value: 'http://localhost:11434',
+ }),
+
+ 'llm.openai.api_key': setting({
+ category: 'llm_openai',
+ name: 'OpenAI API Key',
+ type: 'LLM',
+ ui_element: 'password',
+ value: '',
+ }),
+
+ 'llm.anthropic.api_key': setting({
+ category: 'llm_anthropic',
+ name: 'Anthropic API Key',
+ type: 'LLM',
+ ui_element: 'password',
+ value: '',
}),
'llm.model': setting({
category: 'llm_general',
@@ -221,6 +257,26 @@ it('renders aliased policy settings, clears a redacted secret, and recovers from
await flushPromises();
await vi.advanceTimersByTimeAsync(301);
+ expect(
+ document.getElementById('setting-llm-ollama-api_key'),
+ ).not.toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-ollama-url'),
+ ).not.toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-openai-api_key'),
+ ).toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-anthropic-api_key'),
+ ).toBeNull();
+
+ expect(
+ document.getElementById('llm.model'),
+ ).not.toBeNull();
+
expect(fetchMock.mock.calls.map(([url]) => url)).toContain(URLS.SETTINGS_API.BASE);
expect(
document.getElementById('settings-content').innerHTML,
@@ -277,6 +333,27 @@ it('renders aliased policy settings, clears a redacted secret, and recovers from
expect(providerSetup).toBeDefined();
providerSetup[3]('openai');
await flushPromises();
+ await vi.advanceTimersByTimeAsync(150);
+ await flushPromises();
+ expect(
+ document.getElementById('setting-llm-ollama-api_key'),
+ ).toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-ollama-url'),
+ ).toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-openai-api_key'),
+ ).not.toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-anthropic-api_key'),
+ ).toBeNull();
+
+ expect(
+ document.getElementById('llm.model'),
+ ).not.toBeNull();
expect(document.getElementById('llm.provider_hidden').value).toBe('openai');
expect(document.getElementById('llm.model_hidden').value).toBe('gpt-4o');
expect(window.updateDropdownOptions).toHaveBeenCalledWith(
@@ -344,6 +421,22 @@ it('renders aliased policy settings, clears a redacted secret, and recovers from
await vi.advanceTimersByTimeAsync(251);
expect(document.getElementById('setting-notifications-service_url')).not.toBeNull();
+ settingsSearch.value = 'openai';
+ settingsSearch.dispatchEvent(new Event('input', { bubbles: true }));
+ await vi.advanceTimersByTimeAsync(251);
+
+ expect(
+ document.getElementById('setting-llm-openai-api_key'),
+ ).not.toBeNull();
+
+ expect(
+ document.getElementById('setting-llm-ollama-api_key'),
+ ).toBeNull();
+
+ settingsSearch.value = '';
+ settingsSearch.dispatchEvent(new Event('input', { bubbles: true }));
+ await vi.advanceTimersByTimeAsync(251);
+
document.querySelector('[data-tab="search"]').click();
await vi.advanceTimersByTimeAsync(101);
const scope = document.getElementById('setting-policy-egress_scope');