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.

refactor(web): optimize model selection logic and remove redundant comments

JayLiu781f9e2e1b9d
diff --git a/src/local_deep_research/web/static/js/components/research.js b/src/local_deep_research/web/static/js/components/research.js
index 1971bc1888..90ec0126c6 100644
--- a/src/local_deep_research/web/static/js/components/research.js
+++ b/src/local_deep_research/web/static/js/components/research.js
@@ -718,21 +718,18 @@
usingFallbackModels = true;
}
} else if (providerUpper === 'OPENAI_ENDPOINT') {
- // 优先过滤具有OPENAI_ENDPOINT提供商标记的模型
models = allModels.filter(model => {
if (!model || typeof model !== 'object') return false;
// Skip provider options
if (model.value && !model.id && !model.name) return false;
- // 精确匹配OPENAI_ENDPOINT提供商
const modelProvider = (model.provider || '').toUpperCase();
return modelProvider === 'OPENAI_ENDPOINT';
});
console.log(`Found ${models.length} models with provider="OPENAI_ENDPOINT"`);
- // 如果没有找到足够的模型,使用从后端API获取的所有模型
if (models.length === 0) {
console.log('No OPENAI_ENDPOINT models found, checking for models with "Custom" in label');
models = allModels.filter(model => {
@@ -741,7 +738,6 @@
// Skip provider options
if (model.value && !model.id && !model.name) return false;
- // 查找标签中包含"Custom"字样的模型
const modelLabel = (model.label || '').toLowerCase();
return modelLabel.includes('custom');
});
@@ -749,7 +745,6 @@
console.log(`Found ${models.length} models with "Custom" in label`);
}
- // 如果仍然没有找到模型,才使用标准模型作为示例
if (models.length === 0) {
console.log('No OPENAI_ENDPOINT or Custom models found, using OpenAI models as examples');
models = allModels.filter(model => {
@@ -758,7 +753,6 @@
// Skip provider options
if (model.value && !model.id && !model.name) return false;
- // 包含OpenAI模型作为示例
const modelProvider = (model.provider || '').toUpperCase();
const modelId = (model.id || model.value || '').toLowerCase();
return modelProvider === 'OPENAI' ||
diff --git a/src/local_deep_research/web/static/js/components/settings.js b/src/local_deep_research/web/static/js/components/settings.js
index 11f99d841d..2156ccdb75 100644
--- a/src/local_deep_research/web/static/js/components/settings.js
+++ b/src/local_deep_research/web/static/js/components/settings.js
@@ -3689,14 +3689,11 @@
return false;
}
- // 为OPENAI_ENDPOINT添加特殊处理
if (providerUpper === 'OPENAI_ENDPOINT') {
- // 首先检查模型的provider属性
if (model.provider && model.provider.toUpperCase() === 'OPENAI_ENDPOINT') {
return true;
}
- // 检查标签中是否包含"Custom"
if (model.label && model.label.toLowerCase().includes('custom')) {
return true;
}
diff --git a/src/temp_test/test_project.py b/src/temp_test/test_project.py
deleted file mode 100644
index 5086fc1784..0000000000
--- a/src/temp_test/test_project.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from local_deep_research.api import quick_summary
-
-summary_results = quick_summary("advances in fusion energy")
-
-print(summary_results["summary"])