{"record":{"id":"f3a1c4b306174ed6","repo":"HKUDS/DeepTutor","slug":"no-active-chat-model-configure-one-under-settings","errorCode":null,"errorMessage":"No active chat model. Configure one under Settings → Catalog before creating a GraphRAG knowledge base.","messagePattern":"No active chat model\\. Configure one under Settings → Catalog before creating a GraphRAG knowledge base\\.","errorType":"exception","errorClass":"GraphRagNotConfiguredError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/rag/pipelines/graphrag/config.py","lineNumber":259,"sourceCode":"\n    ``llm_cfg`` / ``embedding_cfg`` are injectable for tests; in production they\n    are resolved from DeepTutor's catalog. Raises\n    :class:`GraphRagNotConfiguredError` if either side has no usable model.\n    \"\"\"\n    if llm_cfg is None:\n        from deeptutor.services.config import resolve_llm_runtime_config\n\n        llm_cfg = resolve_llm_runtime_config()\n    if embedding_cfg is None:\n        from deeptutor.services.embedding import get_embedding_config\n\n        embedding_cfg = get_embedding_config()\n\n    chat_model = getattr(llm_cfg, \"model\", None)\n    embed_model = getattr(embedding_cfg, \"model\", None)\n    embed_dim = int(getattr(embedding_cfg, \"dim\", 0) or 0)\n    if not chat_model:\n        raise GraphRagNotConfiguredError(\n            \"No active chat model. Configure one under Settings → Catalog before \"\n            \"creating a GraphRAG knowledge base.\"\n        )\n    if not embed_model:\n        raise GraphRagNotConfiguredError(\n            \"No active embedding model. Configure one under Settings → Catalog \"\n            \"before creating a GraphRAG knowledge base.\"\n        )\n    if not embed_dim:\n        raise GraphRagNotConfiguredError(\n            \"No active embedding model with a known dimension. Configure one under \"\n            \"Settings → Catalog before creating a GraphRAG knowledge base.\"\n        )\n\n    embedding_binding = str(getattr(embedding_cfg, \"binding\", \"\") or \"\")\n    llm_base = getattr(llm_cfg, \"effective_url\", None) or getattr(llm_cfg, \"base_url\", None)\n    embed_endpoint = getattr(embedding_cfg, \"effective_url\", None) or getattr(\n        embedding_cfg, \"base_url\", None","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/rag/pipelines/graphrag/config.py#L241-L277","documentation":"GraphRagNotConfiguredError from build_settings: no active chat model is configured (llm_cfg.model is empty), so GraphRAG settings cannot be generated. GraphRAG requires a chat model for entity extraction and querying.","triggerScenarios":"Calling write_settings or add_documents for a GraphRAG pipeline before any chat model has been activated in Settings → Catalog.","commonSituations":"Fresh install with no model selected; active model profile was deleted or its activation cleared; settings JSON reset.","solutions":["Open Settings → Catalog and activate a chat model.","Verify get_llm_config().model is non-empty in the running environment (not a stale .env).","Restart/retry the GraphRAG KB creation after activation."],"exampleFix":"# before: no active model\n# after (Settings → Catalog, or API)\nawait settings.set_active_chat_model(\"gpt-4o\")","handlingStrategy":"validation","validationCode":"if not getattr(get_llm_config(), \"model\", None):\n    raise ConfigError(\"activate a chat model first (Settings → Catalog)\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate GraphRAG KB creation UI on presence of an active chat model."],"tags":["graphrag","configuration","missing-model"],"backgroundTag":"missing-model-configuration","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}