~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
"""Pin the Python↔JavaScript constants that must stay in sync.
A few limits are enforced on BOTH sides of the wire (server validation +
a client-side pre-check/truncation) but can't share a value across the
language boundary, so they're duplicated literals linked only by comments
that rot. These tests parse the JS literal and assert it equals the
Python constant, so editing one side without the other fails CI instead
of surfacing later as a confusing 400.
"""
import re
from pathlib import Path
import local_deep_research
from local_deep_research.web.routers import (
notes as notes_routes,
unified_search as unified_search_routes,
)
_STATIC = Path(local_deep_research.__file__).parent / "web" / "static" / "js"
def _read(rel):
return (_STATIC / rel).read_text(encoding="utf-8")
def test_min_query_length_matches_client():
"""unified_search MIN_SEARCH_LEN (server 400 below it) must equal the
shared client MIN_QUERY_LENGTH (the notes/unified pages gate on it)."""
js = _read("components/semantic_search.js")
m = re.search(r"MIN_QUERY_LENGTH:\s*(\d+)", js)
assert m, "MIN_QUERY_LENGTH literal not found in semantic_search.js"
assert int(m.group(1)) == unified_search_routes.MIN_SEARCH_LEN
def test_annotation_quote_cap_matches_client():
"""The annotation surface truncates the quote client-side to the same
cap the server enforces (MAX_ANNOTATION_QUOTE_LEN); a client
over-truncating a raised server cap loses text, an under-truncating one
hits a confusing 'quote exceeds maximum length' 400."""
js = _read("components/annotation_surface.js")
# `if (quote.length > 1000) quote = quote.slice(0, 1000);`
m = re.search(
r"quote\.length\s*>\s*(\d+)\s*\)\s*quote\s*=\s*quote\.slice\(0,\s*(\d+)\)",
js,
)
assert m, "annotation quote-length cap not found in annotation_surface.js"
assert int(m.group(1)) == int(m.group(2)), "client cap literals disagree"
assert int(m.group(1)) == notes_routes.MAX_ANNOTATION_QUOTE_LEN