Skip to content

feat(llm): register OrcaRouter in the provider profile system - #174

Open
XiaoHuo888-hue wants to merge 1 commit into
modelscope:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider
Open

feat(llm): register OrcaRouter in the provider profile system#174
XiaoHuo888-hue wants to merge 1 commit into
modelscope:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

What

Registers OrcaRouter as a named provider in Sirchmunk's capability
negotiation, alongside the existing named providers (DeepSeek, MiniMax,
SiliconFlow, etc.).

OrcaRouter (https://www.orcarouter.ai) is an
OpenAI-compatible router exposing 200+ models (OpenAI, Anthropic, Google,
DeepSeek, ...) behind a single API key. Model ids use the router's own
provider/model format (e.g. openai/gpt-4o). It already worked through
the generic OpenAI-compatible path (LLM_BASE_URL), and this change makes
it first-class:

  • src/sirchmunk/llm/openai_chat.py: added "orcarouter" to the
    _PROVIDERS capability profiles and ("orcarouter.ai", "orcarouter") to
    _URL_PATTERNS, so a base URL of https://api.orcarouter.ai/v1 is
    auto-detected and negotiated with the generic-safe profile
    (stream_options enabled, no thinking parameter).
  • README.md / README_zh.md: listed OrcaRouter in the supported
    providers, added an env config example (LLM_BASE_URL, LLM_API_KEY,
    LLM_MODEL_NAME), and a "Using with OrcaRouter" Python SDK example.

Why

OrcaRouter users previously had to type the endpoint manually into the
generic OpenAI-compatible path. A named profile presets the endpoint,
correctly negotiates streaming options, and surfaces OrcaRouter in the
documented provider list — the same treatment the other named providers get.

How to Test

  1. Live API (real OrcaRouter key): OpenAIChat(api_key="sk-orca-...", base_url="https://api.orcarouter.ai/v1", model="openai/gpt-4o").chat(...)
    returns "hello from orcarouter" (non-streaming and streaming, with usage).
  2. Auto-detection: OpenAIChat._detect_provider("https://api.orcarouter.ai/v1")
    returns the orcarouter profile.
  3. uvx --from ruff@0.8.4 ruff check src/sirchmunk/llm/openai_chat.py — clean.

Related Issue

None.

Checklist

  • py_compile clean; provider registration + detection verified
  • Live test with a real OrcaRouter key (non-stream + stream via
    OpenAIChat, both return usage)
  • ruff (repo-pinned v0.8.4) clean on the changed file
  • black — note: the changed file is not black-formatted at main
    (pre-existing, whole file), so the diff matches the file's existing
    alignment style rather than reformatting the file.

Disclosure: I'm an engineer on the OrcaRouter team.

Add OrcaRouter as a named provider profile in OpenAIChat's capability
negotiation. OrcaRouter (https://www.orcarouter.ai) is an OpenAI-compatible
router exposing 200+ models behind a single API key; model ids use its own
provider/model format (e.g. openai/gpt-4o). It already worked through the
generic OpenAI-compatible path (LLM_BASE_URL), but a named profile makes it
first-class in provider auto-detection: the base URL
https://api.orcarouter.ai/v1 is recognized and stream_options negotiation
applies the generic-safe defaults (stream_options enabled, no thinking
param).

- src/sirchmunk/llm/openai_chat.py: add "orcarouter" to _PROVIDERS and
  ("orcarouter.ai", "orcarouter") to _URL_PATTERNS.
- README.md / README_zh.md: list OrcaRouter in the supported providers,
  add an env config example, and a "Using with OrcaRouter" Python SDK
  example.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant