Skip to content

~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.

feat: Make torch and transformers optional dependencies for VLLM

LearningCircuit7b8114f31391
diff --git a/README.md b/README.md
index aca3213229..4de006734f 100644
--- a/README.md
+++ b/README.md
@@ -192,6 +192,14 @@ python -m local_deep_research.web.app
**Important for pip users:** If you installed via pip and want to use the web UI, you must run `npm install` and `npm run build` in the package installation directory to generate frontend assets (icons, styles). Without this, the UI will have missing icons and styling issues. For programmatic API usage only, these steps can be skipped.
+#### Optional Dependencies
+
+VLLM support (for running transformer models directly):
+```bash
+pip install "local-deep-research[vllm]"
+```
+This installs torch, transformers, and vllm for advanced local model hosting. Most users running Ollama or LlamaCpp don't need this.
+
[Full Installation Guide →](https://github.com/LearningCircuit/local-deep-research/wiki/Installation)
## 💻 Usage Examples
diff --git a/pyproject.toml b/pyproject.toml
index f108bb61ed..02050aa9cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -79,6 +79,13 @@ dependencies = [
"sqlcipher3>=0.5.0; sys_platform != 'linux'",
]
+[project.optional-dependencies]
+vllm = [
+ "torch>=2.0.0",
+ "transformers>=4.30.0",
+ "vllm>=0.4.0",
+]
+
[project.urls]
"Homepage" = "https://github.com/LearningCircuit/local-deep-research"
"Bug Tracker" = "https://github.com/LearningCircuit/local-deep-research/issues"
diff --git a/src/local_deep_research/config/llm_config.py b/src/local_deep_research/config/llm_config.py
index 49e9617293..bdb5da38d5 100644
--- a/src/local_deep_research/config/llm_config.py
+++ b/src/local_deep_research/config/llm_config.py
@@ -2,7 +2,6 @@ import os
from functools import cache
from langchain_anthropic import ChatAnthropic
-from langchain_community.llms import VLLM
from langchain_core.language_models import BaseChatModel, FakeListChatModel
from langchain_ollama import ChatOllama
from langchain_openai import ChatOpenAI
@@ -129,6 +128,7 @@ def is_vllm_available():
try:
import torch # noqa: F401
import transformers # noqa: F401
+ from langchain_community.llms import VLLM # noqa: F401
return True
except ImportError:
@@ -211,13 +211,8 @@ def get_available_providers(settings_snapshot=None):
providers["llamacpp"] = "LlamaCpp (local models)"
# Check for VLLM capability
- try:
- import torch # noqa: F401
- import transformers # noqa: F401
-
+ if is_vllm_available():
providers["vllm"] = "VLLM (local models)"
- except ImportError:
- pass
# Default fallback
if not providers:
@@ -622,6 +617,8 @@ def get_llm(
elif provider == "vllm":
try:
+ from langchain_community.llms import VLLM
+
llm = VLLM(
model=model_name,
trust_remote_code=True,