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.

Database access through SQLAlchemy ORM

dim-tsoukalasf1db1ef9ab86
diff --git a/src/local_deep_research/config/llm_config.py b/src/local_deep_research/config/llm_config.py
index e6b2397fe5..d466348039 100644
--- a/src/local_deep_research/config/llm_config.py
+++ b/src/local_deep_research/config/llm_config.py
@@ -1,6 +1,5 @@
import logging
import os
-import sqlite3
from pathlib import Path
from dynaconf.vendor.box.exceptions import BoxKeyError
@@ -37,16 +36,14 @@ def get_db_setting(key, default_value=None):
"""Get a setting from the database with fallback to default value"""
try:
# Lazy import to avoid circular dependency
- from ..web.models.database import get_db_connection
-
- conn = get_db_connection()
- conn.row_factory = sqlite3.Row
- cursor = conn.cursor()
- cursor.execute("SELECT value FROM settings WHERE key = ?", (key,))
- result = cursor.fetchone()
- conn.close()
- if result and result["value"] is not None:
- return result["value"]
+ from ..web.services.settings_manager import SettingsManager
+
+ # Get settings manager which handles database access
+ settings_manager = SettingsManager()
+ value = settings_manager.get_setting(key)
+
+ if value is not None:
+ return value
except Exception as e:
logger.error(f"Error getting setting {key} from database: {e}")
return default_value
@@ -94,7 +91,6 @@ def get_llm(model_name=None, temperature=None, provider=None):
f"Getting LLM with model: {model_name}, temperature: {temperature}, provider: {provider}"
)
-
# Common parameters for all models
common_params = {
"temperature": temperature,