~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
"""Invalid configuration must remain distinguishable from an unavailable API."""
from unittest.mock import patch
import pytest
from local_deep_research.embeddings.providers.implementations.openai import (
OpenAIEmbeddingsProvider,
)
from local_deep_research.llm.providers.implementations.custom_openai_endpoint import (
CustomOpenAIEndpointProvider,
)
from local_deep_research.llm.providers.implementations.openai import (
OpenAIProvider,
)
from local_deep_research.settings.exceptions import SettingsValueError
@pytest.mark.parametrize("invalid_field", ["api_key", "base_url"])
@pytest.mark.parametrize("method", ["is_available", "get_available_models"])
def test_embedding_discovery_reports_invalid_settings(invalid_field, method):
invalid_key = f"embeddings.openai.{invalid_field}"
snapshot = {
"embeddings.openai.api_key": None,
"embeddings.openai.base_url": "http://localhost:9090/v1",
invalid_key: {"value": "not-a-number", "ui_element": "number"},
}
with patch("openai.OpenAI") as client:
with pytest.raises(SettingsValueError) as raised:
getattr(OpenAIEmbeddingsProvider, method)(snapshot)
assert raised.value.key == invalid_key
client.assert_not_called()
@pytest.mark.parametrize(
"provider, invalid_field",
[
(OpenAIProvider, "api_key_setting"),
(CustomOpenAIEndpointProvider, "url_setting"),
],
)
def test_llm_discovery_reports_invalid_settings(provider, invalid_field):
invalid_key = getattr(provider, invalid_field)
snapshot = {
provider.api_key_setting: "test-key",
provider.url_setting: "http://localhost:9090/v1",
invalid_key: {"value": "not-a-number", "ui_element": "number"},
}
with patch.object(provider, "list_models_for_api") as request:
with pytest.raises(SettingsValueError) as raised:
provider.list_models(snapshot)
assert raised.value.key == invalid_key
request.assert_not_called()
def test_unconfigured_embedding_provider_remains_unavailable():
snapshot = {
"embeddings.openai.api_key": None,
"embeddings.openai.base_url": None,
}
with patch("openai.OpenAI") as client:
assert OpenAIEmbeddingsProvider.is_available(snapshot) is False
assert OpenAIEmbeddingsProvider.get_available_models(snapshot) == []
client.assert_not_called()