HKUDS/DeepTutor · error · GraphRagUnsupportedProviderError

graphrag_provider_unsupported

graphrag_provider_unsupported

Error message

GraphRAG cannot use this OAuth-only model provider. Choose an API-key profile.

What it means

GraphRagUnsupportedProviderError (code graphrag_provider_unsupported) from resolve_completion_provider: the selected model profile uses an OAuth-only backend (openai_codex, github_copilot) or has spec.is_oauth true. GraphRAG's LiteLLM transports require plain API-key auth.

Source

Thrown at deeptutor/services/rag/pipelines/graphrag/provider.py:32

def _runtime_binding(llm_cfg: Any) -> str:
    return str(
        getattr(llm_cfg, "binding", None) or getattr(llm_cfg, "provider_name", None) or "openai"
    ).strip()


def resolve_completion_provider(llm_cfg: Any) -> str:
    """Map a resolved DeepTutor provider to the narrow LiteLLM transport GraphRAG needs."""
    binding = _runtime_binding(llm_cfg)
    spec = find_by_name(binding)
    if spec is None:
        return "openai"
    if spec.backend == "anthropic":
        return "anthropic"
    if spec.backend == "azure_openai":
        return "azure"
    if spec.backend in {"openai_codex", "github_copilot"} or spec.is_oauth:
        raise GraphRagUnsupportedProviderError(
            "GraphRAG cannot use this OAuth-only model provider. Choose an API-key profile."
        )
    if spec.backend == "openai_compat":
        # DeepSeek's LiteLLM provider owns its parameter compatibility logic.
        # Other DeepTutor OpenAI-compatible profiles already expose an OpenAI
        # chat-completions endpoint and are safest on the generic transport.
        return "deepseek" if spec.name == "deepseek" else "openai"
    raise GraphRagUnsupportedProviderError(
        "GraphRAG does not support the selected model provider transport."
    )


def resolve_completion_model(llm_cfg: Any) -> str:
    """Return the model identifier expected by the selected LiteLLM transport."""
    model = str(getattr(llm_cfg, "model", "") or "")
    spec = find_by_name(_runtime_binding(llm_cfg))
    return strip_provider_prefix(model, spec)

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Switch the active chat model to an API-key profile (OpenAI, Anthropic, DeepSeek, Azure OpenAI, or generic openai_compat).
  2. Add an API-key profile for the same provider in Settings → Catalog and activate it for GraphRAG KBs.

Example fix

# before
active chat model = "github_copilot" (OAuth)
# after
active chat model = "openai/gpt-4o" (API key set)
Defensive patterns

Strategy: validation

Validate before calling

spec = load_model_spec(active_chat_model)
if spec.backend in {"openai_codex", "github_copilot"} or spec.is_oauth:
    raise ConfigError("choose an API-key profile for GraphRAG")

Prevention

When it happens

Trigger: Resolving the completion provider for GraphRAG settings/probe while the active chat model is a Codex or GitHub Copilot OAuth profile.

Common situations: Users whose day-to-day chat works fine via Copilot/Codex OAuth then attempt a GraphRAG build; default profile set to an OAuth backend in shared setups.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/8e35d59a63ddb4aa. Report an issue: GitHub.