~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: Remove settings_snapshot from list_models_for_api (restore Dec 16 fix) (#1591)
LearningCircuit919603a5868f
diff --git a/.github/workflows/library-tests.yml b/.github/workflows/library-tests.ymlindex 672af378b8..3253af4c9d 100644--- a/.github/workflows/library-tests.yml+++ b/.github/workflows/library-tests.yml@@ -3,30 +3,8 @@ name: Library & Collections Testson:push:branches: [ main, dev ]- paths:- - 'src/local_deep_research/research_library/**'- - 'src/local_deep_research/database/models/library.py'- - 'tests/research_library/**'- - 'tests/api_tests/test_collections_api.py'- - 'tests/api_tests/conftest_library.py'- - 'tests/security/**'- - 'tests/llm_providers/**'- - 'tests/embeddings/**'- - 'tests/search_engines/**'- - '.github/workflows/library-tests.yml'pull_request:branches: [ main, dev ]- paths:- - 'src/local_deep_research/research_library/**'- - 'src/local_deep_research/database/models/library.py'- - 'tests/research_library/**'- - 'tests/api_tests/test_collections_api.py'- - 'tests/api_tests/conftest_library.py'- - 'tests/security/**'- - 'tests/llm_providers/**'- - 'tests/embeddings/**'- - 'tests/search_engines/**'- - '.github/workflows/library-tests.yml'workflow_dispatch:permissions:diff --git a/src/local_deep_research/llm/providers/implementations/google.py b/src/local_deep_research/llm/providers/implementations/google.pyindex d6296e63ea..24d472fd7a 100644--- a/src/local_deep_research/llm/providers/implementations/google.py+++ b/src/local_deep_research/llm/providers/implementations/google.py@@ -37,15 +37,12 @@ class GoogleProvider(OpenAICompatibleProvider):return True@classmethod- def list_models_for_api(- cls, api_key=None, base_url=None, settings_snapshot=None- ):+ def list_models_for_api(cls, api_key=None, base_url=None):"""List available models using Google's native API.Args:api_key: Google API keybase_url: Not used - Google uses a fixed endpoint- settings_snapshot: Not usedGoogle's OpenAI-compatible /models endpoint returns 401 (bug),so we use the native Gemini API endpoint instead.diff --git a/src/local_deep_research/llm/providers/implementations/ollama.py b/src/local_deep_research/llm/providers/implementations/ollama.pyindex 3f339dfd14..afd106ace1 100644--- a/src/local_deep_research/llm/providers/implementations/ollama.py+++ b/src/local_deep_research/llm/providers/implementations/ollama.py@@ -71,29 +71,18 @@ class OllamaProvider:return headers@classmethod- def list_models_for_api(- cls, api_key=None, base_url=None, settings_snapshot=None- ):+ def list_models_for_api(cls, api_key=None, base_url=None):"""Get available models from Ollama.Args:api_key: Optional API key for authentication- base_url: Optional base URL for Ollama API- settings_snapshot: Optional settings snapshot for configuration+ base_url: Base URL for Ollama API (required)Returns:List of model dictionaries with 'value' and 'label' keys"""from ....utilities.llm_utils import fetch_ollama_models- # Use provided base_url, or get from settings_snapshot- if not base_url and settings_snapshot:- base_url = get_setting_from_snapshot(- "llm.ollama.url",- default=None,- settings_snapshot=settings_snapshot,- )-if not base_url:logger.warning("Ollama URL not configured")return []diff --git a/src/local_deep_research/llm/providers/openai_base.py b/src/local_deep_research/llm/providers/openai_base.pyindex b2e1aa7a09..d16c5375f2 100644--- a/src/local_deep_research/llm/providers/openai_base.py+++ b/src/local_deep_research/llm/providers/openai_base.py@@ -247,9 +247,7 @@ class OpenAICompatibleProvider:return cls.default_base_url@classmethod- def list_models_for_api(- cls, api_key=None, base_url=None, settings_snapshot=None- ):+ def list_models_for_api(cls, api_key=None, base_url=None):"""List available models for API endpoint use.This method is designed to be called from Flask routes.@@ -257,7 +255,6 @@ class OpenAICompatibleProvider:Args:api_key: Optional API key (if None and required, returns empty list)base_url: Optional base URL to use (if None, uses cls.default_base_url)- settings_snapshot: Optional settings snapshot for subclasses that need itReturns:List of model dictionaries with 'value' and 'label' keys@@ -333,7 +330,7 @@ class OpenAICompatibleProvider:# Get base URL from settings if provider has configurable URLbase_url = cls._get_base_url_for_models(settings_snapshot)- return cls.list_models_for_api(api_key, base_url, settings_snapshot)+ return cls.list_models_for_api(api_key, base_url)except Exception as e:logger.exception(diff --git a/tests/llm_providers/test_ollama_provider.py b/tests/llm_providers/test_ollama_provider.pyindex a0e01a9a4a..2d9433bebc 100644--- a/tests/llm_providers/test_ollama_provider.py+++ b/tests/llm_providers/test_ollama_provider.py@@ -149,49 +149,44 @@ class TestOllamaListModels:def test_list_models_returns_list(self, mock_ollama_response):"""Returns list of models."""with patch(- "src.local_deep_research.llm.providers.implementations.ollama.get_setting_from_snapshot",- return_value="http://localhost:11434",- ):- with patch(- "src.local_deep_research.utilities.llm_utils.fetch_ollama_models"- ) as mock_fetch:- mock_fetch.return_value = [- {"value": "llama2:latest", "label": "llama2 (Ollama)"},- {"value": "gemma:latest", "label": "gemma (Ollama)"},- ]-- result = OllamaProvider.list_models_for_api()-- assert isinstance(result, list)- assert len(result) == 2+ "src.local_deep_research.utilities.llm_utils.fetch_ollama_models"+ ) as mock_fetch:+ mock_fetch.return_value = [+ {"value": "llama2:latest", "label": "llama2 (Ollama)"},+ {"value": "gemma:latest", "label": "gemma (Ollama)"},+ ]++ # Pass base_url directly - this is the correct API usage+ result = OllamaProvider.list_models_for_api(+ base_url="http://localhost:11434"+ )++ assert isinstance(result, list)+ assert len(result) == 2def test_list_models_empty_without_url(self):- """Returns empty list when URL not configured."""- with patch(- "src.local_deep_research.llm.providers.implementations.ollama.get_setting_from_snapshot",- return_value=None,- ):- result = OllamaProvider.list_models_for_api()- assert result == []+ """Returns empty list when URL not provided."""+ # No base_url passed - should return empty list+ result = OllamaProvider.list_models_for_api()+ assert result == []def test_list_models_includes_provider_info(self, mock_ollama_response):"""Model entries include provider information."""with patch(- "src.local_deep_research.llm.providers.implementations.ollama.get_setting_from_snapshot",- return_value="http://localhost:11434",- ):- with patch(- "src.local_deep_research.utilities.llm_utils.fetch_ollama_models"- ) as mock_fetch:- mock_fetch.return_value = [- {"value": "llama2:latest", "label": "llama2"},- ]-- result = OllamaProvider.list_models_for_api()-- assert len(result) > 0- assert "provider" in result[0]- assert result[0]["provider"] == "OLLAMA"+ "src.local_deep_research.utilities.llm_utils.fetch_ollama_models"+ ) as mock_fetch:+ mock_fetch.return_value = [+ {"value": "llama2:latest", "label": "llama2"},+ ]++ # Pass base_url directly - this is the correct API usage+ result = OllamaProvider.list_models_for_api(+ base_url="http://localhost:11434"+ )++ assert len(result) > 0+ assert "provider" in result[0]+ assert result[0]["provider"] == "OLLAMA"class TestOllamaCreateLLM: