{"record":{"id":"de06f75fda8da9a4","repo":"HKUDS/DeepTutor","slug":"pageindex-oss-needs-an-active-llm-configure-one-u","errorCode":null,"errorMessage":"PageIndex OSS needs an active LLM. Configure one under Settings → Catalog.","messagePattern":"PageIndex OSS needs an active LLM\\. Configure one under Settings → Catalog\\.","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/rag/pipelines/pageindex/client.py","lineNumber":43,"sourceCode":"    return cloud_type(api_key)\n\n\ndef _prefixed_model(prefix: str, model: str) -> str:\n    return model if model.startswith(f\"{prefix}/\") else f\"{prefix}/{model}\"\n\n\ndef resolve_oss_sdk_config() -> tuple[str, dict[str, Any]]:\n    \"\"\"Translate DeepTutor's active LLM into PageIndex's indexing lane.\"\"\"\n    from deeptutor.services.config import resolve_llm_runtime_config\n\n    cfg = resolve_llm_runtime_config()\n    model = str(getattr(cfg, \"model\", \"\") or \"\").strip()\n    binding = str(\n        getattr(cfg, \"binding\", None) or getattr(cfg, \"provider_name\", None) or \"openai\"\n    ).strip()\n    spec = find_by_name(binding)\n    if not model:\n        raise RuntimeError(\n            \"PageIndex OSS needs an active LLM. Configure one under Settings → Catalog.\"\n        )\n    if (\n        spec is None\n        or spec.is_oauth\n        or spec.backend\n        in {\n            \"openai_codex\",\n            \"github_copilot\",\n            \"codebuddy\",\n        }\n    ):\n        raise RuntimeError(\n            \"PageIndex OSS indexing needs an API-key or local LLM profile; \"\n            \"the active OAuth-only provider cannot be used.\"\n        )\n\n    resolved_model = strip_provider_prefix(model, spec)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/rag/pipelines/pageindex/client.py#L25-L61","documentation":"resolve_oss_sdk_config requires a configured active LLM to drive PageIndex OSS indexing; it reads the active model from config and raises RuntimeError when the model field is empty. The UI path for the fix is Settings → Catalog.","triggerScenarios":"Calling list_pipelines() or starting a local PageIndex OSS flow (_pageindex_oss_preflight) while no active LLM model is set in runtime settings (empty cfg.model).","commonSituations":"Fresh install with no LLM configured, settings JSON reset or deleted (data/user/settings), or an OAuth flow that never persisted a default model choice.","solutions":["Configure an active LLM under Settings → Catalog (or set the model in the runtime settings JSON), then retry.","Verify data/user/settings/*.json contains a non-empty model for the active binding; process-env overrides can also set it.","Check that get_active_llm() returns a cfg whose model attribute is populated in your embedding/indexing script."],"exampleFix":"# before\nresult = await pageindex_client.local(...)  # RuntimeError: needs an active LLM\n\n# after\n# settings.json: {\"llm\": {\"binding\": \"openai\", \"model\": \"gpt-4o-mini\", ...}}\nresult = await pageindex_client.local(...)","handlingStrategy":"validation","validationCode":"cfg = get_active_llm()\nif not str(getattr(cfg, \"model\", \"\") or \"\").strip():\n    raise RuntimeError(\"configure an active LLM before PageIndex OSS\")","typeGuard":"def has_active_llm() -> bool:\n    cfg = get_active_llm()\n    return bool(str(getattr(cfg, \"model\", \"\") or \"\").strip())","tryCatchPattern":"try:\n    cfg = resolve_oss_sdk_config()\nexcept RuntimeError as e:\n    if \"active LLM\" in str(e):\n        prompt_user_to_configure_llm()  # route to Settings -> Catalog\n        return\n    raise","preventionTips":["Run first-time setup so an active LLM always exists.","Assert model is non-empty before OSS workflows.","Back up data/user/settings so resets are recoverable."],"tags":["pageindex","configuration","llm","missing-model"],"backgroundTag":"missing-llm-configuration","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}