Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

1.5 KB
Raw Blame
"""OrcaRouter LLM provider for Local Deep Research."""

from ..openai_base import OpenAICompatibleProvider


class OrcaRouterProvider(OpenAICompatibleProvider):
    """OrcaRouter provider using OpenAI-compatible endpoint.

    OrcaRouter is an OpenAI-compatible routing gateway that provides access
    to many upstream models through a unified API, automatically supporting
    current and future models without needing code updates. Models are
    addressed with a ``<vendor>/<model>`` namespace (e.g. ``openai/gpt-5``),
    and the virtual ``orcarouter/auto`` router selects an upstream per request.
    """

    provider_name = "OrcaRouter"
    api_key_setting = "llm.orcarouter.api_key"
    default_base_url = "https://api.orcarouter.ai/v1"
    default_model = ""  # User must explicitly pick a model — no silent fallback

    # Metadata for auto-discovery
    provider_key = "ORCAROUTER"
    company_name = "OrcaRouter"
    is_cloud = True

    @classmethod
    def requires_auth_for_models(cls):
        """OrcaRouter needs a valid key to list models through this client.

        ``GET /v1/models`` is open when sent with NO Authorization header, but
        returns 401 for an *invalid* token (verified live). The base class's
        no-auth path sends a placeholder key (``dummy-key-for-models-list``),
        which OrcaRouter would reject with 401 — so we require the real key
        (return True) and only list models once it is configured. This differs
        from OpenRouter, whose ``/models`` ignores the token entirely.
        """
        return True