DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
feat(lightrag): add dedicated model selection (#640)
XZHf43347b915cc
diff --git a/deeptutor/api/routers/knowledge.py b/deeptutor/api/routers/knowledge.pyindex 5275d5566..e28e318bb 100644--- a/deeptutor/api/routers/knowledge.py+++ b/deeptutor/api/routers/knowledge.py@@ -1378,6 +1378,30 @@ class LightRagConfigUpdate(BaseModel):max_concurrent_files: int | None = Nonellm_model_max_async: int | None = Noneentity_extract_max_gleaning: int | None = None+ llm_profile_id: str | None = None+ llm_model_id: str | None = None+++def _validate_lightrag_llm_selection(profile_id: str, model_id: str) -> None:+ """Keep stored LightRAG references inside the configured model catalog."""+ if bool(profile_id) != bool(model_id):+ raise HTTPException(+ status_code=422,+ detail="LightRAG model selection requires both profile_id and model_id.",+ )+ if not profile_id:+ return+ try:+ from deeptutor.services.config import get_model_catalog_service+ from deeptutor.services.model_selection import (+ LLMSelection,+ apply_llm_selection_to_catalog,+ )++ selection = LLMSelection.from_payload({"profile_id": profile_id, "model_id": model_id})+ apply_llm_selection_to_catalog(get_model_catalog_service().load(), selection)+ except ValueError as exc:+ raise HTTPException(status_code=422, detail=str(exc)) from None@router.get("/rag-pipelines/lightrag/config")@@ -1406,7 +1430,14 @@ async def update_lightrag_pipeline_config(payload: LightRagConfigUpdate):service = get_runtime_settings_service()current = service.load_lightrag()updates = payload.model_dump(exclude_none=True)+ candidate = {**current, **updates}+ _validate_lightrag_llm_selection(+ str(candidate.get("llm_profile_id") or ""),+ str(candidate.get("llm_model_id") or ""),+ )return service.save_lightrag({**current, **updates})+ except HTTPException:+ raiseexcept Exception as e:logger.error(f"Error updating LightRAG config: {e}")raise HTTPException(status_code=500, detail=str(e))diff --git a/deeptutor/services/config/runtime_settings.py b/deeptutor/services/config/runtime_settings.pyindex f6815c48a..97a5230c8 100644--- a/deeptutor/services/config/runtime_settings.py+++ b/deeptutor/services/config/runtime_settings.py@@ -296,6 +296,8 @@ DEFAULT_GRAPHRAG_SETTINGS: dict[str, Any] = {# mode-only query). ``max_concurrent_files`` maps to RAGAnythingConfig's batch# knob; ``llm_model_max_async`` / ``entity_extract_max_gleaning`` ride into# LightRAG's own constructor via RAGAnything's ``lightrag_kwargs`` passthrough.+# Stable catalog references let LightRAG use a dedicated LLM while the global+# active chat model remains unchanged for ordinary chat.DEFAULT_LIGHTRAG_SETTINGS: dict[str, Any] = {"version": 1,"top_k": 60,@@ -303,6 +305,8 @@ DEFAULT_LIGHTRAG_SETTINGS: dict[str, Any] = {"max_concurrent_files": 1,"llm_model_max_async": 4,"entity_extract_max_gleaning": 1,+ "llm_profile_id": "",+ "llm_model_id": "",}IGNORE_PROCESS_OVERRIDES_ENV = "DEEPTUTOR_IGNORE_PROCESS_ENV_OVERRIDES"@@ -869,6 +873,8 @@ class RuntimeSettingsService:"entity_extract_max_gleaning": _coerce_clamped_int(settings.get("entity_extract_max_gleaning"), 1, 0, 5),+ "llm_profile_id": _string(settings.get("llm_profile_id"))[:128],+ "llm_model_id": _string(settings.get("llm_model_id"))[:128],}def _normalize_document_parsing(self, settings: dict[str, Any]) -> dict[str, Any]:diff --git a/deeptutor/services/llm/client.py b/deeptutor/services/llm/client.pyindex f3ec889d4..1652eae00 100644--- a/deeptutor/services/llm/client.py+++ b/deeptutor/services/llm/client.py@@ -25,19 +25,22 @@ class LLMClient:Prefer using factory functions (complete, stream) directly for new code."""- def __init__(self, config: LLMConfig | None = None) -> None:+ def __init__(self, config: LLMConfig | None = None, *, configure_env: bool = True) -> None:"""Initialize LLM client.Args:config: LLM configuration. If None, loads from environment.+ configure_env: Keep true for the legacy singleton facade; isolated+ override clients should not mutate process-wide SDK settings."""self.config = config or get_llm_config()self.logger = logging.getLogger(__name__)# Keep OPENAI_* env vars aligned for libraries that still read from env.- self._setup_openai_env_vars()+ if configure_env:+ self._setup_openai_env_vars()def _setup_openai_env_vars(self) -> None:"""diff --git a/deeptutor/services/rag/pipelines/lightrag/config.py b/deeptutor/services/rag/pipelines/lightrag/config.pyindex 049e30763..27a582aed 100644--- a/deeptutor/services/rag/pipelines/lightrag/config.py+++ b/deeptutor/services/rag/pipelines/lightrag/config.py@@ -216,14 +216,68 @@ def lightrag_kwargs_from_settings() -> dict:return {}-def build_llm_model_func(*, io_bridge: OwnerLoopBridge | None = None):+def lightrag_llm_selection_from_settings() -> dict[str, str] | None:+ """Read the stable catalog reference for LightRAG's dedicated LLM.++ Both IDs are required so callers cannot accidentally combine one half of an+ old selection with the currently-active half of another model. Empty fields+ mean "use the global active chat model".+ """+ try:+ from deeptutor.services.config import load_lightrag_settings++ settings = load_lightrag_settings()+ profile_id = str(settings.get("llm_profile_id") or "").strip()+ model_id = str(settings.get("llm_model_id") or "").strip()+ if not profile_id and not model_id:+ return None+ if not profile_id or not model_id:+ logger.warning("Ignoring incomplete LightRAG LLM selection; using the active model")+ return None+ return {"profile_id": profile_id, "model_id": model_id}+ except Exception:+ logger.warning(+ "Could not read LightRAG LLM selection; using the active model", exc_info=True+ )+ return None+++def _resolve_override_llm_config(selection: dict[str, str] | None):+ """Resolve a stored catalog selection without exposing catalog secrets."""+ if selection is None:+ return None+ try:+ from deeptutor.services.model_selection.runtime import (+ resolve_llm_config_for_selection,+ )++ return resolve_llm_config_for_selection(selection)+ except ValueError:+ logger.warning(+ "LightRAG LLM selection %s no longer exists in the catalog; using the active model",+ selection,+ )+ return None+++def build_llm_model_func(+ *,+ io_bridge: OwnerLoopBridge | None = None,+ llm_selection: dict[str, str] | None = None,+):"""Wrap DeepTutor's unified LLM callable for LightRAG.Drops LightRAG's internal kwargs while preserving explicit ``messages``."""- from deeptutor.services.llm import get_llm_client+ config = _resolve_override_llm_config(llm_selection)+ if config is None:+ from deeptutor.services.llm import get_llm_client++ base = get_llm_client().get_model_func()+ else:+ from deeptutor.services.llm.client import LLMClient- base = get_llm_client().get_model_func()+ base = LLMClient(config=config, configure_env=False).get_model_func()async def llm_model_func(prompt="",@@ -247,11 +301,21 @@ def build_llm_model_func(*, io_bridge: OwnerLoopBridge | None = None):return llm_model_func-def build_vision_model_func(*, io_bridge: OwnerLoopBridge | None = None):+def build_vision_model_func(+ *,+ io_bridge: OwnerLoopBridge | None = None,+ llm_selection: dict[str, str] | None = None,+):"""Wrap DeepTutor's vision-capable callable for RAG-Anything's image step."""- from deeptutor.services.llm import get_llm_client+ config = _resolve_override_llm_config(llm_selection)+ if config is None:+ from deeptutor.services.llm import get_llm_client++ base = get_llm_client().get_vision_model_func()+ else:+ from deeptutor.services.llm.client import LLMClient- base = get_llm_client().get_vision_model_func()+ base = LLMClient(config=config, configure_env=False).get_vision_model_func()async def vision_model_func(prompt="",diff --git a/deeptutor/services/rag/pipelines/lightrag/engine.py b/deeptutor/services/rag/pipelines/lightrag/engine.pyindex d2e4758a6..b83036362 100644--- a/deeptutor/services/rag/pipelines/lightrag/engine.py+++ b/deeptutor/services/rag/pipelines/lightrag/engine.py@@ -28,6 +28,7 @@ from .config import (build_vision_model_func,indexing_kwargs_from_settings,lightrag_kwargs_from_settings,+ lightrag_llm_selection_from_settings,normalize_mode,query_kwargs_from_settings,)@@ -94,7 +95,9 @@ def build_rag(working_dir: Path, *, io_bridge: OwnerLoopBridge | None = None) ->from raganything import RAGAnything, RAGAnythingConfigconfig = _build_config(RAGAnythingConfig, working_dir)- adapter_kwargs = {"io_bridge": io_bridge} if io_bridge is not None else {}+ adapter_kwargs: dict[str, Any] = {"llm_selection": lightrag_llm_selection_from_settings()}+ if io_bridge is not None:+ adapter_kwargs["io_bridge"] = io_bridgefuncs = {"llm_model_func": build_llm_model_func(**adapter_kwargs),"vision_model_func": build_vision_model_func(**adapter_kwargs),diff --git a/tests/api/test_knowledge_router.py b/tests/api/test_knowledge_router.pyindex 1f73ea932..d3d503396 100644--- a/tests/api/test_knowledge_router.py+++ b/tests/api/test_knowledge_router.py@@ -1927,3 +1927,60 @@ def test_lightrag_config_endpoint_round_trips_the_indexing_knobs(assert again["max_concurrent_files"] == 4assert again["entity_extract_max_gleaning"] == 2assert again["top_k"] == 42+++def test_lightrag_config_validates_dedicated_llm_selection(monkeypatch, tmp_path: Path) -> None:+ """The LightRAG override references a real catalog pair, not free text."""+ from deeptutor.services.config.model_catalog import ModelCatalogService++ settings_service = RuntimeSettingsService(tmp_path, process_env={})+ catalog_service = ModelCatalogService(tmp_path / "model_catalog.json")+ catalog_service.save(+ {+ "services": {+ "llm": {+ "active_profile_id": "profile-1",+ "active_model_id": "model-1",+ "profiles": [+ {+ "id": "profile-1",+ "name": "Local",+ "binding": "ollama",+ "models": [{"id": "model-1", "model": "qwen"}],+ }+ ],+ }+ }+ }+ )+ monkeypatch.setattr(+ "deeptutor.services.config.get_runtime_settings_service",+ lambda: settings_service,+ )+ monkeypatch.setattr(+ "deeptutor.services.config.get_model_catalog_service",+ lambda: catalog_service,+ )++ client = TestClient(_build_app())+ saved = client.put(+ "/api/v1/knowledge/rag-pipelines/lightrag/config",+ json={"llm_profile_id": "profile-1", "llm_model_id": "model-1"},+ )+ assert saved.status_code == 200+ assert saved.json()["llm_profile_id"] == "profile-1"+ assert saved.json()["llm_model_id"] == "model-1"++ unknown = client.put(+ "/api/v1/knowledge/rag-pipelines/lightrag/config",+ json={"llm_model_id": "missing"},+ )+ assert unknown.status_code == 422++ cleared = client.put(+ "/api/v1/knowledge/rag-pipelines/lightrag/config",+ json={"llm_profile_id": "", "llm_model_id": ""},+ )+ assert cleared.status_code == 200+ assert cleared.json()["llm_profile_id"] == ""+ assert cleared.json()["llm_model_id"] == ""diff --git a/tests/services/config/test_graphrag_lightrag_settings.py b/tests/services/config/test_graphrag_lightrag_settings.pyindex d736e0317..d4467bb6d 100644--- a/tests/services/config/test_graphrag_lightrag_settings.py+++ b/tests/services/config/test_graphrag_lightrag_settings.py@@ -52,6 +52,8 @@ def test_lightrag_indexing_knobs_round_trip_and_clamp(tmp_path: Path) -> None:assert defaults["max_concurrent_files"] == 1assert defaults["llm_model_max_async"] == 4assert defaults["entity_extract_max_gleaning"] == 1+ assert defaults["llm_profile_id"] == ""+ assert defaults["llm_model_id"] == ""saved = svc.save_lightrag({@@ -74,12 +76,25 @@ def test_lightrag_indexing_knobs_round_trip_and_clamp(tmp_path: Path) -> None:assert clamped["max_concurrent_files"] == 16assert clamped["llm_model_max_async"] == 1assert clamped["entity_extract_max_gleaning"] == 5-# Editing one knob must not reset the query knobs beside it.assert clamped["top_k"] == 60assert clamped["response_type"] == "Multiple Paragraphs"+def test_lightrag_dedicated_llm_selection_round_trip(tmp_path: Path) -> None:+ """Empty references mean the global model; a complete pair is preserved."""+ svc = RuntimeSettingsService(tmp_path, process_env={})+ assert svc.load_lightrag()["llm_profile_id"] == ""++ saved = svc.save_lightrag({"llm_profile_id": " profile-1 ", "llm_model_id": " model-1 "})+ assert saved["llm_profile_id"] == "profile-1"+ assert saved["llm_model_id"] == "model-1"++ cleared = svc.save_lightrag({"llm_profile_id": "", "llm_model_id": ""})+ assert cleared["llm_profile_id"] == ""+ assert cleared["llm_model_id"] == ""++def test_lightrag_settings_written_before_the_indexing_knobs_still_load(tmp_path: Path,) -> None:@@ -93,6 +108,8 @@ def test_lightrag_settings_written_before_the_indexing_knobs_still_load(assert loaded["max_concurrent_files"] == 1assert loaded["llm_model_max_async"] == 4assert loaded["entity_extract_max_gleaning"] == 1+ assert loaded["llm_profile_id"] == ""+ assert loaded["llm_model_id"] == ""def test_response_type_capped(tmp_path: Path) -> None:diff --git a/tests/services/rag/test_lightrag_pipeline.py b/tests/services/rag/test_lightrag_pipeline.pyindex c16007e9c..7cf7bead9 100644--- a/tests/services/rag/test_lightrag_pipeline.py+++ b/tests/services/rag/test_lightrag_pipeline.py@@ -73,6 +73,79 @@ def test_normalize_provider_keeps_lightrag() -> None:assert normalize_provider_name("LightRAG") == "lightrag"+def test_lightrag_llm_selection_requires_both_catalog_ids(monkeypatch) -> None:+ settings_cases = [+ ({}, None),+ ({"llm_profile_id": "p", "llm_model_id": "m"}, {"profile_id": "p", "model_id": "m"}),+ ({"llm_profile_id": "p", "llm_model_id": ""}, None),+ ({"llm_profile_id": "", "llm_model_id": "m"}, None),+ ]+ for settings, expected in settings_cases:+ monkeypatch.setattr(+ "deeptutor.services.config.load_lightrag_settings",+ lambda settings=settings: settings,+ )+ assert lr_config.lightrag_llm_selection_from_settings() == expected+++def test_lightrag_llm_adapter_resolves_dedicated_catalog_selection(+ monkeypatch,+) -> None:+ class _Config:+ model = "light-model"++ class _Client:+ def __init__(self, *, config, configure_env) -> None:+ assert config is cfg+ assert configure_env is False++ def get_model_func(self):+ async def model_func(_prompt, **kwargs):+ assert kwargs["max_retries"] == 0+ return "ok"++ return model_func++ cfg = _Config()+ monkeypatch.setattr(+ "deeptutor.services.model_selection.runtime.resolve_llm_config_for_selection",+ lambda selection: cfg,+ )+ monkeypatch.setattr("deeptutor.services.llm.client.LLMClient", _Client)++ adapter = lr_config.build_llm_model_func(llm_selection={"profile_id": "p", "model_id": "m"})+ assert asyncio.run(adapter("prompt")) == "ok"+++def test_lightrag_vision_adapter_resolves_dedicated_catalog_selection(+ monkeypatch,+) -> None:+ class _Config:+ model = "light-model"++ class _Client:+ def __init__(self, *, config, configure_env) -> None:+ assert config is cfg+ assert configure_env is False++ def get_vision_model_func(self):+ async def model_func(_prompt, **kwargs):+ assert kwargs["allow_image_fallback"] is False+ return "ok"++ return model_func++ cfg = _Config()+ monkeypatch.setattr(+ "deeptutor.services.model_selection.runtime.resolve_llm_config_for_selection",+ lambda selection: cfg,+ )+ monkeypatch.setattr("deeptutor.services.llm.client.LLMClient", _Client)++ adapter = lr_config.build_vision_model_func(llm_selection={"profile_id": "p", "model_id": "m"})+ assert asyncio.run(adapter("prompt")) == "ok"++@pytest.mark.parametrize("given,expected",[@@ -715,9 +788,9 @@ def test_build_rag_skips_raganything_parser_install_check(monkeypatch) -> None:fake_module.RAGAnything = _FakeRagAnythingfake_module.RAGAnythingConfig = _FakeConfigmonkeypatch.setitem(sys.modules, "raganything", fake_module)- monkeypatch.setattr(engine, "build_llm_model_func", lambda: "llm")- monkeypatch.setattr(engine, "build_vision_model_func", lambda: "vision")- monkeypatch.setattr(engine, "build_embedding_func", lambda: "embed")+ monkeypatch.setattr(engine, "build_llm_model_func", lambda **_kwargs: "llm")+ monkeypatch.setattr(engine, "build_vision_model_func", lambda **_kwargs: "vision")+ monkeypatch.setattr(engine, "build_embedding_func", lambda **_kwargs: "embed")rag = engine.build_rag(Path("/tmp/kb-wd")) # noqa: S108diff --git a/tests/services/rag/test_lightrag_settings_wiring.py b/tests/services/rag/test_lightrag_settings_wiring.pyindex edffb235e..2331fe028 100644--- a/tests/services/rag/test_lightrag_settings_wiring.py+++ b/tests/services/rag/test_lightrag_settings_wiring.py@@ -97,14 +97,39 @@ def _settings(monkeypatch: pytest.MonkeyPatch) -> None:"lightrag_kwargs_from_settings",lambda: {"llm_model_max_async": 8, "entity_extract_max_gleaning": 2},)+ monkeypatch.setattr(+ engine_module,+ "lightrag_llm_selection_from_settings",+ lambda: {"profile_id": "profile-1", "model_id": "model-1"},+ )-def test_modern_raganything_receives_every_knob(fake_raganything, tmp_path: Path) -> None:+def test_modern_raganything_receives_every_knob(+ fake_raganything, tmp_path: Path, monkeypatch: pytest.MonkeyPatch+) -> None:fake_raganything(_ModernRag, _ModernConfig)+ llm_selection_args: list[dict[str, str] | None] = []++ def record_llm_adapter(**kwargs):+ llm_selection_args.append(kwargs.get("llm_selection"))+ return lambda *args, **kwargs: None++ monkeypatch.setattr(engine_module, "build_llm_model_func", record_llm_adapter)+ monkeypatch.setattr(+ engine_module,+ "build_vision_model_func",+ lambda **_kwargs: lambda *args, **kwargs: None,+ )+ monkeypatch.setattr(+ engine_module,+ "build_embedding_func",+ lambda **_kwargs: lambda *args, **kwargs: None,+ )rag = engine_module.build_rag(tmp_path)assert rag.config.max_concurrent_files == 4+ assert llm_selection_args == [{"profile_id": "profile-1", "model_id": "model-1"}]assert rag.lightrag_kwargs == {"llm_model_max_async": 8, "entity_extract_max_gleaning": 2}diff --git a/web/components/knowledge/EngineDetail.tsx b/web/components/knowledge/EngineDetail.tsxindex 0f223e313..06f45d60f 100644--- a/web/components/knowledge/EngineDetail.tsx+++ b/web/components/knowledge/EngineDetail.tsx@@ -894,14 +894,37 @@ function LightRagForm({onError: (message: string) => void;}) {const { t } = useTranslation();+ const [modelOptions, setModelOptions] =+ useState<ModelOptionsByKind | null>(null);const { form, setLoaded, setForm, saving, setSaving, dirty, patch } =useEngineForm<LightRagConfig>(() => getLightRagConfig({ force: true }),onError,);+ useEffect(() => {+ let cancelled = false;+ getEngineModelOptions(["llm"])+ .then((data) => !cancelled && setModelOptions(data))+ .catch(() => !cancelled && setModelOptions({ llm: { active: { profile_id: null, model_id: null }, options: [] } }));+ return () => {+ cancelled = true;+ };+ }, []);+if (!form) return <FormSkeleton />;+ const llmEntry = modelOptions?.llm;+ const selectedProfileId = form.llm_profile_id;+ const selectedModelId = form.llm_model_id;+ const selectedValue =+ selectedProfileId && selectedModelId+ ? `${selectedProfileId}::${selectedModelId}`+ : "";+ const selectedOption = llmEntry?.options.find(+ (option) => `${option.profile_id}::${option.model_id}` === selectedValue,+ );+const save = async () => {setSaving(true);try {@@ -911,6 +934,8 @@ function LightRagForm({max_concurrent_files: form.max_concurrent_files,llm_model_max_async: form.llm_model_max_async,entity_extract_max_gleaning: form.entity_extract_max_gleaning,+ llm_profile_id: form.llm_profile_id,+ llm_model_id: form.llm_model_id,});setLoaded(next);setForm(next);@@ -936,6 +961,50 @@ function LightRagForm({value={form.response_type}onChange={(v) => patch({ response_type: v })}/>+ <label className="flex flex-col gap-1">+ <span className="text-[12px] font-medium text-[var(--foreground)]">+ {t("Chat model")}+ </span>+ <select+ value={selectedValue}+ disabled={!llmEntry}+ onChange={(event) => {+ const [profileId, modelId] = event.target.value.split("::");+ patch({+ llm_profile_id: profileId || "",+ llm_model_id: modelId || "",+ });+ }}+ className="w-full cursor-pointer rounded-lg border border-[var(--border)] bg-[var(--background)] px-3 py-1.5 text-[13px] text-[var(--foreground)] outline-none transition-colors focus:border-[var(--foreground)]/25 disabled:opacity-50"+ >+ {!llmEntry ? (+ <option value="">{t("Loading models…")}</option>+ ) : (+ <>+ <option value="">{t("Use global active chat model")}</option>+ {selectedValue && !selectedOption && (+ <option value={selectedValue}>+ {t("Selected model unavailable")}+ </option>+ )}+ {llmEntry.options.map((option) => (+ <option+ key={`${option.profile_id}::${option.model_id}`}+ value={`${option.profile_id}::${option.model_id}`}+ >+ {option.label}+ {option.model && option.model !== option.label+ ? ` · ${option.model}`+ : ""}+ </option>+ ))}+ </>+ )}+ </select>+ <span className="text-[11px] text-[var(--muted-foreground)]">+ {t("Used for LightRAG extraction and query calls")}+ </span>+ </label></div>{/* Indexing knobs are a separate axis from the two above: they shape howdiff --git a/web/lib/knowledge-api.ts b/web/lib/knowledge-api.tsindex 3b073590b..914364ee4 100644--- a/web/lib/knowledge-api.ts+++ b/web/lib/knowledge-api.ts@@ -83,6 +83,9 @@ export interface LightRagConfig {llm_model_max_async: number;/** Extra extraction passes per chunk, to recover missed entities. */entity_extract_max_gleaning: number;+ /** Stable catalog reference, or empty strings for the global active chat model. */+ llm_profile_id: string;+ llm_model_id: string;}export interface PreflightCheck {diff --git a/web/locales/en/app.json b/web/locales/en/app.jsonindex 846e8a812..005f65b3d 100644--- a/web/locales/en/app.json+++ b/web/locales/en/app.json@@ -2649,6 +2649,9 @@"Chunk size": "Chunk size","Chunk overlap": "Chunk overlap","Results per query": "Results per query",+ "Use global active chat model": "Use global active chat model",+ "Selected model unavailable": "Selected model unavailable",+ "Used for LightRAG extraction and query calls": "Used for LightRAG extraction and query calls","Vector candidate ×": "Vector candidate ×","Keyword candidate ×": "Keyword candidate ×","Used by hybrid only": "Used by hybrid only",diff --git a/web/locales/zh/app.json b/web/locales/zh/app.jsonindex 1279f3d24..fd4269309 100644--- a/web/locales/zh/app.json+++ b/web/locales/zh/app.json@@ -2649,6 +2649,9 @@"Chunk size": "分块大小","Chunk overlap": "分块重叠","Results per query": "每次查询返回结果数",+ "Use global active chat model": "使用全局对话模型",+ "Selected model unavailable": "所选模型不可用",+ "Used for LightRAG extraction and query calls": "用于 LightRAG 抽取和查询调用","Vector candidate ×": "向量候选倍率","Keyword candidate ×": "关键词候选倍率","Used by hybrid only": "仅 hybrid 模式使用",