~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
Fix behavior with environment variables on small settings menu. (#496)
Daniel Petti16c70edb48c9
diff --git a/.github/workflows/auto-merge-sync.yml b/.github/workflows/auto-merge-sync.ymlindex 3b990f3c6d..8c6feaee2c 100644--- a/.github/workflows/auto-merge-sync.yml+++ b/.github/workflows/auto-merge-sync.yml@@ -21,7 +21,7 @@ jobs:with:script: |const prNumber = context.payload.pull_request.number;-+await github.rest.pulls.createReview({owner: context.repo.owner,repo: context.repo.repo,diff --git a/src/local_deep_research/__version__.py b/src/local_deep_research/__version__.pyindex a779a44262..1cc82e6b87 100644--- a/src/local_deep_research/__version__.py+++ b/src/local_deep_research/__version__.py@@ -1 +1 @@-__version__ = "0.5.6"+__version__ = "0.5.7"diff --git a/src/local_deep_research/web/static/js/components/research.js b/src/local_deep_research/web/static/js/components/research.jsindex 93e3ed2b9a..a164fd0ae7 100644--- a/src/local_deep_research/web/static/js/components/research.js+++ b/src/local_deep_research/web/static/js/components/research.js@@ -975,6 +975,12 @@* @param {string} lastSelectedModel - The last selected model from localStorage or database*/function selectModelBasedOnProvider(resetSelectedModel, lastSelectedModel) {+ if (modelInput && modelInput.disabled) {+ // Don't change the model automatically if we've disabled model+ // selection. Then the user won't be able to change it back.+ return;+ }+if (resetSelectedModel) {if (modelInput) {// Try to select last used model first if it's available@@ -1178,10 +1184,10 @@// Load settings from the databasefunction loadSettings() {console.log('Loading settings from database...');- let numApiCallsPending = 2;+ let numApiCallsPending = 1;// Fetch the current settings from the settings API- fetch('/research/settings/api/llm', {+ fetch('/research/settings/api', {method: 'GET',headers: {'Content-Type': 'application/json'@@ -1199,13 +1205,13 @@// If we have a settings object in the responseif (data && data.settings) {// Find the provider and model settings- const providerSetting = data.settings.value["provider"];- const modelSetting = data.settings.value["model"];- const customEndpointUrl = data.settings.value["openai_endpoint.url"];+ const providerSetting = data.settings["llm.provider"];+ const modelSetting = data.settings["llm.model"];+ const customEndpointUrlSetting = data.settings["llm.openai_endpoint.url"];// Update provider dropdown if we have a valid providerif (providerSetting && modelProviderSelect) {- const providerValue = providerSetting.toUpperCase();+ const providerValue = providerSetting.value.toUpperCase();console.log('Setting provider to:', providerValue);// Find the matching option in the dropdown@@ -1234,6 +1240,7 @@console.warn(`No matching provider option found for '${providerValue}'`);}}+ modelProviderSelect.disabled = !providerSetting.editable;// Display endpoint container if using custom endpointif (endpointContainer) {@@ -1243,9 +1250,11 @@}// Update the custom endpoint URl if we have one.- if (customEndpointUrl && customEndpointInput) {- console.log('Setting endpoint URL to:', customEndpointUrl);- customEndpointInput.value = customEndpointUrl;+ if (customEndpointUrlSetting && customEndpointInput) {+ const customEndpointUrlValue = customEndpointUrlSetting.value;+ console.log('Current endpoint URL:', customEndpointUrlValue);+ customEndpointInput.value = customEndpointUrlValue;+ customEndpointInput.disabled = !customEndpointUrlSetting.editable;}// Load model options based on the current provider@@ -1253,7 +1262,7 @@updateModelOptionsForProvider(currentProvider, false).then(() => {// Update model selection if we have a valid modelif (modelSetting && modelInput) {- const modelValue = modelSetting;+ const modelValue = modelSetting.value;console.log('Setting model to:', modelValue);// Save to localStorage@@ -1288,9 +1297,52 @@hiddenInput.value = modelValue;}}+ modelInput.disabled = !modelSetting.editable;}});+ // Update search engine if we have a valid value+ const searchEngineSetting = data.settings["search.tool"];+ if (searchEngineSetting && searchEngineSetting.value && searchEngineInput) {+ const engineValue = searchEngineSetting.value;+ console.log('Setting search engine to:', engineValue);++ // Save to localStorage+ localStorage.setItem('lastUsedSearchEngine', engineValue);++ // Find the engine in our loaded options+ const matchingEngine = searchEngineOptions.find(e =>+ e.value === engineValue || e.id === engineValue+ );++ if (matchingEngine) {+ console.log('Found matching search engine in options:', matchingEngine);++ // Set the input field value+ searchEngineInput.value = matchingEngine.label || engineValue;+ selectedSearchEngineValue = engineValue;++ // Also update hidden input if it exists+ const hiddenInput = document.getElementById('search_engine_hidden');+ if (hiddenInput) {+ hiddenInput.value = engineValue;+ }+ } else {+ // If no matching engine found, just set the raw value+ console.warn(`No matching search engine found for '${engineValue}'`);+ searchEngineInput.value = engineValue;+ selectedSearchEngineValue = engineValue;++ // Also update hidden input if it exists+ const hiddenInput = document.getElementById('search_engine_hidden');+ if (hiddenInput) {+ hiddenInput.value = engineValue;+ }+ }++ searchEngineInput.disabled = !searchEngineSetting.editable;+ }+}@@ -1309,83 +1361,6 @@numApiCallsPending--;isInitializing = (numApiCallsPending === 0);});-- fetch('/research/settings/api/search.tool', {- method: 'GET',- headers: {- 'Content-Type': 'application/json'- }- })- .then(response => {- if (!response.ok) {- throw new Error(`API error: ${response.status}`);- }- return response.json();- })- .then(data => {- console.log('Loaded settings from database:', data);-- // If we have a settings object in the response- if (data && data.settings) {- // Find the provider and model settings- const searchEngineSetting = data.settings;-- // Update search engine if we have a valid value- if (searchEngineSetting && searchEngineSetting.value && searchEngineInput) {- const engineValue = searchEngineSetting.value;- console.log('Setting search engine to:', engineValue);-- // Save to localStorage- localStorage.setItem('lastUsedSearchEngine', engineValue);-- // Find the engine in our loaded options- const matchingEngine = searchEngineOptions.find(e =>- e.value === engineValue || e.id === engineValue- );-- if (matchingEngine) {- console.log('Found matching search engine in options:', matchingEngine);-- // Set the input field value- searchEngineInput.value = matchingEngine.label || engineValue;- selectedSearchEngineValue = engineValue;-- // Also update hidden input if it exists- const hiddenInput = document.getElementById('search_engine_hidden');- if (hiddenInput) {- hiddenInput.value = engineValue;- }- } else {- // If no matching engine found, just set the raw value- console.warn(`No matching search engine found for '${engineValue}'`);- searchEngineInput.value = engineValue;- selectedSearchEngineValue = engineValue;-- // Also update hidden input if it exists- const hiddenInput = document.getElementById('search_engine_hidden');- if (hiddenInput) {- hiddenInput.value = engineValue;- }- }- }- }-- // If all the calls to the settings API are finished, we're no- // longer initializing.- numApiCallsPending--;- isInitializing = (numApiCallsPending === 0);-- })- .catch(error => {- console.error('Error loading settings:', error);-- // Fallback to localStorage if database fetch fails- fallbackToLocalStorageSettings();-- // Even if there's an error, we're done initializing- numApiCallsPending--;- isInitializing = (numApiCallsPending === 0);- });}// Add a fallback function to use localStorage settingsdiff --git a/src/local_deep_research/web/static/js/components/settings.js b/src/local_deep_research/web/static/js/components/settings.jsindex 45a58fda7f..e0645e134b 100644--- a/src/local_deep_research/web/static/js/components/settings.js+++ b/src/local_deep_research/web/static/js/components/settings.js@@ -2875,7 +2875,7 @@console.log(`Models loaded, available options: ${modelOptions.length}`);// Get current settings from hidden inputs- const currentProvider = providerHiddenInput.value || 'ollama';+ const currentProvider = providerHiddenInput.value.toUpperCase() || 'OLLAMA'const currentModel = modelHiddenInput.value || 'gemma3:12b';console.log('Current settings:', { provider: currentProvider, model: currentModel });