{"record":{"id":"9d0196aeeacc27f3","repo":"HKUDS/DeepTutor","slug":"pageindex-oss-indexing-needs-an-api-key-or-local-l","errorCode":null,"errorMessage":"PageIndex OSS indexing needs an API-key or local LLM profile; the active OAuth-only provider cannot be used.","messagePattern":"PageIndex OSS indexing needs an API-key or local LLM profile; the active OAuth-only provider cannot be used\\.","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/rag/pipelines/pageindex/client.py","lineNumber":56,"sourceCode":"    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)\n    prefix = {\n        \"anthropic\": \"anthropic\",\n        \"azure_openai\": \"azure\",\n        \"openai_compat\": \"openai\",\n    }.get(spec.backend)\n    if prefix is None:\n        raise RuntimeError(\"The active LLM transport is not supported by PageIndex OSS indexing.\")\n\n    sdk_model = _prefixed_model(prefix, resolved_model)\n    backend: dict[str, Any] = {}\n    api_key = str(getattr(cfg, \"api_key\", \"\") or \"\").strip()\n    base_url = str(getattr(cfg, \"base_url\", \"\") or \"\").strip()\n    api_version = str(getattr(cfg, \"api_version\", \"\") or \"\").strip()","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/rag/pipelines/pageindex/client.py#L38-L74","documentation":"PageIndex OSS indexing requires an API-key or local LLM profile because the SDK must authenticate programmatically; OAuth-only providers (openai_codex, github_copilot, codebuddy) can't supply a stable API key and are rejected.","triggerScenarios":"resolve_oss_sdk_config runs with an active binding whose spec is OAuth-only (is_oauth true) or whose backend is in {openai_codex, github_copilot, codebuddy}, regardless of model being set.","commonSituations":"User signed in via Copilot/Codex OAuth in the UI and then attempts OSS indexing; defaults pointing at an OAuth provider after a provider catalog change.","solutions":["Switch the active LLM to an API-key provider (e.g., openai with an API key) or a local model (ollama/openai_compat with base_url), then retry.","If you must keep OAuth for chat, create a separate API-key profile and activate it just for PageIndex OSS indexing."],"exampleFix":"# before\n# active binding: github_copilot (OAuth)\nawait pageindex_client.local(...)  # RuntimeError: OAuth-only provider\n\n# after\n# active binding: openai_compat, api_key=..., base_url=http://localhost:11434/v1, model=llama3\nawait pageindex_client.local(...)","handlingStrategy":"validation","validationCode":"spec = find_by_name(active_binding())\nassert not (spec and (spec.is_oauth or spec.backend in {\"openai_codex\", \"github_copilot\", \"codebuddy\"})), \\\n    \"OAuth-only providers cannot drive PageIndex OSS\"","typeGuard":"def llm_supports_oss_indexing(spec) -> bool:\n    return not (spec.is_oauth or spec.backend in {\"openai_codex\", \"github_copilot\", \"codebuddy\"})","tryCatchPattern":"try:\n    cfg = resolve_oss_sdk_config()\nexcept RuntimeError as e:\n    if \"OAuth-only\" in str(e):\n        switch_active_llm(\"openai_compat\", api_key=os.environ[\"LOCAL_LLM_KEY\"])\n        cfg = resolve_oss_sdk_config()\n    else:\n        raise","preventionTips":["Keep a dedicated API-key profile for indexing automation.","Don't rely on interactive OAuth tokens for headless ingestion.","Document provider requirements for PageIndex OSS in onboarding."],"tags":["pageindex","oauth","api-key","llm","configuration"],"backgroundTag":"oauth-provider-unsupported","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}