~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
Add new method for managing Docker compose configuration.
Daniel Petti83d314f7a369
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 00a5f8ed6d..694295263e 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -3,6 +3,7 @@ repos:rev: v5.0.0hooks:- id: check-yaml+ exclude: cookiecutter-docker/.*- id: end-of-file-fixer- id: trailing-whitespace- repo: https://github.com/psf/blackdiff --git a/cookiecutter-docker/cookiecutter.json b/cookiecutter-docker/cookiecutter.jsonnew file mode 100644index 0000000000..5002c51fe6--- /dev/null+++ b/cookiecutter-docker/cookiecutter.json@@ -0,0 +1,8 @@+{+ "config_name": "default",+ "host_port": 5000,+ "host_ip": "0.0.0.0",+ "host_network": false,+ "enable_ollama": true,+ "enable_searxng": true+}diff --git a/cookiecutter-docker/hooks/post_gen_project.py b/cookiecutter-docker/hooks/post_gen_project.pynew file mode 100644index 0000000000..1ae53867d4--- /dev/null+++ b/cookiecutter-docker/hooks/post_gen_project.py@@ -0,0 +1,22 @@+"""+Extracts the compose file from the cookiecutter directory.+"""++import shutil+from pathlib import Path++COMPOSE_FILE_NAME = "docker-compose.{{cookiecutter.config_name}}.yml"+++def main():+ # Move the compose file one directory up.+ compose_path = Path(COMPOSE_FILE_NAME)+ output_dir = compose_path.parent.absolute()+ compose_path.rename(output_dir.parent / COMPOSE_FILE_NAME)++ # Delete the directory.+ shutil.rmtree(output_dir)+++if __name__ == "__main__":+ main()diff --git a/docker-compose.yml b/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.ymlsimilarity index 64%rename from docker-compose.ymlrename to cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.ymlindex c1ec92a58c..cd90f74f02 100644--- a/docker-compose.yml+++ b/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.yml@@ -4,18 +4,27 @@ services:context: .dockerfile: Dockerfiletarget: ldr+ {%- if cookiecutter.host_network %}network_mode: host # Best option for connecting to locally running Ollama+ {% endif %}environment:# Web Interface Settings- - LDR_WEB_PORT=5000- - LDR_WEB_HOST=0.0.0.0+ - LDR_WEB_PORT={{cookiecutter.host_port}}+ - LDR_WEB_HOST={{cookiecutter.host_ip}}volumes:- ./data:/root/.config/local_deep_researchrestart: unless-stopped+ {%- if cookiecutter.enable_ollama or cookiecutter.enable_searxng %}depends_on:+ {%- if cookiecutter.enable_ollama %}- ollama+ {% endif %}+ {%- if cookiecutter.enable_searxng %}- searxng+ {% endif %}+ {% endif %}+ {%- if cookiecutter.enable_ollama %}ollama:image: ollama/ollama:latestvolumes:@@ -30,7 +39,9 @@ services:count: allcapabilities: [gpu]restart: unless-stopped+ {% endif %}+ {%- if cookiecutter.enable_searxng %}searxng:image: searxng/searxng:latestcontainer_name: searxng@@ -39,3 +50,4 @@ services:volumes:- ./searxng-data:/etc/searxngrestart: unless-stopped+ {% endif %}diff --git a/pdm.lock b/pdm.lockindex 5b70f3d340..7bda8016ca 100644--- a/pdm.lock+++ b/pdm.lock@@ -5,7 +5,7 @@groups = ["default", "dev"]strategy = ["inherit_metadata"]lock_version = "4.5.0"-content_hash = "sha256:9e84078c933f2c88171254005759861b15d2cf214a8b492fe0dc19d253f9fc47"+content_hash = "sha256:2826fc4205851a9641b5efa7b6478400dc785bc152b17612a1245d3e38202a94"[[metadata.targets]]requires_python = ">=3.10"@@ -363,6 +363,19 @@ files = [{file = "bidict-0.23.1.tar.gz", hash = "sha256:03069d763bc387bbd20e7d49914e75fc4132a41937fa3405417e1a5a2d006d71"},]+[[package]]+name = "binaryornot"+version = "0.4.4"+summary = "Ultra-lightweight pure Python package to check if a file is binary or text."+groups = ["dev"]+dependencies = [+ "chardet>=3.0.2",+]+files = [+ {file = "binaryornot-0.4.4-py2.py3-none-any.whl", hash = "sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4"},+ {file = "binaryornot-0.4.4.tar.gz", hash = "sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061"},+]+[[package]]name = "black"version = "25.1.0"@@ -526,7 +539,7 @@ name = "chardet"version = "5.2.0"requires_python = ">=3.7"summary = "Universal encoding detector for Python 3"-groups = ["default"]+groups = ["default", "dev"]files = [{file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"},{file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"},@@ -635,6 +648,27 @@ files = [{file = "comm-0.2.2.tar.gz", hash = "sha256:3fd7a84065306e07bea1773df6eb8282de51ba82f77c72f9c85716ab11fe980e"},]+[[package]]+name = "cookiecutter"+version = "2.6.0"+requires_python = ">=3.7"+summary = "A command-line utility that creates projects from project templates, e.g. creating a Python package project from a Python package project template."+groups = ["dev"]+dependencies = [+ "Jinja2<4.0.0,>=2.7",+ "arrow",+ "binaryornot>=0.4.4",+ "click<9.0.0,>=7.0",+ "python-slugify>=4.0.0",+ "pyyaml>=5.3.1",+ "requests>=2.23.0",+ "rich",+]+files = [+ {file = "cookiecutter-2.6.0-py3-none-any.whl", hash = "sha256:a54a8e37995e4ed963b3e82831072d1ad4b005af736bb17b99c2cbd9d41b6e2d"},+ {file = "cookiecutter-2.6.0.tar.gz", hash = "sha256:db21f8169ea4f4fdc2408d48ca44859349de2647fbe494a9d6c3edfc0542c21c"},+]+[[package]]name = "cryptography"version = "44.0.3"@@ -2195,6 +2229,20 @@ files = [{file = "lxml-5.4.0.tar.gz", hash = "sha256:d12832e1dbea4be280b22fd0ea7c9b87f0d8fc51ba06e92dc62d52f804f78ebd"},]+[[package]]+name = "markdown-it-py"+version = "3.0.0"+requires_python = ">=3.8"+summary = "Python port of markdown-it. Markdown parsing, done right!"+groups = ["dev"]+dependencies = [+ "mdurl~=0.1",+]+files = [+ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"},+ {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"},+]+[[package]]name = "markupsafe"version = "3.0.2"@@ -2294,6 +2342,17 @@ files = [{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},]+[[package]]+name = "mdurl"+version = "0.1.2"+requires_python = ">=3.7"+summary = "Markdown URL utilities"+groups = ["dev"]+files = [+ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"},+ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"},+]+[[package]]name = "mistune"version = "3.1.3"@@ -3463,6 +3522,20 @@ files = [{file = "python_oxmsg-0.0.2.tar.gz", hash = "sha256:a6aff4deb1b5975d44d49dab1d9384089ffeec819e19c6940bc7ffbc84775fad"},]+[[package]]+name = "python-slugify"+version = "8.0.4"+requires_python = ">=3.7"+summary = "A Python slugify application that also handles Unicode"+groups = ["dev"]+dependencies = [+ "text-unidecode>=1.3",+]+files = [+ {file = "python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856"},+ {file = "python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8"},+]+[[package]]name = "python-socketio"version = "5.13.0"@@ -3861,6 +3934,22 @@ files = [{file = "rfc3986_validator-0.1.1.tar.gz", hash = "sha256:3d44bde7921b3b9ec3ae4e3adca370438eccebc676456449b145d533b240d055"},]+[[package]]+name = "rich"+version = "14.0.0"+requires_python = ">=3.8.0"+summary = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"+groups = ["dev"]+dependencies = [+ "markdown-it-py>=2.2.0",+ "pygments<3.0.0,>=2.13.0",+ "typing-extensions<5.0,>=4.0.0; python_version < \"3.11\"",+]+files = [+ {file = "rich-14.0.0-py3-none-any.whl", hash = "sha256:1c9491e1951aac09caffd42f448ee3d04e58923ffe14993f6e83068dc395d7e0"},+ {file = "rich-14.0.0.tar.gz", hash = "sha256:82f1bc23a6a21ebca4ae0c45af9bdbc492ed20231dcb63f297d6d1021a9d5725"},+]+[[package]]name = "rpds-py"version = "0.25.0"@@ -4284,6 +4373,16 @@ files = [{file = "terminado-0.18.1.tar.gz", hash = "sha256:de09f2c4b85de4765f7714688fff57d3e75bad1f909b589fde880460c753fd2e"},]+[[package]]+name = "text-unidecode"+version = "1.3"+summary = "The most basic Text::Unidecode port"+groups = ["dev"]+files = [+ {file = "text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93"},+ {file = "text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8"},+]+[[package]]name = "threadpoolctl"version = "3.6.0"diff --git a/pyproject.toml b/pyproject.tomlindex 2e169c8c2b..71d7a0fb60 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -57,11 +57,6 @@ dependencies = ["flask-wtf>=1.2.2",]-[[tool.pdm.source]]-url = "https://download.pytorch.org/whl/cpu"-name = "torch"-include_packages = ["torch", "torch*"]-[project.urls]"Homepage" = "https://github.com/LearningCircuit/local-deep-research""Bug Tracker" = "https://github.com/LearningCircuit/local-deep-research/issues"@@ -77,9 +72,14 @@ include-package-data = true"local_deep_research.web" = ["templates/*", "static/*", "static/**/*"]"local_deep_research.defaults" = ["*.toml", "*.py", "*.template", ".env.template"]+[tool.pdm]distribution = trueversion = { source = "file", path = "src/local_deep_research/__version__.py" }+[[tool.pdm.source]]+url = "https://download.pytorch.org/whl/cpu"+name = "torch"+include_packages = ["torch", "torch*"][dependency-groups]dev = [@@ -88,4 +88,5 @@ dev = ["pre-commit>=4.2.0","flake8>=7.1.2","jupyter>=1.1.1",+ "cookiecutter>=2.6.0",]